• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Model.List类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Model.List的典型用法代码示例。如果您正苦于以下问题:C# List类的具体用法?C# List怎么用?C# List使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



List类属于Model命名空间,在下文中一共展示了List类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: GameState

 public GameState(DekShape from, DekShape to, List<CardShape> cards, int score)
 {
     From = from;
     To = to;
     Cards = cards;
     Score = score;
 }
开发者ID:Ratatui,项目名称:Reversi,代码行数:7,代码来源:GameState.cs


示例2: GetAllCategories

        public Category[] GetAllCategories()
        {
            List<Category> myCategories = new List<Category>();
            SqlConnection myConn = new SqlConnection(connstring);
            myConn.Open();

                SqlCommand mySqlCommand = new SqlCommand("select * from Category", myConn);
                SqlDataReader reader = mySqlCommand.ExecuteReader();

            while (reader.Read())
            {
                Category myCategory = new Category();
                object id = reader["Id"];

                if (id != null)
                {
                    int categoryId = -1;
                    if (!int.TryParse(id.ToString(), out categoryId))
                    {
                        throw new Exception("Failed to parse Id of video.");
                    }
                    myCategory.Id = categoryId;
                }

                myCategory.Name = reader["Name"].ToString();

                myCategories.Add(myCategory);
            }

            myConn.Close();

            return myCategories.ToArray();
        }
开发者ID:esteban1000,项目名称:videomanager,代码行数:33,代码来源:MsDatabase.cs


示例3: ProfileData

 public ProfileData()
 {
     AreaMaster = new List<AreaMaster_amr_Info>();
     CodeMaster = new List<CodeMaster_cmt_Info>();
     DinnerMaster = new List<DinnerScheduleMaster_dsm_Info>();
     FormMaster = new List<Sys_FormMaster_fom_Info>();
     IdleStateMaster = new List<IdleState_ism_Info>();
     MachineMaster = new List<MachineMaster_mmt_Info>();
     MachinePrepareItemMapping = new List<MachinePrepareItem_mpit_Info>();
     MachineStopReasonMapping = new List<MachineStopReasonProfile_msrp_Info>();
     MaintainOperationMaster = new List<MaintainOperationMaster_mom_Info>();
     MaintainPlanMaster = new List<MaintainPlan_mtp_Info>();
     MixMaterialDetailMaster = new List<MixMaterialDetail_mmdl_Info>();
     MixMaterialGroupMaster = new List<MixMaterialGroup_mmpg_Info>();
     MaterialMaster = new List<MaterialProfile_mlpf_Info>();
     PrepareProjectMaster = new List<Model.HBPMS.Master.PrepareProjectMaster_ppm_Info>();
     ShiftInfo = new List<ShiftInfo_sifo_Info>();
     ShiftTypeMaster = new List<ShiftTypeMaster_stm_Info>();
     SignalLightsStatusMaster = new List<SignalLightsStatus_sls_Info>();
     StaffInfoMaster = new List<StaffInfoMaster_sim_Info>();
     StopReasonMaster = new List<StopReasonMaster_srm_Info>();
     StructureMaster = new List<StructureMaster_stt_Info>();
     VacationMaster = new List<VacationMaster_vcm_Info>();
     WorkGroupTypeMaster = new List<WorkGroupTypeMaster_wgt_Info>();
     ShiftProjList = new List<ShiftProjList_spl_Info>();
     MaintainOperationEquipments = new List<MaintainPlanEquipmentMapping_mpe_Info>();
     this.MachineSpeed = 0;
 }
开发者ID:Klutzdon,项目名称:PBIMSN,代码行数:28,代码来源:ProfileData.cs


