private void btnLogin_Click(object sender, EventArgs e) { try { Usr usr = new Usr(); usr.UId__PK = txtLogId.Text; usr.Pwd = txtPwd.Text; if (StringUtil.isEmpty(usr.UId__PK) || StringUtil.isEmpty(usr.Pwd)) { MessageBox.Show("请输入登录名 / 密码", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } manager = InterfaceProxyGenerator.CreateInterfaceProxy <IUsrManager>(null); string respTxt = string.Empty; loginUsr = manager.Login(usr); if (null != loginUsr) { this.DialogResult = DialogResult.OK; } } catch (Exception e1) { string msg = e1.Message; MessageBox.Show(msg, "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btnAdd2List_Click(object sender, EventArgs e) { Goods goods = autxtNSupplyGoods.SelectedObj as Goods; if (null == goods) { if (!StringUtil.isEmpty(autxtNSupplyGoods.Term)) { DialogResult rslt = MessageBox.Show("无此商品!是否新增?", "操作结果", MessageBoxButtons.OKCancel, MessageBoxIcon.Question); if (rslt == DialogResult.OK) { Usr usr = MainForm.usr; GoodsForm gForm = new GoodsForm(null, goodsManager, InterfaceProxyGenerator.CreateInterfaceProxy <ISubCatgManager>(usr)); gForm.ShowDialog(); } } return; } foreach (DataGridViewRow row in dtgvStockin.Rows) { long gId = StringUtil.Obj2Long(row.Cells[colGID.Name].Value); if (gId == goods.GID__PK) { MainForm.Warn("此商品已添加,请重新选择!"); autxtNSupplyGoods.clear(); return; } } int index = dtgvStockin.Rows.Add(); InitRow(index, goods); autxtNSupplyGoods.clear(); }
public object RecreateInterfaceProxy(SerializationInfo info, StreamingContext context) { object proxy = null; GeneratorContext genContext = new GeneratorContext(); foreach (object mixin in _mixins) { genContext.AddMixinInstance(mixin); } InterfaceProxyGenerator gen = new InterfaceProxyGenerator(_scope, genContext); object target = info.GetValue("__target", typeof(object)); if (_mixins.Length == 0) { Type proxy_type = gen.GenerateCode(_interfaces, target.GetType()); proxy = Activator.CreateInstance(proxy_type, new object[] { _interceptor, target }); } else { Type proxy_type = gen.GenerateCode(_interfaces, target.GetType()); proxy = Activator.CreateInstance(proxy_type, new object[] { _interceptor, target, genContext.MixinsAsArray() }); } return(proxy); }
public ProfitAnlsForm() { InitializeComponent(); numudYear.Maximum = DateTime.Now.Year; numudYear.Value = DateTime.Now.Year; if (null == goodsManager) { goodsManager = InterfaceProxyGenerator.CreateInterfaceProxy <IGoodsManager>(MainForm.usr); } if (null == anlsManager) { anlsManager = InterfaceProxyGenerator.CreateInterfaceProxy <IDataAnlsManager>(MainForm.usr); } if (null == subCatgManager) { subCatgManager = InterfaceProxyGenerator.CreateInterfaceProxy <ISubCatgManager>(MainForm.usr); } List <SubCatgVO> subCatgs = subCatgManager.LoadData(false, null); List <SubCatgVO> list = new List <SubCatgVO>(); SubCatgVO subCatg = new SubCatgVO(); subCatg.CName = "全部"; subCatg.CId__PK = 0; list.Add(subCatg); list.AddRange(subCatgs); cboxCatg.DisplayMember = "CName"; cboxCatg.ValueMember = "CID__PK"; cboxCatg.DataSource = list; }
public MCustomersForm(string gradeEnum) { InitializeComponent(); dtgvCustomers.AutoGenerateColumns = false; Usr usr = MainForm.usr; grade = gradeEnum; page = new PageVO(); page.PageNo = 1; if (null == manager) { manager = InterfaceProxyGenerator.CreateInterfaceProxy <ICustomerManager>(usr); } BindingSource stBs = new BindingSource(); Dictionary <string, string> custMap = new Dictionary <string, string>(); custMap.Add("", "全部"); custMap.Add(ST.VALID, ST.CUST_MAP[ST.VALID]); custMap.Add(ST.INVALID, ST.CUST_MAP[ST.INVALID]); stBs.DataSource = custMap; cboxSt.DisplayMember = "Value"; cboxSt.ValueMember = "Key"; cboxSt.DataSource = stBs; if (GRADE.SUPPLIER == grade) { this.lblCName.Text = "供应商名称:"; } else if (GRADE.RESELLER == grade) { this.lblCName.Text = "分销商名称:"; } }
public MainForm() { InitializeComponent(); if (null == authManager) { authManager = InterfaceProxyGenerator.CreateInterfaceProxy <IUsrAuthManager>(null); } }
public SalesmanProfitAnlsForm() { InitializeComponent(); if (null == anlsManager) { anlsManager = InterfaceProxyGenerator.CreateInterfaceProxy <IDataAnlsManager>(MainForm.usr); } DateTime beginDt = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1); dtpBeginDt.Value = beginDt; }
public OrderPrinterForm(string orderNo) { InitializeComponent(); Usr usr = MainForm.usr; this.orderNo = orderNo; if (null == manager) { manager = InterfaceProxyGenerator.CreateInterfaceProxy <IStockOutManager>(usr); } }
public CatgForm() { InitializeComponent(); dtgvCatg.AutoGenerateColumns = false; Usr usr = MainForm.usr; if (null == manager) { manager = InterfaceProxyGenerator.CreateInterfaceProxy <ICatgManager>(usr); } }
string Render(InterfaceType interfaceType, string package = "myPackage", string @namespace = "MyNamespace", string typeName = "MyInterface") { Symbols.MapTypeToPackage(interfaceType.FullyQualifiedName, package); Symbols.MapNamespace(interfaceType.Namespace, @namespace); Symbols.MapTypeName(interfaceType.FullyQualifiedName, typeName, JsonModel.Spec.TypeKind.Interface); var generator = new InterfaceProxyGenerator(package, interfaceType, Symbols, Namespaces); SyntaxTree syntaxTree = generator.CreateSyntaxTree(); return(syntaxTree.ToString()); }
public MStocktakingForm() { InitializeComponent(); dtgvGoods.AutoGenerateColumns = false; Usr usr = MainForm.usr; page = new PageVO(); page.PageNo = 1; if (null == custManager) { custManager = InterfaceProxyGenerator.CreateInterfaceProxy <ICustomerManager>(usr); } if (null == subCatgManager) { subCatgManager = InterfaceProxyGenerator.CreateInterfaceProxy <ISubCatgManager>(usr); } if (null == manager) { manager = InterfaceProxyGenerator.CreateInterfaceProxy <IInventoryManager>(usr); } Customer cust = new Customer(); cust.Grade = GRADE.SUPPLIER; cust.St = ST.VALID; List <Customer> custs = custManager.LoadData(cust, null); List <Customer> custList = new List <Customer>(); Customer tmpCust = new Customer(); tmpCust.CID__PK = 0; tmpCust.CName = "---选择---"; custList.Add(tmpCust); custList.AddRange(custs); cboxSuppliers.DisplayMember = "CName"; cboxSuppliers.ValueMember = "CID__PK"; cboxSuppliers.DataSource = custList; List <SubCatgVO> scatgs = subCatgManager.LoadData(false, null); List <SubCatgVO> catgList = new List <SubCatgVO>(); SubCatgVO catgVO = new SubCatgVO(); catgVO.CName = "全部"; catgVO.CId__PK = 0; catgList.Add(catgVO); catgList.AddRange(scatgs); cboxCatgs.DisplayMember = "CName"; cboxCatgs.ValueMember = "CId__PK"; cboxCatgs.DataSource = catgList; }
public InvOprtChldDialog(long invId, string supplier, Goods goods) { InitializeComponent(); dtgvChld.AutoGenerateColumns = false; if (null == manager) { manager = InterfaceProxyGenerator.CreateInterfaceProxy <IInventoryManager>(MainForm.usr); } Text = "库存变更流水【" + goods.GName + " " + goods.Specs + " @" + supplier + "】"; List <InvOprtChldVO> list = manager.LoadOprtChld(invId); dtgvChld.DataSource = list; }
string Render(InterfaceType interfaceType, string package = "myPackage", string @namespace = "MyNamespace", string typeName = "MyInterface") { Symbols.MapTypeToPackage(interfaceType.FullyQualifiedName, package); string suffix = interfaceType.Namespace != null ? "." + interfaceType.Namespace : ""; Symbols.MapNamespace(interfaceType.Assembly + suffix, @namespace); Symbols.MapTypeName(interfaceType.FullyQualifiedName, typeName, TypeKind.Interface); var generator = new InterfaceProxyGenerator(package, interfaceType, Symbols, Namespaces); SyntaxTree syntaxTree = generator.CreateSyntaxTree(); return(syntaxTree.ToString()); }
public MRefund2SupplierForm() { InitializeComponent(); dtgvRfGoods.AutoGenerateColumns = false; dtgvRfOrders.AutoGenerateColumns = false; Usr usr = MainForm.usr; page = new PageVO(); page.PageNo = 1; if (null == custManager) { custManager = InterfaceProxyGenerator.CreateInterfaceProxy <ICustomerManager>(usr); } if (null == subCatgManager) { subCatgManager = InterfaceProxyGenerator.CreateInterfaceProxy <ISubCatgManager>(usr); } if (null == refundManager) { refundManager = InterfaceProxyGenerator.CreateInterfaceProxy <IRefund2SupplierManager>(usr); } if (null == goodsManager) { goodsManager = InterfaceProxyGenerator.CreateInterfaceProxy <IGoodsManager>(usr); } Customer cust = new Customer(); cust.Grade = GRADE.SUPPLIER; cust.St = ST.VALID; List <Customer> custs = custManager.LoadData(cust, null); cboxNSupplier.DisplayMember = "CName"; cboxNSupplier.ValueMember = "CID__PK"; cboxNSupplier.DataSource = custs; List <Customer> custList = new List <Customer>(); Customer tmpCust = new Customer(); tmpCust.CID__PK = 0; tmpCust.CName = "--全部--"; custList.Add(tmpCust); custList.AddRange(custs); cboxQySupplier.DisplayMember = "CName"; cboxQySupplier.ValueMember = "CID__PK"; cboxQySupplier.DataSource = custList; }
public object RecreateInterfaceProxy(SerializationInfo info, StreamingContext context) { GeneratorContext context2 = new GeneratorContext(); foreach (object obj3 in this._mixins) { context2.AddMixinInstance(obj3); } InterfaceProxyGenerator generator = new InterfaceProxyGenerator(_scope, context2); object obj4 = info.GetValue("__target", typeof(object)); if (this._mixins.Length == 0) { return(Activator.CreateInstance(generator.GenerateCode(this._interfaces, obj4.GetType()), new object[] { this._interceptor, obj4 })); } return(Activator.CreateInstance(generator.GenerateCode(this._interfaces, obj4.GetType()), new object[] { this._interceptor, obj4, context2.MixinsAsArray() })); }
public MStockOutForm() { InitializeComponent(); dtgvSOutGoods.AutoGenerateColumns = false; dtgvMOutOrders.AutoGenerateColumns = false; Usr usr = MainForm.usr; page = new PageVO(); page.PageNo = 1; if (null == custManager) { custManager = InterfaceProxyGenerator.CreateInterfaceProxy <ICustomerManager>(usr); } if (null == goodsManager) { goodsManager = InterfaceProxyGenerator.CreateInterfaceProxy <IGoodsManager>(usr); } if (null == stockOutManager) { stockOutManager = InterfaceProxyGenerator.CreateInterfaceProxy <IStockOutManager>(usr); } Customer cust = new Customer(); cust.Grade = GRADE.RESELLER; cust.St = ST.VALID; List <Customer> resellers = custManager.LoadData(cust, null); cboxNResellers.DisplayMember = "CName"; cboxNResellers.ValueMember = "CID__PK"; cboxNResellers.DataSource = resellers; List <Customer> qyResellers = new List <Customer>(); Customer reseller = new Customer(); reseller.CID__PK = 0; reseller.CName = "--全部--"; qyResellers.Add(reseller); qyResellers.AddRange(resellers); cboxQyReseller.DisplayMember = "CName"; cboxQyReseller.ValueMember = "CID__PK"; cboxQyReseller.DataSource = qyResellers; }
public SupplyGoodsForm(Customer supplier) { InitializeComponent(); Usr usr = MainForm.usr; page = new PageVO(); page.PageNo = 1; page.PageSize = 100; goodsMap = new Dictionary <int, Goods>(); if (null == goodsManager) { goodsManager = InterfaceProxyGenerator.CreateInterfaceProxy <IGoodsManager>(usr); } if (null == custManager) { custManager = InterfaceProxyGenerator.CreateInterfaceProxy <ICustomerManager>(usr); } if (null == catgManager) { catgManager = InterfaceProxyGenerator.CreateInterfaceProxy <ISubCatgManager>(usr); } List <SubCatgVO> subCatgs = catgManager.LoadData(false, null); List <SubCatgVO> list = new List <SubCatgVO>(); SubCatgVO subCatg = new SubCatgVO(); subCatg.CName = "全部"; subCatg.CId__PK = 0; list.Add(subCatg); list.AddRange(subCatgs); cboxCatg.DisplayMember = "CName"; cboxCatg.ValueMember = "CID__PK"; cboxCatg.DataSource = list; List <Customer> custs = new List <Customer>(); custs.Add(supplier); cboxSupplier.DisplayMember = "CName"; cboxSupplier.ValueMember = "CID__PK"; cboxSupplier.DataSource = custs; }
public SoldGoodsForm(Customer customer) { InitializeComponent(); dtgvSoldGoods.AutoGenerateColumns = false; Usr usr = MainForm.usr; goodsMap = new Dictionary <long, StockGoodsVO>(); page = new PageVO(); page.PageSize = 100; page.PageNo = 1; if (null == subCatgManager) { subCatgManager = InterfaceProxyGenerator.CreateInterfaceProxy <ISubCatgManager>(usr); } if (null == manager) { manager = InterfaceProxyGenerator.CreateInterfaceProxy <IInventoryManager>(usr); } this.customer = customer; this.Text = "【回收单】 " + customer.CName; List <SubCatgVO> scatgs = subCatgManager.LoadData(false, null); List <SubCatgVO> catgList = new List <SubCatgVO>(); SubCatgVO catgVO = new SubCatgVO(); catgVO.CName = "全部"; catgVO.CId__PK = 0; catgList.Add(catgVO); catgList.AddRange(scatgs); cboxCatgs.DisplayMember = "CName"; cboxCatgs.ValueMember = "CId__PK"; cboxCatgs.DataSource = catgList; List <Customer> custs = new List <Customer>(); custs.Add(customer); cboxResellers.DataSource = custs; cboxResellers.DisplayMember = "CName"; cboxResellers.ValueMember = "CID__PK"; }
public UsrAuthForm() { InitializeComponent(); dtgvAuth.AutoGenerateColumns = false; if (null == manager) { manager = InterfaceProxyGenerator.CreateInterfaceProxy <IUsrAuthManager>(MainForm.usr); } if (null == usrManager) { usrManager = InterfaceProxyGenerator.CreateInterfaceProxy <IUsrManager>(MainForm.usr); } section = (NameValueCollection)ConfigurationManager.GetSection("FunctionGroup/Func"); List <Usr> usrs = usrManager.LoadUsrs(); cboxUsr.DataSource = usrs; cboxUsr.DisplayMember = "UId__PK"; cboxUsr.ValueMember = "UId__PK"; BindData(); }
public MGoodsForm() { InitializeComponent(); page = new PageVO(); page.PageNo = 1; dtgvMGoods.AutoGenerateColumns = false; Usr usr = MainForm.usr; if (null == manager) { manager = InterfaceProxyGenerator.CreateInterfaceProxy <IGoodsManager>(usr); } if (null == subCatgManager) { subCatgManager = InterfaceProxyGenerator.CreateInterfaceProxy <ISubCatgManager>(usr); } BindingSource stBs = new BindingSource(); Dictionary <string, string> goodsMap = new Dictionary <string, string>(); goodsMap.Add("", "全部"); goodsMap.Add(ST.VALID, ST.GOODS_MAP[ST.VALID]); goodsMap.Add(ST.INVALID, ST.GOODS_MAP[ST.INVALID]); stBs.DataSource = goodsMap; cboxSt.DisplayMember = "Value"; cboxSt.ValueMember = "Key"; cboxSt.DataSource = stBs; List <SubCatgVO> subCatgs = subCatgManager.LoadData(false, null); List <SubCatgVO> list = new List <SubCatgVO>(); SubCatgVO subCatg = new SubCatgVO(); subCatg.CName = "全部"; subCatg.CId__PK = 0; list.Add(subCatg); list.AddRange(subCatgs); cboxCatg.DisplayMember = "CName"; cboxCatg.ValueMember = "CID__PK"; cboxCatg.DataSource = list; }
private void dtgvOrders_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (null == dtgvOrders.CurrentRow) { return; } if (cboxBillSuppliers.SelectedIndex == -1) { return; } Customer supplier = cboxBillSuppliers.SelectedItem as Customer; Order order = new Order(); order.CustName = supplier.CName; order.CustID = supplier.CID__PK; order.OrderNO__PK = StringUtil.Obj2Str(dtgvOrders.CurrentRow.Cells["colOrderNO"].Value); order.Amount = StringUtil.Obj2Decimal(dtgvOrders.CurrentRow.Cells["colAmount"].Value); order.Direct = StringUtil.Obj2Str(dtgvOrders.CurrentRow.Cells["colDirect"].Value); if (DIRECT.STOCK_IN == order.Direct) { if (null == stockinManager) { stockinManager = InterfaceProxyGenerator.CreateInterfaceProxy <IStockInManager>(MainForm.usr); } StockInOrderDetailForm detailForm = new StockInOrderDetailForm(order, stockinManager); detailForm.ShowDialog(); } else if (DIRECT.REFUND2SUPPLIER == order.Direct) { if (null == refundManager) { refundManager = InterfaceProxyGenerator.CreateInterfaceProxy <IRefund2SupplierManager>(MainForm.usr); } RefundOrderDetailForm detailForm = new RefundOrderDetailForm(order, refundManager); detailForm.ShowDialog(); } }
public AddGoods2CustForm(int custId, string custName) { InitializeComponent(); dtgvGoods.AutoGenerateColumns = false; Usr usr = MainForm.usr; supplyGoods = new Dictionary <int, SupplyInfo>(); page = new PageVO(); page.PageSize = 100; page.PageNo = 1; if (null == goodsManager) { goodsManager = InterfaceProxyGenerator.CreateInterfaceProxy <IGoodsManager>(usr); } if (null == subCatgManager) { subCatgManager = InterfaceProxyGenerator.CreateInterfaceProxy <ISubCatgManager>(usr); } if (null == custManager) { custManager = InterfaceProxyGenerator.CreateInterfaceProxy <ICustomerManager>(usr); } this.custId = custId; List <SubCatgVO> subCatgs = subCatgManager.LoadData(false, null); List <SubCatgVO> list = new List <SubCatgVO>(); SubCatgVO subCatg = new SubCatgVO(); subCatg.CName = "全部"; subCatg.CId__PK = 0; list.Add(subCatg); list.AddRange(subCatgs); cboxCatg.DisplayMember = "CName"; cboxCatg.ValueMember = "CID__PK"; cboxCatg.DataSource = list; this.Text = custName; }
public MSupplyInfoForm() { InitializeComponent(); Usr usr = MainForm.usr; page = new PageVO(); page.PageNo = 1; if (null == custManager) { custManager = InterfaceProxyGenerator.CreateInterfaceProxy <ICustomerManager>(usr); } dtgvSpGoods.AutoGenerateColumns = false; Customer cust = new Customer(); cust.St = ST.VALID; cust.Grade = GRADE.SUPPLIER; List <Customer> list = custManager.LoadData(cust, null); cboxSupplier.DataSource = list; cboxSupplier.DisplayMember = "CName"; cboxSupplier.ValueMember = "CID__PK"; }
public MUsrsForm() { InitializeComponent(); dtgvUsrs.AutoGenerateColumns = false; if (null == manager) { manager = InterfaceProxyGenerator.CreateInterfaceProxy <IUsrManager>(MainForm.usr); } Dictionary <string, string> stMap = new Dictionary <string, string>(); stMap.Add("", "--不限--"); foreach (string key in ST.USR_MAP.Keys) { stMap.Add(key, ST.USR_MAP[key]); } BindingSource stBs = new BindingSource(); stBs.DataSource = stMap; cboxSt.DisplayMember = "Value"; cboxSt.ValueMember = "Key"; cboxSt.DataSource = stBs; }
public MCustAcntForm() { InitializeComponent(); dtgvAcnt.AutoGenerateColumns = false; Usr usr = MainForm.usr; if (null == manager) { manager = InterfaceProxyGenerator.CreateInterfaceProxy <ICustomerManager>(usr); } BindingSource bs = new BindingSource(); bs.DataSource = GRADE.GRADE_MAP; cboxGrade.DataSource = bs; cboxGrade.DisplayMember = "Value"; cboxGrade.ValueMember = "Key"; cboxCust.DisplayMember = "CName"; cboxCust.ValueMember = "CID__PK"; string grade = StringUtil.Obj2Str(cboxGrade.SelectedValue); Customer cust = new Customer(); cust.Grade = grade; if (grade == GRADE.SUPPLIER) { suppliers = manager.LoadData(cust, null); cboxCust.DataSource = suppliers; } else if (grade == GRADE.RESELLER) { resellers = manager.LoadData(cust, null); cboxCust.DataSource = resellers; } }
public virtual Type CreateCustomInterfaceProxy(Type[] interfaces, Type type, GeneratorContext context) { InterfaceProxyGenerator generator = new InterfaceProxyGenerator(_scope, context); return(generator.GenerateCode(interfaces, type)); }
public virtual Type CreateInterfaceProxy(Type[] interfaces, Type type) { InterfaceProxyGenerator generator = new InterfaceProxyGenerator(_scope); return(generator.GenerateCode(interfaces, type)); }
public GoodsInStockForm(Customer customer, string direct) { InitializeComponent(); dtgvGoodsInStock.AutoGenerateColumns = false; Usr usr = MainForm.usr; goodsMap = new Dictionary <long, StockGoodsVO>(); page = new PageVO(); page.PageSize = 100; page.PageNo = 1; if (null == custManager) { custManager = InterfaceProxyGenerator.CreateInterfaceProxy <ICustomerManager>(usr); } if (null == subCatgManager) { subCatgManager = InterfaceProxyGenerator.CreateInterfaceProxy <ISubCatgManager>(usr); } if (null == manager) { manager = InterfaceProxyGenerator.CreateInterfaceProxy <IInventoryManager>(usr); } this.customer = customer; string title = string.Empty; if (DIRECT.REFUND2SUPPLIER == direct) { title = "退货单"; } else if (DIRECT.STOCK_OUT == direct) { title = "出货单"; } else { return; } this.Text = "【" + title + "】" + " " + customer.CName; List <Customer> custList = new List <Customer>(); if (DIRECT.REFUND2SUPPLIER == direct) { custList.Add(customer); } else if (DIRECT.STOCK_OUT == direct) { Customer cust = new Customer(); cust.Grade = GRADE.SUPPLIER; cust.St = ST.VALID; List <Customer> custs = custManager.LoadData(cust, null); Customer tmpCust = new Customer(); tmpCust.CID__PK = 0; tmpCust.CName = "---选择---"; custList.Add(tmpCust); custList.AddRange(custs); } cboxSuppliers.DisplayMember = "CName"; cboxSuppliers.ValueMember = "CID__PK"; cboxSuppliers.DataSource = custList; List <SubCatgVO> scatgs = subCatgManager.LoadData(false, null); List <SubCatgVO> catgList = new List <SubCatgVO>(); SubCatgVO catgVO = new SubCatgVO(); catgVO.CName = "全部"; catgVO.CId__PK = 0; catgList.Add(catgVO); catgList.AddRange(scatgs); cboxCatgs.DisplayMember = "CName"; cboxCatgs.ValueMember = "CId__PK"; cboxCatgs.DataSource = catgList; }
public GoodsForm(Goods mGoods, IGoodsManager goodsManager, ISubCatgManager subCatgManager) { InitializeComponent(); this.manager = goodsManager; this.subCatgManager = subCatgManager; if (null == custManager) { custManager = InterfaceProxyGenerator.CreateInterfaceProxy <ICustomerManager>(MainForm.usr); } BindingSource bs = new BindingSource(); bs.DataSource = TERM.TERM_MAP; cboxShelfLife.DataSource = bs; cboxShelfLife.DisplayMember = "Value"; cboxShelfLife.ValueMember = "Key"; if (null == mGoods) { this.Text = "添加商品"; rbtnInvalid.Enabled = false; rbtnValid.Enabled = false; rbtnValid.Checked = true; List <SubCatgVO> list = this.subCatgManager.LoadData(false, null); cboxCatg.DataSource = list; cboxCatg.DisplayMember = "CName"; cboxCatg.ValueMember = "CId__PK"; Customer cust = new Customer(); cust.Grade = GRADE.SUPPLIER; cust.St = ST.VALID; List <Customer> custs = custManager.LoadData(cust, null); List <Customer> ds = new List <Customer>(); cust.CID__PK = 0; cust.CName = "--选择--"; ds.Add(cust); ds.AddRange(custs); cboxSupplier.DisplayMember = "CName"; cboxSupplier.ValueMember = "CID__PK"; cboxSupplier.DataSource = ds; cboxSupplier.Enabled = true; } else { this.Text = "修改商品"; List <SubCatgVO> list = this.subCatgManager.LoadData(true, null); cboxCatg.DataSource = list; cboxCatg.DisplayMember = "CName"; cboxCatg.ValueMember = "CId__PK"; string shelfLifeStr = mGoods.ShelfLife; string num = shelfLifeStr.Substring(0, shelfLifeStr.Length - 1); string term = shelfLifeStr.Substring(shelfLifeStr.Length - 1); txtGId.Text = mGoods.GID__PK.ToString(); txtGName.Text = mGoods.GName; txtAbbr.Text = mGoods.Abbr; txtRemark.Text = mGoods.Remark; txtShelfLife.Text = num; cboxShelfLife.SelectedValue = term; txtSpecs.Text = mGoods.Specs; cboxCatg.SelectedValue = mGoods.SubCatgID; cboxSupplier.Enabled = false; } }
public MSupplierBillingForm() { InitializeComponent(); dtgvOrders.AutoGenerateColumns = false; dtgvBilling.AutoGenerateColumns = false; Usr usr = MainForm.usr; selectedOrdrMap = new Dictionary <string, decimal>(); orderPage = new PageVO(); billPage = new PageVO(); orderPage.PageNo = 1; billPage.PageNo = 1; if (null == billingManager) { billingManager = InterfaceProxyGenerator.CreateInterfaceProxy <ISupplierBillingManager>(usr); } if (null == custManager) { custManager = InterfaceProxyGenerator.CreateInterfaceProxy <ICustomerManager>(usr); } Customer cust = new Customer(); cust.Grade = GRADE.SUPPLIER; cust.St = ST.VALID; List <Customer> custs = custManager.LoadData(cust, null); cboxQrdSupplier.DisplayMember = "CName"; cboxQrdSupplier.ValueMember = "CID__PK"; cboxQrdSupplier.DataSource = custs; cboxBillSuppliers.DisplayMember = "CName"; cboxBillSuppliers.ValueMember = "CID__PK"; cboxBillSuppliers.DataSource = custs; BindingSource directBs = new BindingSource(); directBs.DataSource = new Dictionary <string, string> { { string.Empty, "全部" }, { DIRECT.STOCK_IN, "进货单" }, { DIRECT.REFUND2SUPPLIER, "退货单" } }; cboxDirect.DataSource = directBs; cboxDirect.DisplayMember = "Value"; cboxDirect.ValueMember = "Key"; BindingSource stBs = new BindingSource(); Dictionary <string, string> stDict = new Dictionary <string, string> { { string.Empty, "全部" } }; foreach (string key in HANDLE_FLAG.HANDLE_MAP.Keys) { stDict.Add(key, HANDLE_FLAG.HANDLE_MAP[key]); } stBs.DataSource = stDict; cboxEntry.DataSource = stBs; cboxEntry.DisplayMember = "Value"; cboxEntry.ValueMember = "Key"; BindingSource settleBs = new BindingSource(); settleBs.DataSource = new Dictionary <string, string> { { string.Empty, "全部" }, { "false", "未结清" }, { "true", "已结清" } }; cboxBillSt.DataSource = settleBs; cboxBillSt.DisplayMember = "Value"; cboxBillSt.ValueMember = "Key"; }