using Core.Mes.Client.Comm.Server; using Core.Mes.Client.Comm.Tool; using Core.StlMes.Client.Qcm.BLL; using Core.StlMes.Client.Qcm.Control; using Core.StlMes.Client.Qcm.model; using CoreFS.CA06; using Infragistics.Win; using Infragistics.Win.UltraWinEditors; using Infragistics.Win.UltraWinGrid; using System; using System.Collections; using System.Data; using System.Windows.Forms; namespace Core.StlMes.Client.Qcm { public partial class ComBaseSuppFrm : FrmBase { private ComBaseSuppCtrl _suppCtrl; private ComBaseSuppBLL _suppBLL; private ComBaseSuppBankBLL _suppBankBLL; public ComBaseSuppFrm() { InitializeComponent(); } private DataTable regions; private void ComBaseSuppFrm_Load(object sender, EventArgs e) { _suppCtrl = new ComBaseSuppCtrl(panel1, ob); _suppCtrl.UltraGrid1.AfterRowActivate += UltraGrid1_AfterRowActivate; _suppCtrl.UltraGrid2.AfterRowActivate += UltraGrid2_AfterRowActivate; _suppCtrl.UltraGrid3.AfterRowActivate += UltraGrid3_AfterRowActivate; _suppCtrl.PurchaseRangeCtrl.EntityGrid1.AfterRowActivate += PurchaseRangeCtrl_AfterRowActivate; _suppCtrl.PurchaseRangeCtrl.EntityGrid1.Click += EntityGrid1_Click; _suppCtrl.PurchaseRangeCtrl.EntityGrid1.ClickCell += EntityGrid1_ClickCell; _suppCtrl.UltraGrid1.Click += UltraGrid1_Click; _suppCtrl.UltraGrid2.Click += UltraGrid2_Click; _suppCtrl.UltraGrid3.Click += UltraGrid3_Click; _suppCtrl.UltraGrid1.ClickCell += UltraGrid1_ClickCell; _suppCtrl.UltraGrid2.ClickCell += UltraGrid2_ClickCell; _suppCtrl.UltraGrid3.ClickCell += UltraGrid3_ClickCell; _suppBLL = new ComBaseSuppBLL(ob); _suppBankBLL = new ComBaseSuppBankBLL(ob); regions = _suppBLL.QueryRegion(); //加载基础数据 FillComboxItems(txt_island, regions, "region_No", "region_Nm", "region_Type='A'"); FillComboxItems(txt_SUPPNATIONALITY, regions, "region_No", "region_Nm", "region_Type='AC'"); FillComboxItems(txt_SUPPPROVINCE, regions, "region_No", "region_Nm", "region_Type NOT in ('A','AC','/')"); FillComboxItems(txt_SUPPOFFICEPROVINCENATION, regions, "region_No", "region_Nm", "region_Type='AC'"); FillComboxItems(txt_SUPPOFFICEPROVINCE, regions, "region_No", "region_Nm", "region_Type NOT in ('A','AC','/')"); //加载税率下拉框 DataTable dtTaxRate = ClsBaseInfo.GetComBaseInfo("900301", ob); txt_suppTaxRate.DataSource = dtTaxRate; txt_suppTaxRate.DisplayMember = "BASENAME"; txt_suppTaxRate.ValueMember = "BASECODE"; //加载供应商等级下拉框 txt_SUPPPERGRADE.DataSource = ClsBaseInfo.GetComBaseInfo("900302", ob); txt_SUPPPERGRADE.DisplayMember = "BASENAME"; txt_SUPPPERGRADE.ValueMember = "BASECODE"; //供应商货币类型 txt_SUPPREGCAPCURRENCY.DataSource = ClsBaseInfo.GetComBaseInfo("900303", ob); txt_SUPPREGCAPCURRENCY.DisplayMember = "BASENAME"; txt_SUPPREGCAPCURRENCY.ValueMember = "BASECODE"; QcmBaseQuery.NitializeSpec(ultraComboEditor3, "B", false, ob); } void PurchaseRangeCtrl_AfterRowActivate(object sender, EventArgs e) { ComBasePurchaseRangeEntity purchaseRange = EntityHelper.CopyEntity( _suppCtrl.PurchaseRangeCtrl.EntityGrid1.ActiveRow.ListObject); ultraComboEditor3.Value = purchaseRange.SpecCode; ultraNumericEditor1.Value = purchaseRange.LenMax; ultraNumericEditor2.Value = purchaseRange.LenMin; ultraTabControl1.Tabs[3].Selected = true; } public override void ToolBar_Click(object sender, string ToolbarKey) { base.ToolBar_Click(sender, ToolbarKey); switch (ToolbarKey) { case "Query": Query(); break; case "Add": Add(); break; case "Modify": Modify(); break; case "Delete": Delete(); break; case "Resume": Resume(); break; case "Close": this.Close(); break; } } /// /// 初始化Combox数据,加入数据筛选 /// /// ComboBox控件 /// DataTable /// RowFilter条件 public static void FillComboxItems(UltraComboEditor cmbx, DataTable dt, string valueCol, string textCol, string filterCondition) { if (dt != null && dt.Rows.Count > 0) { DataView dvw = dt.DefaultView; dvw.RowFilter = filterCondition; ArrayList aryTmp = new ArrayList(); aryTmp.Add(new ValueListItem(" ", " ")); for (int i = 0; i < dvw.Count; i++) { aryTmp.Add(new ValueListItem(dvw[i][valueCol].ToString(), dvw[i][textCol].ToString())); } cmbx.DataSource = aryTmp; cmbx.DisplayMember = "DisplayText"; cmbx.ValueMember = "DataValue"; } } private void Query() { string suppCode = textBox3.Text.Trim(); string suppName = textBox1.Text.Trim(); string suppLinkMan = textBox2.Text.Trim(); string validflag = labelCheckBox1.Checked ? "0" : "1"; _suppCtrl.PurchaseRangeCtrl.Clear(); _suppCtrl.Query(suppCode, suppName, suppLinkMan, validflag); } private ComBaseSuppEntity CheckSuppData(string action) { ComBaseSuppEntity Supp_Entity = new ComBaseSuppEntity(); Supp_Entity.SuppName = txt_SUPPNAME.Text.Trim(); Supp_Entity.SuppCode = txt_SUPPCODE.Text.ToString().Trim(); Supp_Entity.OrgCode = txt_ORGCODE.Text; Supp_Entity.SuppShortName = txt_SUPPSHORTNAME.Text; Supp_Entity.SuppTaxId = txt_SUPPTAXID.Text; Supp_Entity.SuppCharacter = txt_SUPPCHARACTER.Text; Supp_Entity.SuppRegistrarName = txt_SUPPREGISTRARNAME.Text; //Supp_Entity.SuppNationality = txt_SUPPNATIONALITY.Text; Supp_Entity.SuppNationalityCode = txt_SUPPNATIONALITY.Value.ToString2(); //Supp_Entity.SuppProvince = txt_SUPPPROVINCE.Text; Supp_Entity.SuppProvinceCode = txt_SUPPPROVINCE.Value.ToString2(); Supp_Entity.SuppCity = txt_SUPPCITY.Text; //Supp_Entity.SuppOfficeProvince = txt_SUPPOFFICEPROVINCE.Text; Supp_Entity.SuppOfficeProvinceCode = txt_SUPPOFFICEPROVINCE.Value.ToString2(); Supp_Entity.SuppStartDate = Convert.ToDateTime(this.txt_SUPPSTARTDATE.Value).ToShortDateString(); Supp_Entity.SuppEndDate = Convert.ToDateTime(this.txt_SUPPENDDATE.Value).ToShortDateString(); Supp_Entity.SuppTaxStartDate = Convert.ToDateTime(this.txt_SUPPTAXSTARTDATE.Value).ToShortDateString(); Supp_Entity.SuppTaxEndDate = Convert.ToDateTime(this.txt_SUPPTAXENDDATE.Value).ToShortDateString(); Supp_Entity.SuppLicStartDate = Convert.ToDateTime(this.txt_SUPPLICSTARTDATE.Value).ToShortDateString(); Supp_Entity.SuppLicEndDate = Convert.ToDateTime(this.txt_SUPPLICENDDATE.Value).ToShortDateString(); Supp_Entity.SuppLicNum = this.txt_SUPPLICNUM.Text; Supp_Entity.SuppOperateScope = txt_SUPPOPERATESCOPE.Text; Supp_Entity.SupplierLinkMan = txt_SUPPLIERLINKMAN.Text; Supp_Entity.SuppContactCellPhone = txt_SUPPCONTACTCELLPHONE.Text; Supp_Entity.SuppContactEmail = txt_SUPPCONTACTEMAIL.Text; Supp_Entity.SuppContactFax = txt_SUPPCONTACTFAX.Text; Supp_Entity.SuppContactTel = txt_SUPPCONTACTTEL.Text; Supp_Entity.SuppContactTitle = txt_SUPPCONTACTTITLE.Text; Supp_Entity.SuppIsInternal = txt_SUPPISINTERNAL.Value.ToString2(); Supp_Entity.SuppIsManufacturer = txt_SUPPISMANUFACTURER.Value.ToString2(); Supp_Entity.SuppIsSubCompany = txt_SUPPISSUBCOMPANY.Value.ToString2(); Supp_Entity.SuppIndustryType = txt_SUPPINDUSTRYTYPE.Text; Supp_Entity.SuppRegCapCurrency = txt_SUPPREGCAPCURRENCY.Value.ToString2(); Supp_Entity.SuppRegCapital = txt_SUPPREGCAPITAL.Value == null ? 0 : Convert.ToInt32(txt_SUPPREGCAPITAL.Text); Supp_Entity.SuppRelationGrade = txt_SUPPRELATIONGRADE.Text; Supp_Entity.SuppPerGrade = txt_SUPPPERGRADE.Value.ToString2(); Supp_Entity.SuppAddress = txt_SUPPADDRESS.Text; Supp_Entity.CreateName = CoreFS.SA06.CoreUserInfo.UserInfo.GetUserName(); Supp_Entity.CreateUserid = CoreFS.SA06.CoreUserInfo.UserInfo.GetUserID(); Supp_Entity.Status = "1"; Supp_Entity.SuspendStatus = "0"; Supp_Entity.Validflag = "1"; Supp_Entity.SuppTaxRate = txt_suppTaxRate.Value.ToString2(); Supp_Entity.SuppType = txt_SUPPTYPE.Value.ToString2(); string suppCode = action == "Add" ? "1" : Supp_Entity.SuppCode; if (_suppBLL.IsRepeat(Supp_Entity.SuppName, suppCode)) { MessageUtil.ShowWarning("系统已存在该供应商名称!"); txt_SUPPNAME.Focus(); return null; } if (Supp_Entity.SuppTaxRate == "") { MessageUtil.ShowWarning("请选择税率!"); txt_suppTaxRate.Focus(); return null; } if (Supp_Entity.SuppType == "") { MessageUtil.ShowWarning("请选择供应商类型!"); txt_suppTaxRate.Focus(); return null; } return Supp_Entity; } private ComBaseSuppBankEntity CheckSuppBank(string action) { if (_suppCtrl.UltraGrid1.ActiveRow == null) { MessageUtil.ShowWarning("请先新增供应商!"); return null; } if (action == "Modify") { if (_suppCtrl.UltraGrid2.ActiveRow == null) { MessageUtil.ShowWarning("请先新增银行信息!"); return null; } } ComBaseSuppBankEntity Banks = new ComBaseSuppBankEntity(); Banks.BankAccount = txt_BANKACCOUNT.Text; Banks.BankName = txt_BANKNAME.Text; Banks.SuppCode = _suppCtrl.UltraGrid1.GetActiveRowValue("suppCode"); Banks.SuppName = _suppCtrl.UltraGrid1.GetActiveRowValue("suppName"); Banks.SuppShortName = _suppCtrl.UltraGrid1.GetActiveRowValue("suppShortName"); Banks.SuppCode = _suppCtrl.UltraGrid1.GetActiveRowValue("suppCode"); if (action == "Modify") { Banks.Id = _suppCtrl.UltraGrid2.GetActiveRowValue("id"); } if (Banks.BankAccount == "") { MessageUtil.ShowWarning("银行帐号不能为空!"); txt_BANKACCOUNT.Focus(); return null; } string id = action == "Add" ? "1" : Banks.Id; if (_suppBankBLL.IsRepeat(Banks.BankAccount, id)) { MessageUtil.ShowWarning("系统已存在该银行帐号!"); txt_BANKACCOUNT.Focus(); return null; } return Banks; } private ComBaseSuppAptitudeEntity CheckSuppAptitude(string action) { if (_suppCtrl.UltraGrid1.ActiveRow == null) { MessageUtil.ShowWarning("请先新增供应商!"); return null; } if (action == "Modify") { if (_suppCtrl.UltraGrid3.ActiveRow == null) { MessageUtil.ShowWarning("请先新资质行信息!"); return null; } } ComBaseSuppAptitudeEntity Aptis = new ComBaseSuppAptitudeEntity(); Aptis.CertDesc = txt_CERTDESC.Text; Aptis.CertiConstraint = ultraComboEditor1.Text; Aptis.CertiOfficer = txt_CERTIOFFICER.Text; Aptis.CertNo = txt_CERTNO.Text; Aptis.CertType = ultraComboEditor2.Text; Aptis.CertValidStart = Convert.ToDateTime(txt_CERTVALID_start.Value).ToString("yyyy-MM-DD"); Aptis.CertValidEnd = Convert.ToDateTime(txt_CERTVALID_end.Value).ToString("yyyy-MM-DD"); Aptis.SuppCode = _suppCtrl.UltraGrid1.GetActiveRowValue("suppCode"); Aptis.SuppName = _suppCtrl.UltraGrid1.GetActiveRowValue("suppName"); Aptis.SuppShortName = _suppCtrl.UltraGrid1.GetActiveRowValue("suppShortName"); //txt_certNo_v.Text = uge.Cells["CERTNOV"].Value.ToString(); //txt_certpath_old.Text = uge.Cells["CERTPATHOLD"].Value.ToString(); //craftImg.Text = uge.Cells["CERTPATH"].Value.ToString(); Aptis.CertNoV = txt_certNo_v.Text.ToString().Trim(); Aptis.CertPath = txt_certPath.Text.ToString().Trim(); Aptis.CertPathOld = txt_certpath_old.Text.ToString().Trim(); Aptis.SuppCode = _suppCtrl.UltraGrid1.GetActiveRowValue("suppCode"); if (action == "Modify") { Aptis.Id = _suppCtrl.UltraGrid3.GetActiveRowValue("id"); } if (Aptis.CertNo == "") { MessageUtil.ShowWarning("请输入证书名称!"); txt_CERTNO.Focus(); return null; } //string id = action == "Add" ? "1" : Aptis.Id; //if (_suppBankBLL.IsRepeat(Aptis.CertNo, id)) //{ // MessageUtil.ShowWarning("系统已存在该证书名称!"); // txt_BANKACCOUNT.Focus(); // return null; //} if (Aptis.CertiConstraint == "") { MessageUtil.ShowWarning("请选择证书强制类型!"); ultraComboEditor1.Focus(); return null; } if (Aptis.CertType == "") { MessageUtil.ShowWarning("请选择证书类型!"); ultraComboEditor2.Focus(); return null; } return Aptis; } private ComBasePurchaseRangeEntity CheckPurchaseRange(string action) { if (_suppCtrl.UltraGrid1.ActiveRow == null) { MessageUtil.ShowWarning("请先新增供应商!"); return null; } if (action == "Modify") { if (_suppCtrl.PurchaseRangeCtrl.EntityGrid1.ActiveRow == null) { MessageUtil.ShowWarning("请先供应能力范围!"); return null; } } if (ultraComboEditor3.Value == null) { MessageUtil.ShowWarning("请选择管坯规格!"); ultraComboEditor3.Focus(); return null; } if (ultraNumericEditor1.Value == null) { MessageUtil.ShowWarning("请选输入长度最长mm!"); ultraNumericEditor1.Focus(); return null; } if (ultraNumericEditor2.Value == null) { MessageUtil.ShowWarning("请选输入长度最短mm!"); ultraNumericEditor2.Focus(); return null; } ComBasePurchaseRangeEntity parm = new ComBasePurchaseRangeEntity(); parm.SpecCode = ultraComboEditor3.Value.ToString2(); parm.SpecName = ultraComboEditor3.Text; parm.LenMax = decimal.Parse(ultraNumericEditor1.Value.ToString2()); parm.LenMin = decimal.Parse(ultraNumericEditor2.Value.ToString2()); return parm; } public void Add() { if (ultraTabControl1.ActiveTab.Index == 0) { ComBaseSuppEntity Supp_Entity = CheckSuppData("Add"); if (Supp_Entity == null) return; _suppCtrl.AddSupp(Supp_Entity); } else if (ultraTabControl1.ActiveTab.Index == 1) { ComBaseSuppBankEntity Banks = CheckSuppBank("Add"); if (Banks == null) return; _suppCtrl.AddSuppBank(Banks); } else if (ultraTabControl1.ActiveTab.Index == 2) { ComBaseSuppAptitudeEntity Aptis = CheckSuppAptitude("Add"); if (Aptis == null) return; _suppCtrl.AddSuppAptitude(Aptis); } else if (ultraTabControl1.ActiveTab.Index == 3) { ComBasePurchaseRangeEntity purchaseRange = CheckPurchaseRange("Add"); if (purchaseRange == null) return; purchaseRange.CreateName = this.UserInfo.GetUserName(); _suppCtrl.PurchaseRangeCtrl.Add(purchaseRange); string suppCode = _suppCtrl.UltraGrid1.GetActiveRowValue("suppCode"); _suppCtrl.RelocateSupp(suppCode); } } public void Modify() { if (ultraTabControl1.ActiveTab.Index == 0) { ComBaseSuppEntity Supp_Entity = CheckSuppData("Modify"); if (Supp_Entity == null) return; _suppCtrl.ModifySupp(Supp_Entity); } else if (ultraTabControl1.ActiveTab.Index == 1) { ComBaseSuppBankEntity Banks = CheckSuppBank("Modify"); if (Banks == null) return; _suppCtrl.ModifySuppBank(Banks); } else if (ultraTabControl1.ActiveTab.Index == 2) { ComBaseSuppAptitudeEntity Aptis = CheckSuppAptitude("Modify"); if (Aptis == null) return; _suppCtrl.ModifySuppAptitude(Aptis); } else if (ultraTabControl1.ActiveTab.Index == 3) { ComBasePurchaseRangeEntity purchaseRange = CheckPurchaseRange("Modify"); if (purchaseRange == null) return; purchaseRange.UpdateName = this.UserInfo.GetUserName(); _suppCtrl.PurchaseRangeCtrl.Update(purchaseRange); string suppCode = _suppCtrl.UltraGrid1.GetActiveRowValue("suppCode"); _suppCtrl.RelocateSupp(suppCode); } } public void Delete() { if (clickGrid == "grid1") { _suppCtrl.UpdateSuppValidflag(new ComBaseSuppEntity() { SuppCode = _suppCtrl.UltraGrid1.GetActiveRowValue("suppCode"), DeleteName = UserInfo.GetUserName(), DeleteUserid = UserInfo.GetUserID() }, "0"); } else if (clickGrid == "grid2") { _suppCtrl.DeleteSuppBank(new ComBaseSuppBankEntity() { Id = _suppCtrl.UltraGrid2.GetActiveRowValue("id") }); } else if (clickGrid == "grid3") { _suppCtrl.DeleteSuppAptitude(new ComBaseSuppAptitudeEntity() { Id = _suppCtrl.UltraGrid3.GetActiveRowValue("id") }); } else { _suppCtrl.PurchaseRangeCtrl.Delete(new ComBasePurchaseRangeEntity() { RangeId = _suppCtrl.PurchaseRangeCtrl.EntityGrid1.GetActiveRowValue("rangeId"), DeleteName = this.UserInfo.GetUserName() }); string suppCode = _suppCtrl.UltraGrid1.GetActiveRowValue("suppCode"); _suppCtrl.RelocateSupp(suppCode); } } public void Resume() { _suppCtrl.UpdateSuppValidflag(new ComBaseSuppEntity() { SuppCode = _suppCtrl.UltraGrid1.GetActiveRowValue("suppCode"), DeleteName = UserInfo.GetUserName(), DeleteUserid = UserInfo.GetUserID() }, "1"); } void UltraGrid1_AfterRowActivate(object sender, EventArgs e) { try { this.Cursor = Cursors.WaitCursor; ClearTab(); string suppCode = _suppCtrl.UltraGrid1.GetActiveRowValue("suppCode"); ComBaseSuppEntity suppone_entity = _suppBLL.QueryByPk(suppCode); txt_SUPPISSUBCOMPANY.Value = suppone_entity.SuppIsSubCompany;//创建时间 txt_SUPPISMANUFACTURER.Value = suppone_entity.SuppIsManufacturer;//创建人 txt_SUPPISINTERNAL.Value = suppone_entity.SuppIsInternal;//采购管理科室描叙 txt_SUPPADDRESS.Text = suppone_entity.SuppAddress;//供应商名称 txt_SUPPRELATIONGRADE.Value = suppone_entity.SuppRelationGrade;//供应商代码 txt_SUPPPERGRADE.Value = suppone_entity.SuppPerGrade;//是否暂挂1:暂挂 0:正常 txt_SUPPREGCAPCURRENCY.Value = suppone_entity.SuppRegCapCurrency;//废除时间 txt_SUPPREGCAPITAL.Value = suppone_entity.SuppRegCapital;//废除人 txt_SUPPLICENDDATE.Value = Convert.ToDateTime(suppone_entity.SuppLicEndDate);//采购管理部门描叙 txt_SUPPTAXENDDATE.Value = Convert.ToDateTime(suppone_entity.SuppTaxEndDate);//管理科室代码 txt_SUPPLICSTARTDATE.Value = Convert.ToDateTime(suppone_entity.SuppLicStartDate);//采购管理部门代码 txt_SUPPENDDATE.Value = Convert.ToDateTime(suppone_entity.SuppEndDate);//管理部门代码 txt_SUPPSTARTDATE.Value = Convert.ToDateTime(suppone_entity.SuppStartDate);//供应商信用等级 txt_SUPPTAXSTARTDATE.Value = Convert.ToDateTime(suppone_entity.SuppTaxStartDate);//管理部门描叙 txt_SUPPOPERATESCOPE.Text = suppone_entity.SuppOperateScope;//采购管理科室代码 txt_SUPPLICNUM.Text = suppone_entity.SuppLicNum;//管理科室描叙 txt_SUPPCITY.Text = suppone_entity.SuppCity;//供应商联系人职务 txt_SUPPREGISTRARNAME.Text = suppone_entity.SuppRegistrarName;//供应商联系人电话 txt_SUPPSHORTNAME.Text = suppone_entity.SuppShortName;//供应商地址邮编 txt_ORGCODE.Text = suppone_entity.OrgCode;//供应商地址 txt_SUPPPROVINCE.Value = suppone_entity.SuppProvinceCode;//供应商省份 txt_SUPPCHARACTER.Text = suppone_entity.SuppCharacter;//供应商联系人传真 txt_SUPPNAME.Text = suppone_entity.SuppName;//供应商合作关系等级 txt_SUPPINDUSTRYTYPE.Text = suppone_entity.SuppIndustryType;//修改人 txt_SUPPOFFICEPROVINCE.Value = suppone_entity.SuppOfficeProvinceCode;//供应商办公省份 txt_SUPPNATIONALITY.Value = suppone_entity.SuppNationalityCode;//供应商国家 txt_SUPPTAXID.Text = suppone_entity.SuppTaxId;//供应商联系人名称 txt_SUPPCODE.Text = suppone_entity.SuppCode;//供应商评定等级 txt_SUPPCONTACTTITLE.Text = suppone_entity.SuppContactTitle;//供应商联系人职务 txt_SUPPCONTACTTEL.Text = suppone_entity.SuppContactTel;//供应商联系人电话 txt_SUPPCONTACTFAX.Text = suppone_entity.SuppContactFax;//供应商联系人传真 txt_SUPPCONTACTCELLPHONE.Text = suppone_entity.SuppContactCellPhone;//供应商联系人手机 txt_SUPPCONTACTEMAIL.Text = suppone_entity.SuppContactEmail;//供应商联系人EMAIL txt_SUPPLIERLINKMAN.Text = suppone_entity.SupplierLinkMan;//供应商联系人名称 txt_suppTaxRate.Value = suppone_entity.SuppTaxRate.ToString().Trim();//税率 txt_SUPPTYPE.Value = suppone_entity.SuppType; _suppCtrl.QuerySuppAptitude(); _suppCtrl.QuerySuppBank(); _suppCtrl.PurchaseRangeCtrl.Query(suppCode); } finally { this.Cursor = Cursors.Default; } } void UltraGrid2_AfterRowActivate(object sender, EventArgs e) { try { this.Cursor = Cursors.WaitCursor; txt_BANKACCOUNT.Text = _suppCtrl.UltraGrid2.GetActiveRowValue("BANKACCOUNT"); txt_BANKNAME.Text = _suppCtrl.UltraGrid2.GetActiveRowValue("BANKNAME"); } finally { this.Cursor = Cursors.Default; } } void UltraGrid3_AfterRowActivate(object sender, EventArgs e) { try { this.Cursor = Cursors.WaitCursor; txt_CERTNO.Text = _suppCtrl.UltraGrid3.GetActiveRowValue("CERTNO"); txt_CERTDESC.Text = _suppCtrl.UltraGrid3.GetActiveRowValue("CERTDESC"); txt_CERTIOFFICER.Text = _suppCtrl.UltraGrid3.GetActiveRowValue("CERTIOFFICER"); ultraComboEditor1.Text = _suppCtrl.UltraGrid3.GetActiveRowValue("CERTICONSTRAINT"); ultraComboEditor2.Text = _suppCtrl.UltraGrid3.GetActiveRowValue("CERTTYPE"); txt_CERTVALID_start.Value = _suppCtrl.UltraGrid3.GetActiveRowValue("CERTVALIDSTART"); txt_CERTVALID_end.Value = _suppCtrl.UltraGrid3.GetActiveRowValue("CERTVALIDEND"); txt_certNo_v.Text = _suppCtrl.UltraGrid3.GetActiveRowValue("CERTNOV"); txt_certpath_old.Text = _suppCtrl.UltraGrid3.GetActiveRowValue("CERTPATHOLD"); txt_certPath.Text = _suppCtrl.UltraGrid3.GetActiveRowValue("CERTPATH"); } finally { this.Cursor = Cursors.Default; } } private string clickGrid = "grid1"; void UltraGrid1_Click(object sender, EventArgs e) { this.toolMenu.Toolbars[0].Tools["Delete"].SharedProps.Caption = "作废"; this.toolMenu.Toolbars[0].Tools["Resume"].SharedProps.Visible = true; clickGrid = "grid1"; ultraTabControl1.Tabs[0].Selected = true; } void UltraGrid2_Click(object sender, EventArgs e) { this.toolMenu.Toolbars[0].Tools["Delete"].SharedProps.Caption = "删除"; this.toolMenu.Toolbars[0].Tools["Resume"].SharedProps.Visible = false; clickGrid = "grid2"; ultraTabControl1.Tabs[1].Selected = true; } void UltraGrid3_Click(object sender, EventArgs e) { this.toolMenu.Toolbars[0].Tools["Delete"].SharedProps.Caption = "删除"; this.toolMenu.Toolbars[0].Tools["Resume"].SharedProps.Visible = false; clickGrid = "grid3"; ultraTabControl1.Tabs[2].Selected = true; } void UltraGrid3_ClickCell(object sender, ClickCellEventArgs e) { UltraGrid3_Click(null, null); } void UltraGrid2_ClickCell(object sender, ClickCellEventArgs e) { UltraGrid2_Click(null, null); } void UltraGrid1_ClickCell(object sender, ClickCellEventArgs e) { UltraGrid1_Click(null, null); } void EntityGrid1_ClickCell(object sender, ClickCellEventArgs e) { EntityGrid1_Click(null, null); } void EntityGrid1_Click(object sender, EventArgs e) { this.toolMenu.Toolbars[0].Tools["Delete"].SharedProps.Caption = "删除"; this.toolMenu.Toolbars[0].Tools["Resume"].SharedProps.Visible = false; clickGrid = "grid4"; ultraTabControl1.Tabs[3].Selected = true; } private void txt_island_SelectionChanged(object sender, EventArgs e) { try { String strisland = txt_island.Value.ToString().Trim(); txt_SUPPNATIONALITY.SelectedIndex = -1; txt_SUPPPROVINCE.SelectedIndex = -1; FillComboxItems(txt_SUPPNATIONALITY, regions, "region_No", "region_Nm", "region_Type='AC' AND p_Region_No like '" + strisland + "%'"); FillComboxItems(txt_SUPPPROVINCE, regions, "region_No", "region_Nm", "region_Type NOT in ('A','AC','/') AND p_Region_No like '" + strisland + "%'"); } catch (Exception ex) { //MessageUtil.ShowTips("地点数据加载失败"); } } private void txt_SUPPNATIONALITY_SelectionChanged(object sender, EventArgs e) { try { String strsuppNationCode = txt_SUPPNATIONALITY.Value.ToString().Trim(); txt_SUPPPROVINCE.SelectedIndex = -1; //FillComboxItems(txt_island, regions, "regionNo", "regionNm", "regionType = 'A' AND regionNo like '" + strsuppNationCode.Substring(0,1) + "%'"); FillComboxItems(txt_SUPPPROVINCE, regions, "region_No", "region_Nm", "region_Type NOT in ('A','AC','/') AND p_Region_No like '%" + strsuppNationCode + "%'"); } catch (Exception ex) { } } private void txt_SUPPOFFICEPROVINCENATION_SelectionChanged(object sender, EventArgs e) { try { String strsuppNationCode = txt_SUPPOFFICEPROVINCENATION.Value.ToString().Trim(); txt_SUPPOFFICEPROVINCE.SelectedIndex = -1; FillComboxItems(txt_SUPPOFFICEPROVINCE, regions, "region_No", "region_Nm", "region_Type NOT in ('A','AC','/') AND p_Region_No like '%" + strsuppNationCode + "%'"); } catch (Exception ex) { } } /// /// 清空tab页控件值 /// private void ClearTab() { txt_BANKACCOUNT.Text = ""; txt_BANKNAME.Text = ""; txt_CERTNO.Text = ""; txt_CERTDESC.Text = ""; txt_CERTIOFFICER.Text = ""; ultraComboEditor1.Text = ""; ultraComboEditor2.Text = ""; txt_CERTVALID_start.Text = ""; txt_certPath.Text = ""; txt_certpath_old.Text = ""; txt_certNo_v.Text = ""; txt_CERTVALID_start.Value = DateTime.Now.AddDays(1).ToString(); txt_CERTVALID_end.Value = DateTime.Now.AddYears(1).ToString(); ultraComboEditor3.Value = null; ultraNumericEditor1.Value = null; ultraNumericEditor2.Value = null; } } }