示例4: UCPurchaseBillManang

        BusinessPrint businessPrint;//业务打印功能
        #region 窗体初始化
        /// <summary> 窗体初始化
        /// </summary>
        public UCPurchaseBillManang()
        {
            InitializeComponent();
            dateTimeStart.Value = DateTime.Now.AddDays(-DateTime.Now.Day + 1);
            dateTimeEnd.Value = DateTime.Now;

            base.AddEvent += new ClickHandler(UCPurchaseBillManang_AddEvent);
            base.EditEvent += new ClickHandler(UCPurchaseBillManang_EditEvent);
            base.CopyEvent += new ClickHandler(UCPurchaseBillManang_CopyEvent);
            base.DeleteEvent += new ClickHandler(UCPurchaseBillManang_DeleteEvent);
            base.VerifyEvent += new ClickHandler(UCPurchaseBillManang_VerifyEvent);
            base.SubmitEvent += new ClickHandler(UCPurchaseBillManang_SubmitEvent);
            base.ExportEvent += new ClickHandler(UCPurchaseBillManang_ExportEvent);
            base.ViewEvent += new ClickHandler(UCPurchaseBillManang_ViewEvent);
            base.PrintEvent += new ClickHandler(UCPurchaseBillManang_PrintEvent);
            base.SetEvent += new ClickHandler(UCPurchaseBillManang_SetEvent);
            #region 预览、打印设置
            string printObject = "tb_parts_purchase_billing";
            string printTitle = "采购开单";
            List<string> listNotPrint = new List<string>();
            listNotPrint.Add(purchase_billing_id.Name);
            PaperSize paperSize = new PaperSize();
            paperSize.Width = 297;
            paperSize.Height = 210;
            businessPrint = new BusinessPrint(gvPurchaseOrderList, printObject, printTitle, paperSize, listNotPrint);
            #endregion
        }
开发者ID:caocf,项目名称:workspace-kepler,代码行数:31,代码来源:UCPurchaseBillManang.cs


示例5: OnNavigatedTo

        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            ScrollViewer.SetVerticalScrollMode(CategoryPageGridView, ScrollMode.Disabled);
            CategoryPageViewModel categoryPageViewModel =
                           (CategoryPageViewModel)Resources["CategoryPageViewModel"];
            NavigationItem navigationItem = e.Parameter as NavigationItem;
            var task = Task.Factory.StartNew(async () =>
            {
                var bundle = await DownloadNavigationItem(navigationItem.ReferralId);
                var navigationItems = await DownloadNavigationItemsAsync();

                await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.High,
                    () =>
                    {
                        categoryPageViewModel.Content = bundle.Content[0];
                        var items =  new List<Content>(bundle.Content);
                        items.RemoveAt(0);
                        bundle.Content = items.ToArray();
                        categoryPageViewModel.Bundle = bundle;
                        categoryPageViewModel.NavigationItems = navigationItems;
                        LoadingGrid.Visibility = Visibility.Collapsed;
                        MySplitView.Visibility = Visibility.Visible;
                    }
                );
            });
            base.OnNavigatedTo(e);
        }
开发者ID:arnvanhoutte,项目名称:DeRedactie,代码行数:27,代码来源:CategoryPage.xaml.cs


示例6: GetProductList

        public IList<ProductInfo> GetProductList(int pageIndex, int pageSize, out int Total)
        {
            using (MyContext db = new MyContext())
            {
                Total = (from c in db.Product
                         orderby c.ID
                         select c).Count();
                var items = (from c in db.Product
                             orderby c.ID
                             select c).Skip((pageIndex - 1) * pageSize).Take(pageSize).ToList();
                IList<ProductInfo> ProductInfos = new List<ProductInfo>();
                foreach (var item in items)
                {
                    ProductInfo info = new ProductInfo();
                    info.ID = item.ID;
                    info.ProductTypeID = item.ProductTypeID;
                    info.ProductTypeName = item.ProductType.ProductTypeName;//导航属性的特点
                    info.Image = item.Image;
                    info.ProductName = item.ProductName;
                    info.MarketPrice = item.MarketPrice;
                    info.NewPrice = item.NewPrice;
                    info.GetDate = item.GetDate.ToShortDateString();
                    info.Enable = item.Enable;
                    ProductInfos.Add(info);
                }

                return ProductInfos;
            }
        }
开发者ID:keily,项目名称:EasyUIDEMO,代码行数:29,代码来源:ProductBLL.cs


示例7: GetAllUserInfo

 public List<UserInfoModel> GetAllUserInfo(int pageIndex, int pageSize)
 {
     try
     {
         List<UserInfoModel> list = new List<UserInfoModel>();
         IQueryable<UserInfo> userInfos = context.UserInfo.OrderBy(u => u.ID).Skip((pageIndex - 1) * pageSize).Take(pageSize);
         foreach (var userInfo in userInfos)
         {
             UserInfoModel model=new UserInfoModel();
             model.ID = userInfo.ID;
             model.Address = userInfo.Address;
             model.Email = userInfo.Email;
             model.IdCard = userInfo.IdCard;
             model.Level = userInfo.Level;
             model.Password = userInfo.Pwd;
             model.Phone = userInfo.Phone;
             model.QQ = userInfo.QQ;
             model.Sex = userInfo.Sex;
             model.UserName = userInfo.UserName;
             model.RealName = userInfo.RealName;
             list.Add(model);
         }
         return list;
     }
     catch (Exception)
     {
         return null;
     }
 }
