本文整理汇总了C#中Model.List类的典型用法代码示例。如果您正苦于以下问题:C# List类的具体用法?C# List怎么用?C# List使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
List类属于Model命名空间,在下文中一共展示了List类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GameState
public GameState(DekShape from, DekShape to, List<CardShape> cards, int score)
{
From = from;
To = to;
Cards = cards;
Score = score;
}
示例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();
}
示例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;
}
示例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
}
示例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);
}
示例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;
}
}
示例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;
}
}
示例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;
}
示例9: InitializeUserTypeList
public void InitializeUserTypeList()
{
MyUserTypes = new List<UserType> {
FirstUserType(),
SecondUserType(),
};
}
示例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;
}
示例11: InitializeRefundReasonList
public void InitializeRefundReasonList()
{
MyRefundReasons = new List<RefundReason> {
FirstRefundReason(),
SecondRefundReason()
};
}
示例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;
}
示例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));
}
示例14: TwitterStreamingListener
private TwitterStreamingListener(ITweetsRepository injected)
{
this._stopSearch = false;
this._repository = injected;
this._otherEvents = new List<string>();
this._translationService = new ModelTranslationService();
}
示例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));
}