private void BindCustomer(string labid) { List <Dictcustomer> dictcustomerback = new List <Dictcustomer>(); if (labid == "0") { List <Dictcustomer> CustomerList = loginservice.GetDictcustomer(); List <Dictlab> dictList = loginservice.GetLoginDictlab(); foreach (Dictlab dict in dictList) { List <Dictcustomer> dictcustomerfirt = CustomerList.FindAll(c => (c.Dictlabid == dict.Dictlabid && c.Customertype == "0" && c.Active == "1") || (c.IsPublic == "1" && c.Active == "1")); foreach (Dictcustomer dictcust in dictcustomerfirt) { if (!dictcustomerback.Contains(dictcust)) { dictcustomerback.Add(dictcust); } } } } else { dictcustomerback = loginservice.GetDictcustomer().FindAll(c => (c.Dictlabid == double.Parse(labid) && c.Customertype == "0" && c.Active == "1") || (c.IsPublic == "1" && c.Active == "1")); } Dictcustomer cus = new Dictcustomer(); cus.Customername = "全部"; cus.Dictcustomerid = -1; dictcustomerback.Insert(0, cus); comCustomer.DataSource = dictcustomerback; comCustomer.DisplayMember = "Customername"; comCustomer.ValueMember = "Dictcustomerid"; }
// 编辑 绑定项目详细信息 protected void gvList_RowClick(object sender, GridRowClickEventArgs e) { try { Form1.Title = "当前状态-编辑"; dictCustomer = new DictCustomerService().GetDictCustomerById(Convert.ToDouble(gvList.DataKeys[e.RowIndex][0])); this.radlActive.SelectedValue = dictCustomer.Active; this.radlCustomerType.SelectedValue = dictCustomer.Customertype; this.tbxAddress.Text = dictCustomer.Address; this.tbxContactman.Text = dictCustomer.Contactman; this.tbxContactPhone.Text = dictCustomer.Contactphone; this.tbxCoustomerCode.Text = dictCustomer.Customercode; this.tbxCoustomerName.Text = dictCustomer.Customername; this.tbxDisplayOrder.Text = dictCustomer.Displayorder.ToString(); this.tbxDocumentCode.Text = dictCustomer.Documentcode; this.tbxDocumentType.Text = dictCustomer.Documenttype; this.tbxEmail.Text = dictCustomer.Email; this.tbxEnAddress.Text = dictCustomer.Engaddress; this.tbxEnErpCode.Text = dictCustomer.Erpcode; this.tbxEnName.Text = dictCustomer.Customerengname; this.tbxErpName.Text = dictCustomer.Erpname; this.tbxFastCode.Text = dictCustomer.Fastcode; this.tbxFax.Text = dictCustomer.Fax; this.tbxPostCode.Text = dictCustomer.Postcode; this.tbxReporTitle.Text = dictCustomer.Reporttitle; this.tbxTelePhone.Text = dictCustomer.Telephone; this.tbxCoustomerName2.Text = dictCustomer.Customername2; this.TxaRemark.Text = dictCustomer.Remark; this.dropDictcheckBillId.SelectedValue = dictCustomer.Dictcheckbillid.ToString(); this.dropDictLab.SelectedValue = dictCustomer.Dictlabid.ToString(); this.dropDictsalemanId.SelectedValue = dictCustomer.Dictsalemanid.ToString(); this.dropStatus.SelectedValue = dictCustomer.Status; if (dictCustomer.Issms == "1") { this.chkIssms.Checked = true; } else { this.chkIssms.Checked = false; } this.radIsPub.SelectedValue = dictCustomer.IsPublic; } catch (Exception ex) { MessageBoxShow(ex.Message, MessageBoxIcon.Error); } }
/// <summary> /// 扫描HPV样本条码 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void tbxbarcode_TriggerClick(object sender, EventArgs e) { if (this.tbxbarcode.Text.Trim() == "") { MessageBoxShow("标本条码为空!"); clearList(); return; } Hashtable ht1 = new Hashtable(); ht1.Add("Barcode", tbxbarcode.Text); List <Hpvinstruments> hpvinstrmentsList = hpvService.GetHpvinstrumentsByWhere(ht1).ToList(); if (hpvinstrmentsList.Count == 0) { this.tbxbarcode.Text = string.Empty; MessageBoxShow("没有找到该标本条码"); clearList(); return; } //单位 Dictcustomer dictcustomer = dictCustomerService.GetDictCustomerById(Convert.ToDouble(hpvinstrmentsList[0].Dictcustomerid)); if (dictcustomer != null) { //分点 Dictlab dictlab = new DictlabService().GetDictlabById(Convert.ToDouble(dictcustomer.Dictlabid)); if (dictlab != null) { this.DropDictLab.SelectedValue = dictlab.Dictlabid.ToString(); if (DropDictLab.SelectedValue != null) { BindCustomer(Convert.ToInt32(DropDictLab.SelectedValue)); this.DropCustomer.SelectedValue = hpvinstrmentsList[0].Dictcustomerid.ToString(); BindDictTest(DropDictLab.SelectedValue); } } } ViewState["SendCustomer"] = null; BindDictProduct(DropCustomer.SelectedValue); string productname = ""; List <OrderRegister> _gridtestList = GetGridTest(false); string msg = registerserver.AddProduct(ref _gridtestList, DropSex.SelectedValue, Convert.ToDouble(hpvinstrmentsList[0].Dicttestitemid), false, Userinfo, ref productname, tbxbarcode.Text); if (msg != string.Empty) { MessageBoxShow(msg); return; } tbxItemTest.Text += productname + ","; BindGridTest(_gridtestList); this.tbxbarcode.Text = string.Empty; }
public static OrganizationInfo ToOrganizationInfo(this Dictcustomer domainDictcustomer) { if (domainDictcustomer == null) { return(null); } var model = new OrganizationInfo(); model.Id = domainDictcustomer.Dictcustomerid.HasValue ? (int)domainDictcustomer.Dictcustomerid : 0; model.Code = domainDictcustomer.Customercode; model.FastCode = domainDictcustomer.Fastcode; model.Name = domainDictcustomer.Customername; model.AliasName = domainDictcustomer.Customername2; model.EnglishName = domainDictcustomer.Customerengname; model.EndlishAddress = domainDictcustomer.Engaddress; model.Address = domainDictcustomer.Address; model.Telephone = domainDictcustomer.Telephone; model.Fax = domainDictcustomer.Fax; model.ZipCode = domainDictcustomer.Postcode; model.ContractMan = domainDictcustomer.Contactman; model.ContractNumber = domainDictcustomer.Contactphone; model.Email = domainDictcustomer.Email; model.Active = (domainDictcustomer.Active == "1"); model.IsPublic = (domainDictcustomer.IsPublic == "1"); model.EnableSmsNotification = (domainDictcustomer.Issms == "1"); model.Remark = domainDictcustomer.Remark; model.Status = domainDictcustomer.Status; model.ErpCode = domainDictcustomer.Erpcode; model.ErpName = domainDictcustomer.Erpname; model.DocumentType = domainDictcustomer.Documenttype; model.DocumentCode = domainDictcustomer.Documentcode; model.DictSalemanId = domainDictcustomer.Dictsalemanid.HasValue ? (int)domainDictcustomer.Dictsalemanid : 0; model.DictCheckBillId = domainDictcustomer.Dictcheckbillid.HasValue ? (int)domainDictcustomer.Dictcheckbillid : 0; model.LabId = domainDictcustomer.Dictlabid.HasValue ? (int)domainDictcustomer.Dictlabid : 0; model.CustomerType = int.Parse(domainDictcustomer.Customertype); model.CustomReportTitle = domainDictcustomer.Reporttitle; model.DisplayOrder = domainDictcustomer.Displayorder.HasValue ? (int)domainDictcustomer.Displayorder : 0; model.LastUpdateDate = domainDictcustomer.Lastupdatedate; model.YGSyncStatus = domainDictcustomer.YGSyncStatus; model.DZSyncStatus = domainDictcustomer.DZSyncStatus; return(model); }
/// <summary> /// 审核单位信息 /// </summary> /// <param name="ids"></param> /// <param name="active"></param> /// <returns></returns> public int AuditCustomerInfo(string ids, string active) { int nflag = 0; try { Hashtable ht = new Hashtable(); ht.Add("dictcustomerid", ids); ht.Add("active", active); ht.Add("lastupdatetime", DateTime.Now); nflag = update("Dict.AuditCustomerInfo", ht); string oldActice = string.Empty; if (active == "0") { oldActice = "1"; } else if (active == "1") { oldActice = "0"; } //添加基础资料修改日志 string[] arr = ids.Split(new char[] { ',' }); foreach (string id in arr) { Dictcustomer dictCustomerNew = GetDictCustomerById(Convert.ToDouble(id)); Dictcustomer dictCustomer = GetDictCustomerById(Convert.ToDouble(id)); dictCustomer.Active = oldActice; List <LogInfo> logLst = getLogInfo <Dictcustomer>(dictCustomer, dictCustomerNew); AddMaintenanceLog("Dictcustomer", int.Parse(id), logLst, "审核", dictCustomer.Customername, dictCustomer.Customercode, modulename); } } catch (Exception ex) { throw new Exception(ex.Message); } CacheHelper.RemoveAllCache("Dict.SelectDictcustomer"); return(nflag); }
///<summary> ///新增编辑后保存 ///</summary> ///<param name="library"></param> /// <returns></returns> public bool SaveDictcustomer(Dictcustomer dictCustomer) { int nflag = 0; //新增 if (dictCustomer.Dictcustomerid == 0 || dictCustomer.Dictcustomerid == null) { try { dictCustomer.Dictcustomerid = getSeqID("SEQ_DICTCUSTOMER"); insert("Dict.InsertDictcustomer", dictCustomer); nflag = 1; List <LogInfo> logLst = getLogInfo <Dictcustomer>(new Dictcustomer(), dictCustomer); AddMaintenanceLog("Dictcustomer", int.Parse(dictCustomer.Dictcustomerid.ToString()), logLst, "新增", dictCustomer.Customername.ToString(), dictCustomer.Customercode.ToString(), modulename); } catch (Exception ex) { nflag = 0; throw new Exception(ex.Message); } } else//保存 { try { Dictcustomer dictCustomerOld = GetDictCustomerById(dictCustomer.Dictcustomerid); nflag = update("Dict.UpdateDictcustomer", dictCustomer); List <LogInfo> logLst = getLogInfo <Dictcustomer>(dictCustomerOld, dictCustomer); AddMaintenanceLog("Dictcustomer", int.Parse(dictCustomer.Dictcustomerid.ToString()), logLst, "修改", dictCustomer.Customername.ToString(), dictCustomer.Customercode.ToString(), modulename); } catch (Exception ex) { throw new Exception(ex.Message); } } CacheHelper.RemoveAllCache("Dict.SelectDictcustomer"); return(nflag > 0); }
/// <summary>清空 /// /// </summary> protected void EditClear() { Form1.Title = "当前状态-新增"; gvList.SelectedRowIndexArray = new int[] { }; dictCustomer = new Dictcustomer(); this.radlActive.SelectedValue = "0"; // dictCustomer.Active; this.radlCustomerType.SelectedValue = "0"; // dictCustomer.Customertype; this.tbxAddress.Text = dictCustomer.Address; this.tbxContactman.Text = dictCustomer.Contactman; this.tbxContactPhone.Text = dictCustomer.Contactphone; this.tbxCoustomerCode.Text = dictCustomer.Customercode; this.tbxCoustomerName.Text = dictCustomer.Customername; this.tbxDisplayOrder.Text = dictCustomer.Displayorder.ToString(); this.tbxDocumentCode.Text = dictCustomer.Documentcode; this.tbxDocumentType.Text = dictCustomer.Documenttype; this.tbxEmail.Text = dictCustomer.Email; this.tbxEnAddress.Text = dictCustomer.Engaddress; this.tbxEnErpCode.Text = dictCustomer.Erpcode; this.tbxEnName.Text = dictCustomer.Customerengname; this.tbxErpName.Text = dictCustomer.Erpname; this.tbxFastCode.Text = dictCustomer.Fastcode; this.tbxFax.Text = dictCustomer.Fax; this.tbxPostCode.Text = dictCustomer.Postcode; this.tbxReporTitle.Text = dictCustomer.Reporttitle; this.tbxTelePhone.Text = dictCustomer.Telephone; this.tbxCoustomerName2.Text = dictCustomer.Customername2; this.TxaRemark.Text = dictCustomer.Remark; this.dropDictcheckBillId.SelectedIndex = 0; this.dropDictLab.SelectedIndex = 0; this.dropDictsalemanId.SelectedIndex = 0; this.dropStatus.SelectedIndex = 0; this.chkIssms.Checked = true; this.radIsPub.SelectedValue = "0"; }