开发者ID:CoryLiu,项目名称:SaleCar,代码行数:29,代码来源:UserInfoDal.cs


示例8: load_ordenow

 public List<Order_entity> load_ordenow()
 {
     List<Order_entity> l = new List<Order_entity>();
     var list = (from a in db.ESHOP_ORDERs
                 join b in db.ESHOP_ORDER_ITEMs on a.ORDER_ID equals b.ORDER_ID
                 join c in db.ESHOP_NEWs on b.NEWS_ID equals c.NEWS_ID
                 join d in db.ESHOP_NEWS_CATs on c.NEWS_ID equals d.NEWS_ID
                 select new
                 {
                     c.NEWS_TITLE,
                     a.ORDER_NAME,
                     a.ORDER_ID,
                     c.NEWS_SEO_URL,
                     c.NEWS_URL,
                     d.ESHOP_CATEGORy.CAT_SEO_URL
                 }).OrderByDescending(n => n.ORDER_ID).Take(10);
     foreach (var i in list)
     {
         Order_entity order = new Order_entity();
         order.CAT_SEO_URL = i.CAT_SEO_URL;
         order.NEWS_SEO_URL = i.NEWS_SEO_URL;
         order.NEWS_URL = i.NEWS_URL;
         order.ORDER_NAME = i.ORDER_NAME;
         order.NEWS_TITLE = i.NEWS_TITLE;
         l.Add(order);
     }
     return l;
 }
开发者ID:htphongqn,项目名称:websitegiaoxu,代码行数:28,代码来源:Order_now.cs


示例9: InitializeUserTypeList

 public void InitializeUserTypeList()
 {
     MyUserTypes = new List<UserType> {
         FirstUserType(),
         SecondUserType(),
     };
 }
开发者ID:haithemaraissia,项目名称:PC,代码行数:7,代码来源:FakeUserTypes.cs


示例10: Load_search_resultM

        public List<Pro_details_entity> Load_search_resultM(string _txt, int type, int skip, int limit)
        {
            List<Pro_details_entity> l = new List<Pro_details_entity>();
            var list = (from c in db.ESHOP_NEWS_CATs
                        join a in db.ESHOP_NEWs on c.NEWS_ID equals a.NEWS_ID
                        join b in db.ESHOP_CATEGORies on c.CAT_ID equals b.CAT_ID
                        where (SqlMethods.Like(a.NEWS_KEYWORD_ASCII, ClearUnicode(_txt)) || "" == _txt || "%%" == _txt)
                        && a.NEWS_TYPE == type
                        select new { a.NEWS_ID, a.NEWS_TITLE, a.NEWS_IMAGE3, a.NEWS_PRICE1, a.NEWS_PRICE2, a.NEWS_DESC, a.NEWS_SEO_URL, a.NEWS_URL, a.NEWS_ORDER, a.NEWS_ORDER_PERIOD, a.NEWS_PUBLISHDATE, b.CAT_SEO_URL }).Distinct().OrderByDescending(n => n.NEWS_ID).OrderByDescending(n => n.NEWS_ORDER).Skip(skip).Take(limit);
            foreach (var i in list)
            {
                Pro_details_entity pro = new Pro_details_entity();
                pro.NEWS_ID = i.NEWS_ID;
                pro.NEWS_TITLE = i.NEWS_TITLE;
                pro.NEWS_IMAGE3 = i.NEWS_IMAGE3;
                pro.NEWS_DESC = i.NEWS_DESC;
                pro.NEWS_SEO_URL = i.NEWS_SEO_URL;
                pro.NEWS_URL = i.NEWS_URL;
                pro.NEWS_ORDER = Utils.CIntDef(i.NEWS_ORDER);
                pro.NEWS_ORDER_PERIOD = Utils.CIntDef(i.NEWS_ORDER_PERIOD);
                pro.NEWS_PRICE1 = Utils.CDecDef(i.NEWS_PRICE1);
                pro.NEWS_PRICE2 = Utils.CDecDef(i.NEWS_PRICE2);
                pro.NEWS_PUBLISHDATE = Utils.CDateDef(i.NEWS_PUBLISHDATE, DateTime.Now);
                pro.CAT_SEO_URL = i.CAT_SEO_URL;
                l.Add(pro);
            }
            return l;

        }
