public static string Export(Replay replay) { Game game = new Game(replay); GameState oldState = null; List<GameAction> actions = new List<GameAction>(); for (int i = 0; i < replay.Actions.Count; i++) { if (replay.Actions[i] is ReplayTimeAction) actions.Add(replay.Actions[i]); game.Seek(i); List<GameAction> newActions = StateDelta.Delta(oldState, game.State); actions.AddRange(newActions); if (game.State != null) oldState = game.State.Clone(); } List<JObject> jActions = new List<JObject>(); TimeSpan time = TimeSpan.Zero; foreach (var action in actions) { if (action is ReplayTimeAction) time = ((ReplayTimeAction)action).Time; else jActions.Add(SerializeAction(action, time)); } JObject json = new JObject(new JProperty("changes", new JArray(jActions))); return json.ToString(Newtonsoft.Json.Formatting.None); }
private void Init() { seriesNameMapping = this.config.getSeriesNameMap(); seriesIgnore = this.config.getIgnoredSeries(); this.language = SetLanguage(); this.IntializeRegexMappings(); }
public TvdbLibAccess(IConfiguration configuration, List<IEpisodeMatchMethod> matchMethods, ITvDbService tvDbService) { this.config = configuration; this.matchMethods = matchMethods; this.tvDbService = tvDbService; this.Init(); }
public CRUDController() { customersList = new List<ICustomer>(); daf = new DataAccessFacade(); sc = new SerializeController(); cf = new CustomerFacade(); }
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; }
public void InitializeUserTypeList() { MyUserTypes = new List<UserType> { FirstUserType(), SecondUserType(), }; }
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; }
public void InitializeRefundReasonList() { MyRefundReasons = new List<RefundReason> { FirstRefundReason(), SecondRefundReason() }; }
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; }
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; }
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)); }
private TwitterStreamingListener(ITweetsRepository injected) { this._stopSearch = false; this._repository = injected; this._otherEvents = new List<string>(); this._translationService = new ModelTranslationService(); }
public GameState(DekShape from, DekShape to, List<CardShape> cards, int score) { From = from; To = to; Cards = cards; Score = score; }
public void InitializeOrderTypeList() { MyOrderTypes = new List<OrderType> { FirstOrderType(), SecondOrderType() }; }
/// <summary> /// 获得数据列表 /// </summary> public List<ObjectGroup> DataTableToList(DataTable dt) { List<ObjectGroup> modelList = new List<ObjectGroup>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { ObjectGroup model; for (int n = 0; n < rowsCount; n++) { model = new ObjectGroup(); if(dt.Rows[n]["ID"]!=null && dt.Rows[n]["ID"].ToString()!="") { model.ID=int.Parse(dt.Rows[n]["ID"].ToString()); } if(dt.Rows[n]["Code"]!=null && dt.Rows[n]["Code"].ToString()!="") { model.Code=dt.Rows[n]["Code"].ToString(); } if(dt.Rows[n]["Name"]!=null && dt.Rows[n]["Name"].ToString()!="") { model.Name=dt.Rows[n]["Name"].ToString(); } if(dt.Rows[n]["TypeCode"]!=null && dt.Rows[n]["TypeCode"].ToString()!="") { model.TypeCode=dt.Rows[n]["TypeCode"].ToString(); } if(dt.Rows[n]["OrganID"]!=null && dt.Rows[n]["OrganID"].ToString()!="") { model.OrganID=int.Parse(dt.Rows[n]["OrganID"].ToString()); } modelList.Add(model); } } return modelList; }
void UCOldPartsPalautusManager_ConfirmEvent(object sender, EventArgs e) { List<SQLObj> listSql = new List<SQLObj>(); string strReceId = string.Empty;//单据Id值 string strSTime = string.Empty;//回收周期开始时间 string strETime = string.Empty;//回收周期结束时间 string oldBillNum = string.Empty;//旧件回收单号 foreach (DataGridViewRow dr in dgvRData.Rows) { object isCheck = dr.Cells["colCheck"].EditedFormattedValue; if (isCheck != null && (bool)isCheck) { strReceId += dr.Cells["return_id"].Value.ToString() + ","; oldBillNum += dr.Cells["oldpart_receipts_no"].Value.ToString() + ","; long tickeS = Convert.ToInt64(CommonCtrl.IsNullToString(dr.Cells["create_time_start"].Value)); long tickeE = Convert.ToInt64(CommonCtrl.IsNullToString(dr.Cells["create_time_end"].Value)); strSTime = Common.UtcLongToLocalDateTime(tickeS).ToString("yyyy-MM-dd"); strETime = Common.UtcLongToLocalDateTime(tickeE).ToString("yyyy-MM-dd"); } } if (string.IsNullOrEmpty(strReceId)) { MessageBoxEx.Show("请选择需要确认的记录!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } ProcessModeToYT(oldBillNum.Substring(0, oldBillNum.Length - 1), strReceId.Substring(0, strReceId.Length - 1), strSTime, strETime); MessageBoxEx.Show("确认成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); BindPageData(); }
public Video[] GetAllVideo() { List<Video> myVideos = new List<Video>(); SqlConnection myConn = new SqlConnection(connstring); myConn.Open(); SqlCommand mySqlCommand = new SqlCommand("select * from video", myConn); SqlDataReader reader = mySqlCommand.ExecuteReader(); while (reader.Read()) { Video myVideo = new Video(); object id = reader["Id"]; if(id != null) { int videoId = -1; if (!int.TryParse(id.ToString(), out videoId)) { throw new Exception("Failed to parse Id of video."); } myVideo.Id = videoId; } myVideo.Name = reader["Name"].ToString(); myVideo.Url = reader["Url"].ToString(); myVideos.Add(myVideo); } myConn.Close(); return myVideos.ToArray(); }
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; }
public List<Pro_details_entity> loadproAjax(int _Catid, int skip, int limit) { bool checkhsx = checkHangsx(_Catid); List<Pro_details_entity> l = new List<Pro_details_entity>(); var list = (from a in db.ESHOP_NEWS_CATs join b in db.ESHOP_NEWs on a.NEWS_ID equals b.NEWS_ID join c in db.ESHOP_CATEGORies on a.CAT_ID equals c.CAT_ID where (checkhsx==true ? b.UNIT_ID2==_Catid : c.CAT_ID == _Catid || c.CAT_PARENT_PATH.Contains(_Catid.ToString())) select new { b.NEWS_ID, b.NEWS_TITLE, b.NEWS_IMAGE3, b.NEWS_DESC, b.NEWS_PRICE1, b.NEWS_PRICE2, b.NEWS_SEO_URL, b.NEWS_URL, b.NEWS_ORDER, b.NEWS_ORDER_PERIOD, b.NEWS_PUBLISHDATE, b.NEWS_FIELD3 }).Distinct().OrderByDescending(n => n.NEWS_PUBLISHDATE).OrderByDescending(n => n.NEWS_ORDER).Skip(skip).Take(limit).ToList(); 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.NEWS_FIELD3 = i.NEWS_FIELD3; l.Add(pro); } return l; }
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(); }
//导入数据到页面显示 public void LoadUserData() { string sqlCmd = "select * from tb_UserInfo"; string exception = ""; List<UserInfo> ui = new List<UserInfo>(); UserInfoBLL.Select(ref ui, ref exception, sqlCmd); if (exception.Length > 0) { //Alert ClientScript.RegisterStartupScript(this.GetType(), "error", "f_alert('error','获取数据失败,请重试');", true); } else { if (ui.Count <= 0) { ClientScript.RegisterStartupScript(this.GetType(), "error", "f_alert('error','数据库中没有用户信息');", true); } else { var jser = new JavaScriptSerializer(); var json = jser.Serialize(ui); json = "{\"Rows\":" + json + ",\"Total\":" + ui.Count + "}"; JsonData.Value = json; ClientScript.RegisterStartupScript(this.GetType(), "showdata", "ShowUserInfo();", true); } } }
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); }
void UCSalePlanView_SaveEvent(object sender, EventArgs e) { try { gvPurchasePlanList.EndEdit(); List<SysSQLString> listSql = new List<SysSQLString>(); SysSQLString sysStringSql = new SysSQLString(); sysStringSql.cmdType = CommandType.Text; Dictionary<string, string> dic = new Dictionary<string, string>();//参数 string sql1 = string.Format(@" Update tb_parts_sale_plan Set is_suspend=@is_suspend,suspend_reason=@suspend_reason,update_by=@update_by, update_name=@update_name,update_time=@update_time,operators=@operators,operator_name=@operator_name where sale_plan_id=@sale_plan_id;"); dic.Add("is_suspend", chkis_suspend.Checked ? "0" : "1");//选中(中止):0,未选中(不中止):1 dic.Add("suspend_reason", txtsuspend_reason.Caption.Trim()); dic.Add("update_by", GlobalStaticObj.UserID); dic.Add("update_name", GlobalStaticObj.UserName); dic.Add("update_time", Common.LocalDateTimeToUtcLong(DateTime.Now).ToString()); dic.Add("operators", GlobalStaticObj.UserID); dic.Add("operator_name", GlobalStaticObj.UserName); dic.Add("sale_plan_id", planId); sysStringSql.sqlString = sql1; sysStringSql.Param = dic; listSql.Add(sysStringSql); foreach (DataGridViewRow dr in gvPurchasePlanList.Rows) { string is_suspend = "1"; if (dr.Cells["is_suspend"].Value == null) { is_suspend = "1"; } if ((bool)dr.Cells["is_suspend"].EditedFormattedValue) { is_suspend = "0"; } else { is_suspend = "1"; } sysStringSql = new SysSQLString(); sysStringSql.cmdType = CommandType.Text; dic = new Dictionary<string, string>(); dic.Add("is_suspend", is_suspend); dic.Add("sale_plan_id", planId); dic.Add("parts_code", dr.Cells["parts_code"].Value.ToString()); string sql2 = "Update tb_parts_sale_plan_p set is_suspend=@is_suspend where sale_plan_id=@sale_plan_id and parts_code=@parts_code;"; sysStringSql.sqlString = sql2; sysStringSql.Param = dic; listSql.Add(sysStringSql); } if (DBHelper.BatchExeSQLStringMultiByTrans("修改采购计划单", listSql)) { MessageBoxEx.Show("保存成功!"); uc.BindgvSalePlanList(); deleteMenuByTag(this.Tag.ToString(), uc.Name); } else { MessageBoxEx.Show("保存失败!"); } } catch (Exception ex) { MessageBoxEx.Show("操作失败!"); } }
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 }
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; }
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; } }
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; } }
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>(); }
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)); }
public List<Template> GetTemplate(int pageSize,int pageIndex,ref int recordCount) { SqlParameter[] parameters = { SqlParamHelper.MakeParam("@RecordNum",SqlDbType.Int,4,ParameterDirection.InputOutput,recordCount), SqlParamHelper.MakeInParam("@SelectList",SqlDbType.VarChar,2000,Template_INFO_FIELDS), SqlParamHelper.MakeInParam("@TableSource",SqlDbType.VarChar,100,"[View_TemplateDictionary]"), SqlParamHelper.MakeInParam("@SearchCondition",SqlDbType.VarChar,2000,string.Empty), SqlParamHelper.MakeInParam("@OrderExpression",SqlDbType.VarChar,1000,"Addtime"), SqlParamHelper.MakeInParam("@PageSize",SqlDbType.Int,4,pageSize), SqlParamHelper.MakeInParam("@PageIndex",SqlDbType.Int,4,pageIndex) }; List<Template> list = new List<Template>(); using (IDataReader dr = SqlHelper.ExecuteReader(ReadConnectionString,CommandType.StoredProcedure,"PR_GetDataByPageIndex",parameters)){ while(dr.Read()){ list.Add(BindTemplate(dr)); } } try{ recordCount = Convert.ToInt32(parameters[0].Value); } catch{ recordCount = 0; } return list; }
public int InsertList(Model.List list) { //开单 string sql = "insert List(deskno,num,remark) values(@deskno,@num,@remark)"; SqlParameter[] par = new SqlParameter[] { new SqlParameter("@deskno", list.deskno), new SqlParameter("@num", list.num), new SqlParameter("@remark", list.remark), // new SqlParameter("@price", menu.price) }; int ur = SqlHelper.ExecuteNonQuery(SqlHelper.ConnectionString, CommandType.Text, sql, par); return(ur); }
public int insertList(Model.List list) { return(new ListService().InsertList(list)); }