using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Collections; using System.Windows.Forms; using CoreFS.CA06; using Infragistics.Win.UltraWinGrid; using Infragistics.Win; namespace Core.StlMes.Client.Sale.SaleFundMgt.FundUI.UIDlgBox { public partial class DlgCustChoose : UIFrm.FrmFundBase { private string saleOrg = ""; private string custUser = ""; private CoreFS.CA06.OpeBase _ob = null; private FundBLL.InterfaceMgt.SlmBaseCustomer slmBaseCustomer = null; public string SaleOrg { get { return this.saleOrg; } set { this.saleOrg = value; } } public string CustUse { get { return this.custUser; } set { this.custUser = value; } } private string GetCustomerNoSql() { return ""; } DataSet dsMain = new DataSet(); public string customerNo = ""; public string customerName = ""; public Infragistics.Win.UltraWinGrid.UltraGridRow ugrReturn = null; public DlgCustChoose(CoreFS.CA06.OpeBase ob) { this._ob = ob; InitializeComponent(); } private void DlgCustChoose_Load(object sender, EventArgs e) { slmBaseCustomer = new Core.StlMes.Client.Sale.SaleFundMgt.FundBLL.InterfaceMgt.SlmBaseCustomer(_ob); dsMain = base.GetDataSetByColumnName(GetGridDataStruct(), null, GetColumnCaption()); this.ultraGrid1.DataSource = dsMain; base.SetGridStyle(ref this.ultraGrid1); base.ResetGridFilterStyle(ref this.ultraGrid1); HIddenColumn(); Query(); } private void HIddenColumn() { foreach (string s in ReturnHiddenCol()) { try { this.ultraGrid1.DisplayLayout.Bands[0].Columns[s].Hidden = true; } catch { } } } private string[] ReturnHiddenCol() { return new string[] { "CUSTOMER_NO", "USER_GRP", "ORG", "VALIDFLAG", "CUSTM_USE", "BIGAREA", "BIGAREANAME", "REGION_NO", "REGION_NM", "SALE_ORG", "CUSTM_USE"}; } private void Query() { DataSet ds = null; // slmBaseCustomer.GetBaseCustomberInfoBySaleOrgAndCustUse(this.SaleOrg, this.CustUse); ds = slmBaseCustomer.GetJsBaseCustomberInfo(); if (this.textBox1.Text.Length > 0) { ds = Core.StlMes.Client.Sale.Util.UtilDataSet.GetDataSetWithRowFilterWithApproximateMatch(ds, "CUSTOMER_NM", this.textBox1.Text.Trim()); } Core.StlMes.Client.Sale.Util.UtilDataSet.SetDataSetByMergeSameColumnName(ref this.dsMain, ds); } private void Choose() { Infragistics.Win.UltraWinGrid.UltraGridRow ugr = null; if (this.ultraGrid1.Rows.Count == 0) return; ugr = this.ultraGrid1.ActiveRow; if (ugr == null) { this.DialogResult = DialogResult.Cancel; return; } this.customerNo = ugr.Cells["CUSTOMER_NO"].Value.ToString(); this.customerName = ugr.Cells["CUSTOMER_NM"].Value.ToString(); this.ugrReturn = ugr; this.DialogResult = DialogResult.OK; } private string[] GetGridDataStruct() { return new String[] { "CUSTOMER_NO", "CUSTOMER_NM", "ABRVITION", "BIGAREA", "BIGAREANAME", "REGION_NO", "REGION_NM", "USER_GRP", "ORG", "PY", "VALIDFLAG", "CREATE_TIME", "CREATE_NAME", "SALE_ORG", "CUSTM_USE" }; } protected Hashtable GetGridColumnLength() { Hashtable hs = new Hashtable(); hs.Add("CUSTOMER_NM", 150); hs.Add("ABRVITION", 100); hs.Add("BIGAREA", 100); hs.Add("CREATE_TIME", 100); hs.Add("SALE_ORG", 100); return hs; } private Hashtable GetColumnCaption() { Hashtable hs = new Hashtable(); foreach (string[] s in GetColumnAndCaptionStr()) { try { if (hs.ContainsKey(s[0])) { hs.Remove(s[0]); } hs.Add(s[0], s[1]); } catch { } } return hs; } private List GetColumnAndCaptionStr() { List list = new List(); list.Add(new string[] { "CUSTOMER_NO", "客户编号" }); list.Add(new string[] { "CUSTOMER_NM", "客户名称" }); list.Add(new string[] { "BIGAREA", "行政片区" }); list.Add(new string[] { "BIGAREANAME", "行政片区" }); list.Add(new string[] { "REGION_NO", "省市/区域" }); list.Add(new string[] { "REGION_NM", "省市/区域" }); list.Add(new string[] { "USER_GRP", "用户组" }); list.Add(new string[] { "ORG", "机构代码" }); list.Add(new string[] { "PY", "拼音助记" }); list.Add(new string[] { "CREATE_TIME", "创建时间" }); list.Add(new string[] { "SALE_ORG", "销售组织" }); list.Add(new string[] { "CUSTM_USE", "用途" }); list.Add(new string[] { "ABRVITION", "简称" }); return list; } private void ultraToolbarsManager1_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e) { if (e.Tool.Key == "Query") { this.Query(); } if (e.Tool.Key == "Exit") this.Close(); if (e.Tool.Key == "Choose") this.Choose(); } } }