开发者ID:htphongqn,项目名称:websitegiaoxu,代码行数:29,代码来源:Search_result.cs


示例11: InitializeRefundReasonList

 public void InitializeRefundReasonList()
 {
     MyRefundReasons = new List<RefundReason> {
         FirstRefundReason(),
         SecondRefundReason()
     };
 }
开发者ID:haithemaraissia,项目名称:PC,代码行数:7,代码来源:FakeRefundReasons.cs


示例12: GetByDate

        public IList<Model.DJ_GroupConsumRecord> GetByDate(int year, int month, string code, int djsid, bool? IsVerified_City, bool? IsVerified_Country)
        {
            List<DJ_GroupConsumRecord> ListRecord = IDjgroup.GetByDate(year, month, code, djsid, IsVerified_City, IsVerified_Country).ToList();
            //过滤掉有相同团队的记录
            List<DJ_GroupConsumRecord> List = new List<DJ_GroupConsumRecord>();
            foreach (DJ_GroupConsumRecord item in ListRecord)
            {
                if (List.Where(x => x.Route.DJ_TourGroup.Id == item.Route.DJ_TourGroup.Id).Where(x => x.ConsumeTime.ToShortDateString() == item.ConsumeTime.ToShortDateString()).Where(x => x.Enterprise.Id == item.Enterprise.Id).Count() == 0)
                {
                    //加入省市县的判断
                    //省
                    if (code.Substring(2) == "0000")
                    {

                    }
                    else if (code.Substring(4, 2) == "00")
                    {
                        if (item.Enterprise.Area.Code.Substring(0,4) == code.Substring(0,4))
                        {
                            List.Add(item);
                        }
                    }
                    else
                    {
                        if (item.Enterprise.Area.Code == code)
                        {
                            List.Add(item);
                        }
                    }
                }
            }
            return List;
        }
开发者ID:phiree,项目名称:testttt,代码行数:33,代码来源:BLLDJConsumRecord.cs


示例13: Filter_Get_Category

        public void Filter_Get_Category(int iDisplayLength, int iDisplayStart, int iSortCol_0, string sSortDir_0, string sSearch)
        {
            int filteredCount = 0;

            List<Category> CategorysList = new List<Category>();

            DataTable dt = Category_DA.Filter_Get_Category(iDisplayLength, iDisplayStart, iSortCol_0, sSortDir_0, sSearch);

            foreach (DataRow row in dt.Rows)
            {
                int Id = int.Parse(row["Id"].ToString());
                string Name = row["Name"].ToString();
                bool IsDeleted = Convert.ToBoolean(row["IsDeleted"].ToString());
                filteredCount = int.Parse(row["TotalCount"].ToString());
                CategorysList.Add(new Category
                {

                    Name = Name,
                    ForEdit = Id,
                    ForDelete = Id
                });
            }
            var result = new
            {
                iTotalRecords = GetTotalCategoryCount(),
                iTotalDisplayRecords = filteredCount,
                aaData = CategorysList
            };

            JavaScriptSerializer js = new JavaScriptSerializer();
            Context.Response.Write(js.Serialize(result));
        }
开发者ID:syedusamamazhar,项目名称:LeatherAppRepo,代码行数:32,代码来源:ServiceCategory.asmx.cs


示例14: TwitterStreamingListener

 private TwitterStreamingListener(ITweetsRepository injected)
 {
     this._stopSearch = false;
     this._repository = injected;
     this._otherEvents = new List<string>();
     this._translationService = new ModelTranslationService();
 }
开发者ID:vgheri,项目名称:TwitterSearch,代码行数:7,代码来源:TwitterStreamingListener.cs


