コード例 #1
0
        private void frmStockInit_Load(object sender, EventArgs e)
        {
            try
            {
                System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor;
                //

                IBLL.ICommonBLL bll2 = new BLL.CommonBLL();
                this.txtBranch.Bind(bll2.GetBranchList(), 300, 200, "branch_no", "branch_no:编号:80,branch_name:名称:140", "branch_no/branch_name->Text");
                IBLL.IItemCls clsbll = new BLL.ItemClsBLL();
                this.txtItemCls.Bind(clsbll.GetDataTable(), 250, 200, "item_clsno", "item_clsno:分类编号:80,item_clsname:商品分类:170", "item_clsno/item_clsname->Text");
            }
            catch (Exception ex)
            {
                MsgForm.ShowFrom(ex);
                Helper.LogHelper.writeLog("frmCGInSheet()", ex.ToString());
            }
            finally
            {
                System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default;
            }
        }
コード例 #2
0
        private void LoadCb()
        {
            Thread th = new Thread(() =>
            {
                Helper.GlobalData.windows.ShowLoad(this);
                Cursor.Current = Cursors.WaitCursor;
                try
                {
                    //商品分类
                    IBLL.IItemCls bll = new BLL.ItemClsBLL();
                    tb_item_cls       = bll.GetDataTable();

                    this.txtItemCls.Invoke((MethodInvoker) delegate
                    {
                        this.txtItemCls.Bind(tb_item_cls, 300, 200, "item_clsno", "item_clsno:编号:100,item_clsname:分类:150", "item_clsno/item_clsname->Text");
                    });


                    //单位
                    List <string> unit_lis = new List <string>()
                    {
                        "kg",
                        "g",
                        "包",
                        "箱",
                    };
                    this.cbUnitNo.Invoke((MethodInvoker) delegate
                    {
                        foreach (var key in unit_lis)
                        {
                            this.cbUnitNo.Items.Add(key);
                            this.cbCGUnitNo.Items.Add(key);
                        }
                        this.cbUnitNo.SelectedIndex   = 0;
                        this.cbCGUnitNo.SelectedIndex = 0;
                    });


                    //商品性质0:普通商品 1:称重商品 2:条码秤商品
                    Dictionary <string, string> dic2 = new Dictionary <string, string>()
                    {
                        { "0", "普通商品" },
                        { "1", "称重商品" },
                        { "2", "条码秤商品" },
                    };

                    this.cbitem_flag.Invoke((MethodInvoker) delegate
                    {
                        this.cbitem_flag.DisplayMember = "Value";
                        this.cbitem_flag.ValueMember   = "Key";
                        this.cbitem_flag.DataSource    = new BindingSource(dic2, null);
                    });

                    //供应商
                    IBLL.ISup supbll = new BLL.SupBLL();
                    int num;
                    tb_sup = supbll.GetDataTable("", "", 1, 1, 99999, out num);


                    this.txtSup.Invoke((MethodInvoker) delegate
                    {
                        this.txtSup.Bind(tb_sup, 300, 200, "supcust_no", "supcust_no:编号:100,sup_name:供应商:150", "supcust_no/sup_name->Text");
                    });

                    LoadItem();
                }
                catch (Exception ex)
                {
                    LogHelper.writeLog("SysSetting_Load", ex.ToString());
                    MsgForm.ShowFrom(ex);
                }
                Cursor.Current = Cursors.Default;
                Helper.GlobalData.windows.CloseLoad(this);
            });

            th.Start();
        }