private void ModelToTextBox(TPurchasePlan info) { if (!string.IsNullOrEmpty(info.Content.Provider)) //供应商 { //hidProvider.Value = info.Content.Provider; Base_ClientInfo tempClient = ClientInfoService.Instance.GetClientInfoByCode(info.Content.Provider); if (tempClient != null) { //txtProviderName.Text = tempClient.ShortName; //hidProviderName.Value = tempClient.ShortName; } } txtPurchasePlanBillCode.Text = info.Content.PurchaseBillCode; //入库单号 txtPurchasePlanDate.Text = info.Content.PurchaseDate.ToString(); //入库日期 txtDeptName.Text = info.Content.DeptName; lblOperator.Text = user_idao.GetUserInfo(info.Content.Operator).Rows[0]["User_Name"].ToString(); //if (!string.IsNullOrEmpty(info.Content.CheckMan)) //经办人 //{ // //hidPurchaseMan.Value = info.Content.CheckMan; // //EmployeeInfo tempEmployee = EmployeeInfoService.Instance.GetEmployeeInfoByCode(info.Content.CheckMan); // //if (tempEmployee != null) // //{ // // txTPurchasePlanManName.Text = tempEmployee.Name; // // hidPurchaseManName.Value = tempEmployee.Name; // //} //} }
public bool UpdateInfo(Base_ClientInfo info) { var query = from item in dc.Base_ClientInfo where item.ID == info.ID select item; BatchEvaluate.Eval(info, query.First()); dc.SubmitChanges(); return(true); }
public int InsertInfo(Base_ClientInfo info) { string msg = dao.ValidateRepeat(info); if (msg == "") { return(dao.InsertInfo(info)); } else { throw new Exception(msg); } }
private void ModelToTextBox(TPurchaseIndent info) { if (!string.IsNullOrEmpty(info.Content.Provider)) //供应商 { Base_ClientInfo tempClient = ClientInfoService.Instance.GetClientInfoByCode(info.Content.Provider); if (tempClient != null) { } } txtPurchasePlanBillCode.Text = info.Content.PurchaseBillCode; //入库单号 txtPurchasePlanDate.Text = info.Content.PurchaseDate.ToString(); //入库日期 lblOperator.Text = user_idao.GetUserInfo(info.Content.Operator).Rows[0]["User_Name"].ToString(); }
/// <summary> /// 验证记录中是否有重复值 /// </summary> /// <param name="info"> 实体 </param> /// <returns> 如果不重复返回"" </returns> public string ValidateRepeat(Base_ClientInfo info) { int cnt1 = dc.Base_ClientInfo.Where(itm => itm.ClientCode == info.ClientCode && itm.ID != info.ID).Count(); if (cnt1 > 0) { return("代码重复"); } int cnt2 = dc.Base_ClientInfo.Where(itm => itm.ShortName == info.ShortName && itm.ID != info.ID).Count(); if (cnt2 > 0) { return("简称重复"); } return(""); }
public bool UpdateInfo(Base_ClientInfo info) { return(dao.UpdateInfo(info)); }
public int InsertInfo(Base_ClientInfo info) { dc.Base_ClientInfo.InsertOnSubmit(info); dc.SubmitChanges(); return(info.ID); }