示例15: Filter_Get_Yarn_Head_Count

        public void Filter_Get_Yarn_Head_Count(int iDisplayLength, int iDisplayStart, int iSortCol_0, string sSortDir_0, string sSearch)
        {
            int filteredCount = 0;

            List<Yarn_Head_Count> Yarn_Head_Count_List = new List<Yarn_Head_Count>();

            DataTable dt = Yarn_Head_Count_DA.Filter_Get_Yarn_Head_Count(iDisplayLength, iDisplayStart, iSortCol_0, sSortDir_0, sSearch);

            foreach (DataRow row in dt.Rows)
            {

                filteredCount = int.Parse(row["TotalCount"].ToString());

                Yarn_Head_Count_List.Add(new Yarn_Head_Count
                {
                    ID = int.Parse(row["ID"].ToString()),
                    Head_Count = int.Parse(row["Head_Count"].ToString()),
                    ForEdit = row["ID"].ToString(),
                    ForDelete = row["ID"].ToString()
                });
            }
            var result = new
            {
                iTotalRecords = GetTotal_Yarn_Head_Count_Count(),
                iTotalDisplayRecords = filteredCount,
                aaData = Yarn_Head_Count_List
            };

            JavaScriptSerializer js = new JavaScriptSerializer();
            Context.Response.Write(js.Serialize(result));
        }
开发者ID:syedusamamazhar,项目名称:LeatherExportAppRepo,代码行数:31,代码来源:ServiceYarn_Head_Count.asmx.cs


示例16: Build

        internal static string Build(List<TestAttribute> Categories)
        {
            string source = "";

            var list = new List<string>();

            Categories
                .ToList()
                .ForEach(c => list.Add(c.GetName()));

            list.Sort();

            var catParams = new string[] {
                ExtentFlag.GetPlaceHolder("testCategory"),
                ExtentFlag.GetPlaceHolder("testCategoryU")
            };

            list.ForEach(c =>
            {
                var catValues = new string[] {
                    c,
                    c.ToLower().Replace(" ", "")
                };

                source += SourceBuilder.Build(CategoryFilterHtml.GetOptionSource(), catParams, catValues);
            });

            return source;
        }
开发者ID:karthikbhatnagar,项目名称:extentreports,代码行数:29,代码来源:CategoryOptionBuilder.cs


示例17: SourceForm

        public SourceForm()
        {
            InitializeComponent();
            LiterarySources = new DataTable();
            var column = new DataColumn()
            {
                Caption = "Literary Source",
                ColumnName = "LiterarySource",
                ReadOnly = true,
                DataType = typeof (string)
            };
            LiterarySources.Columns.Add(column);
            column = new DataColumn()
            {
                Caption = "Description",
                ColumnName = "GetDescription",
                ReadOnly = true,
                DataType = typeof (string)
            };
            LiterarySources.Columns.Add(column);
            SourceDataGridView.DataSource = LiterarySources;
            SourceDataGridView.Columns[0].Width = 120;
            SourceDataGridView.Columns[1].Width = 225;

            SourceDataGridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
            sourcesList = new List<IReferences>();
        }
开发者ID:nespec93,项目名称:NewRepozitoty,代码行数:27,代码来源:Form1.cs


示例18: CRUDController

 public CRUDController()
 {
     customersList = new List<ICustomer>();
     daf = new DataAccessFacade();
     sc = new SerializeController();
     cf = new CustomerFacade();
 }
开发者ID:Klockz,项目名称:NBservicesprint4,代码行数:7,代码来源:CRUDController.cs


示例19: getDistrictsList

 public List<District> getDistrictsList()
 {
     List<District> list = new List<District>();
     list.Add(new District() { Id=-1, Name="[Select District]"});
     list.AddRange(uOW.DistrictRepo.Get());
     return list;
 }
开发者ID:nicholaszim,项目名称:TaxiBackup,代码行数:7,代码来源:TarifManager.cs


示例20: TvdbLibAccess

 public TvdbLibAccess(IConfiguration configuration, List<IEpisodeMatchMethod> matchMethods, ITvDbService tvDbService)
 {
     this.config = configuration;
     this.matchMethods = matchMethods;
     this.tvDbService = tvDbService;
     this.Init();
 }
开发者ID:Christoph21x,项目名称:ARGUS-TV-GuideEnhancer,代码行数:7,代码来源:TvdbLibAccess.cs



注:本文中的Model.List类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Model.Model类代码示例发布时间:2022-05-26
下一篇:
C# Model.Dictionary类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap