當前位置: 首頁>>代碼示例>>C#>>正文


C# List.ToList方法代碼示例

本文整理匯總了C#中iTextSharp.text.List.ToList方法的典型用法代碼示例。如果您正苦於以下問題:C# List.ToList方法的具體用法?C# List.ToList怎麽用?C# List.ToList使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在iTextSharp.text.List的用法示例。


在下文中一共展示了List.ToList方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Index


//.........這裏部分代碼省略.........
                    if (!string.IsNullOrEmpty(customerid))
                    {
                        Place pplace = _IPlaceRepository.GetPlaceByID(new Guid(customerid));
                        if (pplace != null)
                        {
                            Session["ClientCompanyName"] = pplace.PlaceName;
                            sb.Append("<a href='#' id='ulaworkergroup' class='btn green' data-toggle='dropdown'><i class='icon-map-marker'></i>" + pplace.PlaceName + " <i class='icon-angle-down'></i></a>");
                            sb1.Append("<a href='#' id='ulaworkergroup' class='btn green' data-toggle='dropdown'><i class='icon-map-marker'></i>" + pplace.PlaceName + " <i class='icon-angle-down'></i></a>");
                        }
                    }
                    else
                    {
                        if (!string.IsNullOrEmpty(selection) && selection == "All")
                        {
                            sb.Append("<a href='#' id='ulaworkergroup' class='btn green' data-toggle='dropdown'><i class='icon-map-marker'></i>All <i class='icon-angle-down'></i></a>");
                            sb1.Append("<a href='#' id='ulaworkergroup' class='btn green' data-toggle='dropdown'><i class='icon-map-marker'></i>All <i class='icon-angle-down'></i></a>");
                        }
                        else
                        {
                            sb.Append("<a href='#' id='ulaworkergroup' class='btn green' data-toggle='dropdown'><i class='icon-map-marker'></i>Select Client <i class='icon-angle-down'></i></a>");
                            sb1.Append("<a href='#' id='ulaworkergroup' class='btn green' data-toggle='dropdown'><i class='icon-map-marker'></i>Select Client <i class='icon-angle-down'></i></a>");
                        }
                    }
                    sb.Append("<ul id='ulworkgroup' style='height:100px;overflow-y:scroll' class='dropdown-menu pull-right'>");
                    sb1.Append("<ul id='ulworkgroup' style='height:100px;overflow-y:scroll' class='dropdown-menu pull-right'>");
                    if (string.IsNullOrEmpty(selection) || selection != "All")
                    {
                        //sb.Append("<li><a href=" + Url.Action("Index", new { id = "Visits", selection = "All" }) + ">All</a></li>");
                        //sb1.Append("<li><a href=" + Url.Action("Index", new { id = "Non-Visits", selection = "All" }) + ">All</a></li>");
                        sb.Append("<li><a onclick=\"RedirectAction('Visits','');\">All</a></li>");
                        sb1.Append("<li><a onclick=\"RedirectAction('NonVisits','');\">All</a></li>");
                    }

                    List<Place> PlaceList = _IPlaceRepository.GetPlaceByOrganizationGUID(new Guid(Session["OrganizationGUID"].ToString())).ToList();
                    foreach (Place item in PlaceList)
                    {
                        //sb.Append("<li><a href=" + Url.Action("Index", new { id = "Visits", customerid = item.PlaceGUID.ToString() }) + " data-groupguid=" + item.PlaceGUID + ">" + item.PlaceName + "</a></li>");
                        //sb1.Append("<li><a href=" + Url.Action("Index", new { id = "Non-Visits", customerid = item.PlaceGUID.ToString() }) + " data-groupguid=" + item.PlaceGUID + ">" + item.PlaceName + "</a></li>");

                        sb.Append("<li><a onclick=\"RedirectAction('Visits','" + item.PlaceGUID.ToString() + "');\" data-groupguid=" + item.PlaceGUID + ">" + item.PlaceName + "</a></li>");
                        sb1.Append("<li><a onclick=\"RedirectAction('NonVisits','" + item.PlaceGUID.ToString() + "');\" data-groupguid=" + item.PlaceGUID + ">" + item.PlaceName + "</a></li>");
                    }
                    sb.Append("</ul>");
                    sb.Append("</div>");
                    sb.Append("</div>");
                    sb1.Append("</ul>");
                    sb1.Append("</div>");
                    sb1.Append("</div>");
                    ViewBag.CustomerListVisit = sb.ToString();
                    ViewBag.CustomerListNonVisit = sb1.ToString();

                    Market _market = new Market();
                    Job ljob = new Job();
                    ljob.OrganizationGUID = new Guid(Session["OrganizationGUID"].ToString());
                    _market.OrganizationGUID = new Guid(Session["OrganizationGUID"].ToString());
                    if (!string.IsNullOrEmpty(customerid))
                    {
                        _market.OwnerGUID = new Guid(customerid);
                        ljob.CustomerGUID = new Guid(customerid);
                    }

                    DateTime From, To, Datecontent, LModifiedDate;

                    //LastModifiedDate = _IUserRepository.DecodeFrom64(LastModifiedDate);
                    if (!string.IsNullOrEmpty(LastModifiedDate) && ParseExact(LastModifiedDate, "dd-MM-yyyy", out LModifiedDate))
                    {
開發者ID:sfielder,項目名稱:heroku-net-example,代碼行數:67,代碼來源:StoreVisitController.cs

示例2: Index

        //
        // GET: /JobStatus/
        public ActionResult Index(string FromDate = "", string ToDate = "", string assigneduserguid = "", string jobindexguid = "", string Date = "", string selection = "", string ponumber = "", string RowCount = "", int page = 1, string search = "")
        {
            Logger.Debug("Inside AssignJob Controller- Index");
            try
            {
                ViewBag.AssignedUserID = assigneduserguid;
                ViewBag.FromDate = FromDate;
                ViewBag.ToDate = ToDate;
                ViewBag.Date = Date;
                int totalPage = 0;
                int totalRecord = 0;
                int pCount = 0;
                if (Session["OrganizationGUID"] != null)
                {
                    if (!string.IsNullOrEmpty(RowCount))
                    {
                        int.TryParse(RowCount, out pCount);
                        pageCountList(pCount);
                    }
                    else
                    {
                        pageCountList(pCount);
                    }

                    if (!string.IsNullOrEmpty(Date))
                    {
                        ViewBag.DateValue = HttpUtility.HtmlDecode(Date);
                    }
                    var jobStatus = new JobStatusViewModel();
                    jobStatus.JobStatusModel = new List<JobStatusModel>();
                    var jobGroup = new List<Job>();
                    //Job ljob = new Job();
                    DateTime pFrom = new DateTime(), pTo = new DateTime();
                    OrganizationUsersMap pOrganizationUsersMap = _IUserRepository.GetUserByID(new Guid(Session["UserGUID"].ToString()));
                    Logger.Debug("UserGUID:" + Session["UserGUID"].ToString());
                    if (pOrganizationUsersMap != null)
                    {
                        StringBuilder sb = new StringBuilder();
                        sb.Append("<div class='actions'>");
                        sb.Append("<div class='btn-group'>");
                        if (!string.IsNullOrEmpty(assigneduserguid))
                        {
                            ViewBag.AssignedUserID = assigneduserguid;
                            Logger.Debug("Inside AssignedUSerGUID" + assigneduserguid.ToString());
                            UserProfile _userprofile = _IUserProfileRepository.GetUserProfileByUserID(new Guid(assigneduserguid), pOrganizationUsersMap.OrganizationGUID);
                            if (_userprofile != null)
                            {
                                sb.Append("<a href='#' id='ulaworkergroup' class='btn green' data-toggle='dropdown'><i class='icon-map-marker'></i> " + _userprofile.FirstName + " " + _userprofile.LastName + " <i class='icon-angle-down'></i></a>");
                            }
                        }
                        else
                        {

                            if (!string.IsNullOrEmpty(selection) && selection == "All")
                            {
                                sb.Append("<a href='#' id='ulaworkergroup' class='btn green' data-toggle='dropdown'><i class='icon-map-marker'></i> All <i class='icon-angle-down'></i></a>");
                            }
                            else
                            {
                                sb.Append("<a href='#' id='ulaworkergroup' class='btn green' data-toggle='dropdown'><i class='icon-map-marker'></i> Select User <i class='icon-angle-down'></i></a>");
                            }
                        }
                        sb.Append("<ul id='ulworkgroup' style='height:200px;overflow-y:scroll' class='dropdown-menu pull-right'>");

                        if (Session["UserType"] != null && Session["UserType"].ToString() != "ENT_U" && pOrganizationUsersMap != null)
                        {
                            if (string.IsNullOrEmpty(selection) || selection != "All")
                            {
                                //sb.Append("<li><a href=" + Url.Action("Index", "UserActivities", new { selection = "All" }) + ">All</a></li>");
                                sb.Append("<li><a onclick=\"RedirectAction('');\">All</a></li>");
                            }
                            List<UserProfile> pUserProfile = _IUserProfileRepository.GetUserProfilesbyOrganizationGUID(new Guid(Session["OrganizationGUID"].ToString())).ToList();

                            if (pUserProfile != null && pUserProfile.Count > 0)
                            {
                                pUserProfile = pUserProfile.OrderBy(x => x.FirstName).ToList();
                                foreach (UserProfile item in pUserProfile)
                                {
                                    //sb.Append("<li><a href=" + Url.Action("Index", "UserActivities", new { assigneduserguid = item.UserGUID.ToString() }) + " data-groupguid=" + item.UserGUID + ">" + item.FirstName + " " + item.LastName + "</a></li>");
                                    sb.Append("<li><a onclick=\"RedirectAction('" + item.UserGUID.ToString() + "');\" data-groupguid=" + item.UserGUID + ">" + item.FirstName + " " + item.LastName + "</a></li>");
                                    Logger.Debug("Inside User foreach");
                                }
                            }
                        }
                        sb.Append("</ul>");
                        sb.Append("</div>");
                        sb.Append("</div>");

                        ViewBag.UserList = sb.ToString();
                        Job mjob = new Job();
                        if (!string.IsNullOrEmpty(ponumber))
                        {
                            mjob.PONumber = ponumber;
                            TempData["PoNumber"] = ponumber;
                        }
                        //FOr Regional Manager
                        if (Session["UserType"] != null && !string.IsNullOrEmpty(Session["UserType"].ToString()) && Session["UserType"].ToString() == "ENT_U_RM" && Session["UserGUID"] != null)
                        {
//.........這裏部分代碼省略.........
開發者ID:sfielder,項目名稱:heroku-net-example,代碼行數:101,代碼來源:UserActivitiesController.cs

示例3: FiltersPartial

        public ActionResult FiltersPartial(int? param)
        {
            List<AllOptionsModel> readyList = new List<AllOptionsModel>();
            AllOptionsModel readyModel = new AllOptionsModel();

            List<string> list = new List<string>();
            var producers = from x in db.ProdutcsToCategories
                            where x.CatId == param
                            select x.Product.Producer;
            foreach (var producer in producers)
            {
                if (producer != null)
                {
                    if (!list.Contains(producer))
                        list.Add(producer);
                }
            }

            readyModel.listString = list.ToList();

            var option = from x in db.Options
                         where x.categoryId == param
                         select x;
            List<OptionModel> om = new List<OptionModel>();
            foreach (var opt in option)
            {
                OptionModel model = new OptionModel();
                model.option = opt;
                var option2 = from x in db.OptionValues
                              where x.ValueId == opt.ValuesId
                              select x;
                List<OptionValue> ovl = new List<OptionValue>();
                foreach (var optionValue in option2)
                {
                    if (optionValue != null)
                    {
                        //model.optionValueList.Add(optionValue);
                        ovl.Add(optionValue);
                    }
                }
                model.optionValueList = ovl;

                om.Add(model);
                //readyModel.optionList.Add(model);

            }
            readyModel.optionList = om;
            readyList.Add(readyModel);
            return View("FiltersPartial", readyModel);
        }
開發者ID:vitaliyzamiraylo,項目名稱:online_shop,代碼行數:50,代碼來源:HomeController.cs

示例4: GetAllGoals

        public List<GoalFull> GetAllGoals(int? SelectedEmp, string YearEnding)
        {
            List<GoalFull> AllGoals = new List<GoalFull>();
            if (SelectedEmp != null)
            {
                TempData["SelectedEmp"] = SelectedEmp;

                var emp = (from e in db.tblHOTP_Employees
                           where e.EmployeeID == SelectedEmp
                           select e).First();

                var empGoals = from eg in db.tblHOTP_EmployeeGoals
                               join g in db.tblHOTP_Goals on eg.GoalID equals g.GoalID into goal
                               from subGoal in goal.DefaultIfEmpty()
                               join c in db.tblHOTP_Codes on subGoal.Pillar equals c.Code into code
                               from subCode in code.DefaultIfEmpty()
                               where eg.EmployeeID == SelectedEmp && subGoal.YearEnding == YearEnding
                               orderby subCode.Sequence, subGoal.PillarGoalName
                               select eg;
                foreach (tblHOTP_EmployeeGoals eg in empGoals.ToList())
                {
                    PopulatePlan(eg.EmployeeGoalID);
                }

                foreach (tblHOTP_EmployeeGoals eg in empGoals)
                {
                    List<Plan90Full> gPlans = new List<Plan90Full>();
                    var goalPlans = from plan in db.tblHOTP_Plan90 where plan.EmployeeGoalID == eg.EmployeeGoalID select plan;
                    foreach (tblHOTP_Plan90 plan in goalPlans)
                    {
                        gPlans.Add(new Plan90Full()
                        {
                            Plan = plan,
                            ActionSteps = db.tblHOTP_ActionSteps.Where(a => a.PlanID == plan.PlanID).ToList()
                        });
                    }
                    AllGoals.Add(new GoalFull()
                    {
                        EmployeeName = emp.FirstName + " " + emp.LastName,
                        Goal = db.tblHOTP_Goals.Find(eg.GoalID),
                        EmployeeGoal = eg,
                        Plans = gPlans
                    });
                }
            }
            return AllGoals.ToList();
        }
開發者ID:dCogs,項目名稱:HOTP,代碼行數:47,代碼來源:Plan90Controller.cs


注:本文中的iTextSharp.text.List.ToList方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。