Example #1
0
        public frmCGOrder()
        {
            InitializeComponent();
            //
            Helper.GlobalData.InitForm(this);
            //
            var tb = new DataTable();

            tb.Columns.Add("item_no");
            tb.Columns.Add("item_subno");
            tb.Columns.Add("barcode");
            tb.Columns.Add("item_name");
            tb.Columns.Add("unit_no");
            tb.Columns.Add("item_size");
            tb.Columns.Add("order_qnty", typeof(decimal));
            tb.Columns.Add("in_price", typeof(decimal));
            tb.Columns.Add("discount", typeof(decimal));
            tb.Columns.Add("sub_amount", typeof(decimal));
            tb.Columns.Add("other1");

            editGrid1.AddColumn("item_subno", "货号", "", 120, 1, "", true);
            editGrid1.AddColumn("item_name", "商品名称", "", 150, 1, "", false);
            editGrid1.AddColumn("unit_no", "单位", "", 60, 2, "", false);
            editGrid1.AddColumn("item_size", "规格", "", 60, 2, "", false);
            editGrid1.AddColumn("order_qnty", "总数量", "", 100, 3, "0.00", true);
            editGrid1.AddColumn("in_price", "单价", "", 100, 3, "0.00", true);
            editGrid1.AddColumn("discount", "折扣", "", 100, 3, "0.00", false);
            editGrid1.AddColumn("sub_amount", "金额", "", 100, 3, "0.00", true);
            editGrid1.AddColumn("other1", "备注", "", 150, 1, "", true);
            editGrid1.SetTotalColumn("order_qnty,sub_amount");//合计项
            editGrid1.DataSource = tb;
            editGrid1.IsShowIco  = true;

            //
            try
            {
                System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor;
                //

                Thread th = new Thread(() =>
                {
                    Helper.GlobalData.windows.ShowLoad(this);
                    try
                    {
                        IBLL.ICommonBLL bll2 = new BLL.CommonBLL();
                        var branch_tb        = bll2.GetBranchList();
                        this.txtbranch.Invoke((MethodInvoker) delegate
                        {
                            txtbranch.Bind(branch_tb, 300, 200, "branch_no", "branch_no:编号:80,branch_name:名称:140", "branch_no/branch_name->Text");
                        });
                        var sup_tb = bll2.GetAllSupList();
                        this.txt_sup.Invoke((MethodInvoker) delegate
                        {
                            txt_sup.Bind(sup_tb, 350, 200, "supcust_no", "supcust_no:编号:80,sup_name:名称:200", "supcust_no/sup_name->Text");
                        });
                        var deal_tb = bll2.GetPeopleList();
                        this.txt_order_man.Invoke((MethodInvoker) delegate
                        {
                            txt_order_man.Bind(deal_tb, 250, 200, "oper_id", "oper_id:编号:80,oper_name:姓名:100", "oper_id/oper_name->Text");
                        });

                        this.Invoke((MethodInvoker) delegate
                        {
                            IOrder ins = this;
                            ins.Add();
                        });
                    }
                    catch (Exception ex)
                    {
                        LogHelper.writeLog("frmCGOrder", ex.ToString());
                        MsgForm.ShowFrom(ex);
                    }
                    Helper.GlobalData.windows.CloseLoad(this);
                });
                th.Start();
            }
            catch (Exception ex)
            {
                MsgForm.ShowFrom(ex);
                Helper.LogHelper.writeLog("frmCGOrder()", ex.ToString());
            }
            finally
            {
                System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default;
            }
        }
Example #2
0
        public frmOtherInOutSheet()
        {
            InitializeComponent();
            //
            Helper.GlobalData.InitForm(this);
            //
            var tb = new DataTable();

            tb.Columns.Add("item_no");
            tb.Columns.Add("item_subno");
            tb.Columns.Add("barcode");
            tb.Columns.Add("item_name");
            tb.Columns.Add("unit_no");
            tb.Columns.Add("item_size");
            tb.Columns.Add("other3");
            tb.Columns.Add("stock_qty", typeof(decimal));
            tb.Columns.Add("in_qty", typeof(decimal));
            tb.Columns.Add("valid_price", typeof(decimal));
            tb.Columns.Add("discount", typeof(decimal));
            tb.Columns.Add("sub_amount", typeof(decimal));
            tb.Columns.Add("other1");
            tb.Columns.Add("valid_date", typeof(DateTime));
            tb.Columns.Add("price", typeof(decimal));//参考进价

            editGrid1.AddColumn("item_subno", "货号", "", 100, 1, "", true);
            editGrid1.AddColumn("item_name", "商品名称", "", 150, 1, "", false);
            editGrid1.AddColumn("unit_no", "单位", "", 60, 2, "", false);
            editGrid1.AddColumn("item_size", "规格", "", 80, 1, "", false);
            editGrid1.AddColumn("stock_qty", "库存", "", 80, 3, "0.00", false);
            editGrid1.AddColumn("in_qty", "数量", "", 80, 3, "0.00", true);
            editGrid1.AddColumn("valid_price", "单价", "", 100, 3, "0.00", true);
            editGrid1.AddColumn("sub_amount", "金额", "", 100, 3, "0.00", false);
            //editGrid1.AddColumn("", "特价", "", 100, 3, "0.00", true);
            editGrid1.AddColumn("other1", "备注", "", 150, 1, "", true);
            //editGrid1.AddColumn("", "生产批号", "", 120, 3, "0.00", true);
            //editGrid1.AddColumn("", "库位", "", 120, 3, "0.00", true);
            editGrid1.AddColumn("price", "参考进价", "", 100, 3, "0.00", false);
            editGrid1.SetTotalColumn("in_qty,sub_amount");//合计项
            editGrid1.DataSource = tb;

            //
            try
            {
                System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor;
                //

                System.Threading.Thread th = new System.Threading.Thread(() =>
                {
                    Cursor.Current = Cursors.WaitCursor;
                    Helper.GlobalData.windows.ShowLoad(this);
                    try
                    {
                        IBLL.ICommonBLL bll2 = new BLL.CommonBLL();
                        //
                        var branch = bll2.GetBranchList();

                        this.txtbranch.Invoke((MethodInvoker) delegate
                        {
                            txtbranch.Bind(branch, 300, 200, "branch_no", "branch_no:编号:80,branch_name:名称:140", "branch_no/branch_name->Text");
                        });
                        DataTable dt2 = new DataTable();
                        dt2.Columns.Add("trans_no");
                        dt2.Columns.Add("trans_name");
                        dt2.Rows.Add("01", "其它入库");
                        dt2.Rows.Add("02", "归还");
                        dt2.Rows.Add("03", "其它出库");
                        dt2.Rows.Add("04", "领用出库");
                        dt2.Rows.Add("05", "报损出库");
                        dt2.Rows.Add("06", "借出");
                        dt2.Rows.Add("07", "报溢入库");
                        dt2.Rows.Add("09", "库存调整");

                        this.txt_trans_no.Invoke((MethodInvoker) delegate
                        {
                            txt_trans_no.Bind(dt2, 250, 200, "trans_no", "trans_no:编码:80,trans_name:业务类型:100", "trans_no/trans_name->Text");
                        });

                        var deal = bll2.GetPeopleList();
                        this.txt_deal_man.Invoke((MethodInvoker) delegate
                        {
                            txt_deal_man.Bind(deal, 250, 200, "oper_id", "oper_id:编号:80,oper_name:姓名:100", "oper_id/oper_name->Text");
                        });

                        this.Invoke((MethodInvoker) delegate
                        {
                            IOrder ins = this;
                            ins.Add();
                        });
                    }
                    catch (Exception ex)
                    {
                        IvyBack.Helper.LogHelper.writeLog("frmOtherInOutSheet", ex.ToString());
                        MsgForm.ShowFrom(ex);
                    }
                    Cursor.Current = Cursors.Default;
                    Helper.GlobalData.windows.CloseLoad(this);
                });
                th.Start();
            }
            catch (Exception ex)
            {
                MsgForm.ShowFrom(ex);
                Helper.LogHelper.writeLog("frmOtherInOutSheet()", ex.ToString());
            }
            finally
            {
                System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default;
            }
        }
        public frmSaleSheet()
        {
            InitializeComponent();
            //
            Helper.GlobalData.InitForm(this);
            //
            var tb = new DataTable();

            tb.Columns.Add("item_no");
            tb.Columns.Add("item_subno");
            tb.Columns.Add("barcode");
            tb.Columns.Add("item_name");
            tb.Columns.Add("unit_no");
            tb.Columns.Add("other3");
            tb.Columns.Add("sale_qnty", typeof(decimal));
            tb.Columns.Add("real_price", typeof(decimal));
            tb.Columns.Add("sale_money", typeof(decimal));
            tb.Columns.Add("other5");

            editGrid1.AddColumn("item_subno", "货号", "", 120, 1, "", true);
            editGrid1.AddColumn("item_name", "商品名称", "", 150, 1, "", false);
            editGrid1.AddColumn("other3", "赠送", "", 60, 2, "", false);
            editGrid1.AddColumn("unit_no", "单位", "", 60, 2, "", false);
            editGrid1.AddColumn("sale_qnty", "数量", "", 100, 3, "0.00", true);
            editGrid1.AddColumn("real_price", "实际价", "", 100, 3, "0.00", true);
            editGrid1.AddColumn("sale_money", "实际金额", "", 100, 3, "0.00", false);
            editGrid1.AddColumn("other5", "备注明细", "", 150, 1, "", true);

            editGrid1.SetTotalColumn("sale_qnty,sale_money");//合计项
            editGrid1.DataSource = tb;
            editGrid1.BindCheck("other3");
            //
            try
            {
                System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor;
                //

                System.Threading.Thread th = new System.Threading.Thread(() =>
                {
                    Cursor.Current = Cursors.WaitCursor;
                    Helper.GlobalData.windows.ShowLoad(this);
                    try
                    {
                        IBLL.ICommonBLL bll2 = new BLL.CommonBLL();

                        var branch = bll2.GetBranchList();
                        this.txtbranch.Invoke((MethodInvoker) delegate
                        {
                            txtbranch.Bind(branch, 300, 200, "branch_no", "branch_no:机构号:80,branch_name:机构名:140", "branch_no/branch_name->Text");
                        });

                        var sale = bll2.GetPeopleList();
                        this.txt_sale_man.Invoke((MethodInvoker) delegate
                        {
                            txt_sale_man.Bind(sale, 250, 200, "oper_id", "oper_id:职员编号:80,oper_name:姓名:80", "oper_id/oper_name->Text");
                        });

                        var cust = bll2.GetAllCustList();
                        this.txt_cust.Invoke((MethodInvoker) delegate
                        {
                            txt_cust.Bind(cust, 350, 200, "supcust_no", "supcust_no:编号:80,sup_name:名称:200", "supcust_no/sup_name->Text");
                        });

                        IBLL.IInOutBLL bll3 = new BLL.InOutBLL();
                        var order           = bll3.GetImportSSSheet();
                        this.txt_voucher_no.Invoke((MethodInvoker) delegate
                        {
                            this.txt_voucher_no.Bind(order, 350, 200, "sheet_no", "sheet_no:单据号:110,supcust:客户:100,branch:仓库:100,oper_date:日期:150", "sheet_no->Text");
                        });

                        this.Invoke((MethodInvoker) delegate
                        {
                            IOrder ins = this;
                            ins.Add();
                        });
                    }
                    catch (Exception ex)
                    {
                        IvyBack.Helper.LogHelper.writeLog("frmSaleSheet", ex.ToString());
                        MsgForm.ShowFrom(ex);
                    }
                    Cursor.Current = Cursors.Default;
                    Helper.GlobalData.windows.CloseLoad(this);
                });
                th.Start();
            }
            catch (Exception ex)
            {
                MsgForm.ShowFrom(ex);
                Helper.LogHelper.writeLog("frmSaleSheet()", ex.ToString());
            }
            finally
            {
                System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default;
            }
        }
        public frmCheckSheet()
        {
            InitializeComponent();
            //
            Helper.GlobalData.InitForm(this);
            //
            var tb = new DataTable();

            tb.Columns.Add("item_no");
            tb.Columns.Add("item_subno");
            tb.Columns.Add("barcode");
            tb.Columns.Add("item_name");
            tb.Columns.Add("unit_no");
            tb.Columns.Add("item_size");
            tb.Columns.Add("item_pack");
            tb.Columns.Add("stock_qty", typeof(decimal));
            tb.Columns.Add("real_qty", typeof(decimal));
            tb.Columns.Add("packqty", typeof(decimal));
            tb.Columns.Add("sgqty", typeof(decimal));
            tb.Columns.Add("balance_qty", typeof(decimal));
            tb.Columns.Add("in_price", typeof(decimal));
            tb.Columns.Add("real_amount", typeof(decimal));
            tb.Columns.Add("sale_price", typeof(decimal));

            editGrid1.AddColumn("item_subno", "货号", "", 100, 1, "", true);
            editGrid1.AddColumn("barcode", "条码", "", 120, 1, "", true);
            editGrid1.AddColumn("item_name", "商品名称", "", 150, 1, "", false);
            editGrid1.AddColumn("unit_no", "单位", "", 60, 2, "", false);
            editGrid1.AddColumn("item_size", "规格", "", 80, 1, "", false);
            editGrid1.AddColumn("stock_qty", "系统库存", "", 100, 3, "0.00", false);
            editGrid1.AddColumn("real_qty", "实际盘点数量", "", 100, 3, "0.00", true);
            editGrid1.AddColumn("item_pack", "包装数量", "", 100, 3, "0.00", false);
            editGrid1.AddColumn("packqty", "箱数", "", 100, 3, "0.00", true);
            editGrid1.AddColumn("sgqty", "零数", "", 100, 3, "0.00", true);
            editGrid1.AddColumn("balance_qty", "盈亏数量", "", 100, 3, "0.00", false);
            editGrid1.AddColumn("in_price", "成本价", "", 100, 3, "0.00", false);
            editGrid1.AddColumn("real_amount", "盈亏金额", "", 100, 3, "0.00", false);

            editGrid1.SetTotalColumn("balance_qty,real_amount");//合计项
            editGrid1.DataSource = tb;

            //
            try
            {
                System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor;
                //

                Thread th = new Thread(() =>
                {
                    Helper.GlobalData.windows.ShowLoad(this);
                    try
                    {
                        IBLL.ICommonBLL bll2 = new BLL.CommonBLL();
                        var branch_tb        = bll2.GetBranchList();
                        this.txtbranch.Invoke((MethodInvoker) delegate
                        {
                            txtbranch.Bind(branch_tb, 300, 200, "branch_no", "branch_no:编号:80,branch_name:名称:140", "branch_no/branch_name->Text");
                        });

                        var deal_tb = bll2.GetPeopleList();
                        this.txt_deal_man.Invoke((MethodInvoker) delegate
                        {
                            txt_deal_man.Bind(deal_tb, 250, 200, "oper_id", "oper_id:编号:80,oper_name:姓名:100", "oper_id/oper_name->Text");
                        });

                        IBLL.ICheckBLL bll = new BLL.CheckBLL();
                        var check_tb       = bll.GetCheckInitList();
                        this.txt_check_no.Invoke((MethodInvoker) delegate
                        {
                            txt_check_no.Bind(check_tb, 250, 200, "sheet_no", "sheet_no:单据号:120,branch_name:机构:120,oper_name:操作员:120,begin_date:起始日期:120", "sheet_no->Text");
                        });

                        this.Invoke((MethodInvoker) delegate
                        {
                            IOrder ins = this;
                            ins.Add();
                        });
                    }
                    catch (Exception ex)
                    {
                        LogHelper.writeLog("frmCheckSheet", ex.ToString());
                        MsgForm.ShowFrom(ex);
                    }
                    Helper.GlobalData.windows.CloseLoad(this);
                });
                th.Start();
            }
            catch (Exception ex)
            {
                MsgForm.ShowFrom(ex);
                Helper.LogHelper.writeLog("frmCheckSheet()", ex.ToString());
            }
            finally
            {
                System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default;
            }
        }
        public frmCusPriceOrder()
        {
            InitializeComponent();
            //
            Helper.GlobalData.InitForm(this);
            //
            var tb = new DataTable();

            tb.Columns.Add("item_no");
            tb.Columns.Add("item_subno");
            tb.Columns.Add("barcode");
            tb.Columns.Add("item_name");
            tb.Columns.Add("unit_no");
            tb.Columns.Add("item_size");
            tb.Columns.Add("price", typeof(decimal));
            tb.Columns.Add("old_price", typeof(decimal));
            tb.Columns.Add("old_price2", typeof(decimal));
            tb.Columns.Add("old_price3", typeof(decimal));
            tb.Columns.Add("new_price", typeof(decimal));
            tb.Columns.Add("new_price2", typeof(decimal));
            tb.Columns.Add("new_price3", typeof(decimal));

            editGrid1.AddColumn("item_subno", "货号", "", 90, 1, "", true);
            editGrid1.AddColumn("item_name", "商品名称", "", 150, 1, "", false);
            editGrid1.AddColumn("unit_no", "单位", "", 60, 2, "", false);
            editGrid1.AddColumn("item_size", "规格", "", 110, 1, "", false);
            editGrid1.AddColumn("price", "参考成本", "", 110, 3, "0.00", false);
            editGrid1.AddColumn("old_price", "原价", "一级批发价", 90, 3, "0.00", false);
            editGrid1.AddColumn("new_price", "新价", "一级批发价", 90, 3, "0.00", true);
            editGrid1.AddColumn("old_price2", "原价", "二级批发价", 90, 3, "0.00", false);
            editGrid1.AddColumn("new_price2", "新价", "二级批发价", 90, 3, "0.00", true);
            editGrid1.AddColumn("old_price3", "原价", "三级批发价", 90, 3, "0.00", false);


            editGrid1.AddColumn("new_price3", "新价", "三级批发价", 100, 3, "0.00", true);
            editGrid1.DataSource = tb;
            //
            try
            {
                System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor;
                //
                System.Threading.Thread th = new System.Threading.Thread(() =>
                {
                    Cursor.Current = Cursors.WaitCursor;
                    Helper.GlobalData.windows.ShowLoad(this);
                    try
                    {
                        BLL.CusPriceOrderBLL bll = new BLL.CusPriceOrderBLL();
                        IBLL.ICommonBLL bll2     = new BLL.CommonBLL();

                        var branch_tb = bll2.GetBranchList();
                        this.txtbranch.Invoke((MethodInvoker) delegate
                        {
                            txtbranch.Bind(branch_tb, 300, 200, "branch_no", "branch_no:机构号:80,branch_name:机构名:140", "branch_no/branch_name->Text");
                        });

                        var people_tb = bll2.GetPeopleList();
                        this.txtpeople.Invoke((MethodInvoker) delegate
                        {
                            txtpeople.Bind(people_tb, 250, 200, "oper_id", "oper_id:职员编号:80,oper_name:姓名:80", "oper_id/oper_name->Text");
                        });

                        this.Invoke((MethodInvoker) delegate
                        {
                            IOrder ins = this;
                            ins.Add();
                        });
                    }
                    catch (Exception ex)
                    {
                        IvyBack.Helper.LogHelper.writeLog("frmCusPriceOrder", ex.ToString());
                        MsgForm.ShowFrom(ex);
                    }
                    Cursor.Current = Cursors.Default;
                    Helper.GlobalData.windows.CloseLoad(this);
                });
                th.Start();
            }
            catch (Exception ex)
            {
                MsgForm.ShowFrom(ex);
            }
            finally
            {
                System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default;
            }
        }
Example #6
0
        public frmCGInSheet()
        {
            InitializeComponent();
            //
            Helper.GlobalData.InitForm(this);
            //
            var tb = new DataTable();

            tb.Columns.Add("item_no");
            tb.Columns.Add("item_subno");
            tb.Columns.Add("barcode");
            tb.Columns.Add("item_name");
            tb.Columns.Add("unit_no");
            tb.Columns.Add("item_size");
            tb.Columns.Add("other3");
            tb.Columns.Add("in_qty", typeof(decimal));
            tb.Columns.Add("valid_price", typeof(decimal));
            tb.Columns.Add("discount", typeof(decimal));
            tb.Columns.Add("sub_amount", typeof(decimal));
            tb.Columns.Add("other1");
            tb.Columns.Add("valid_date", typeof(DateTime));
            tb.Columns.Add("price", typeof(decimal));//参考进价

            editGrid1.AddColumn("item_subno", "货号", "", 100, 1, "", true);
            editGrid1.AddColumn("item_name", "商品名称", "", 150, 1, "", false);
            editGrid1.AddColumn("unit_no", "单位", "", 60, 2, "", false);
            editGrid1.AddColumn("item_size", "规格", "", 80, 1, "", false);
            editGrid1.AddColumn("in_qty", "数量", "", 100, 3, "0.00", true);
            editGrid1.AddColumn("valid_price", "单价", "", 100, 3, "0.00", true);
            editGrid1.AddColumn("discount", "折扣", "", 100, 3, "0.00", true);
            editGrid1.AddColumn("sub_amount", "金额", "", 100, 3, "0.00", false);
            editGrid1.AddColumn("other1", "备注", "", 150, 1, "", true);
            editGrid1.AddColumn("valid_date", "有效期", "", 100, 1, "yyyy-MM-dd", true);
            editGrid1.AddColumn("price", "参考进价", "", 100, 3, "0.00", false);
            editGrid1.SetTotalColumn("in_qty,sub_amount");//合计项
            editGrid1.DataSource = tb;
            editGrid1.IsShowIco  = true;
            //
            try
            {
                System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor;
                //

                Thread th = new Thread(() =>
                {
                    Helper.GlobalData.windows.ShowLoad(this);
                    try
                    {
                        IBLL.ICommonBLL bll2 = new BLL.CommonBLL();
                        var branch_tb        = bll2.GetBranchList();
                        this.txtbranch.Invoke((MethodInvoker) delegate
                        {
                            txtbranch.Bind(branch_tb, 300, 200, "branch_no", "branch_no:编号:80,branch_name:名称:140", "branch_no/branch_name->Text");
                        });
                        DataTable dt2 = new DataTable();
                        dt2.Columns.Add("sale_no");
                        dt2.Columns.Add("sale_name");
                        dt2.Rows.Add("A", "购销");
                        dt2.Rows.Add("B", "代销");
                        dt2.Rows.Add("C", "联营");
                        dt2.Rows.Add("E", "联营进货");
                        dt2.Rows.Add("Z", "租赁");

                        this.txt_sale_no.Invoke((MethodInvoker) delegate
                        {
                            txt_sale_no.Bind(dt2, 250, 200, "sale_no", "sale_no:编码:80,sale_name:代销方式:100", "sale_no/sale_name->Text");
                        });
                        var sup_tb = bll2.GetAllSupList();
                        this.txt_sup.Invoke((MethodInvoker) delegate
                        {
                            txt_sup.Bind(sup_tb, 350, 200, "supcust_no", "supcust_no:编号:80,sup_name:名称:200", "supcust_no/sup_name->Text");
                        });
                        var deal_tb = bll2.GetPeopleList();
                        this.txt_deal_man.Invoke((MethodInvoker) delegate
                        {
                            txt_deal_man.Bind(deal_tb, 250, 200, "oper_id", "oper_id:编号:80,oper_name:姓名:100", "oper_id/oper_name->Text");
                        });

                        IBLL.IInOutBLL bll3 = new BLL.InOutBLL();
                        var order           = bll3.GetImportCGOrder();
                        this.txt_voucher_no.Invoke((MethodInvoker) delegate
                        {
                            this.txt_voucher_no.Bind(order, 350, 200, "sheet_no", "sheet_no:单据号:110,supcust:供应商:100,branch:仓库:100,oper_date:日期:150", "sheet_no->Text");
                        });

                        this.Invoke((MethodInvoker) delegate
                        {
                            IOrder ins = this;
                            ins.Add();
                        });
                    }
                    catch (Exception ex)
                    {
                        LogHelper.writeLog("frmCGInSheet", ex.ToString());
                        MsgForm.ShowFrom(ex);
                    }
                    Helper.GlobalData.windows.CloseLoad(this);
                });
                th.Start();
            }
            catch (Exception ex)
            {
                MsgForm.ShowFrom(ex);
                Helper.LogHelper.writeLog("frmCGInSheet()", ex.ToString());
            }
            finally
            {
                System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default;
            }
        }
        public frmSaleInSheet()
        {
            InitializeComponent();
            //
            Helper.GlobalData.InitForm(this);
            //
            var tb = new DataTable();

            tb.Columns.Add("item_no");
            tb.Columns.Add("item_subno");
            tb.Columns.Add("barcode");
            tb.Columns.Add("item_name");
            tb.Columns.Add("unit_no");
            tb.Columns.Add("item_size");
            tb.Columns.Add("in_qty", typeof(decimal));
            tb.Columns.Add("valid_price", typeof(decimal));
            tb.Columns.Add("sub_amount", typeof(decimal));
            tb.Columns.Add("other1");
            tb.Columns.Add("valid_date", typeof(DateTime));
            tb.Columns.Add("price", typeof(decimal));//参考进价

            editGrid1.AddColumn("item_subno", "货号", "", 100, 1, "", true);
            editGrid1.AddColumn("item_name", "商品名称", "", 150, 1, "", false);
            editGrid1.AddColumn("unit_no", "单位", "", 60, 2, "", false);
            editGrid1.AddColumn("item_size", "规格", "", 80, 1, "", false);
            editGrid1.AddColumn("in_qty", "数量", "", 100, 3, "0.00", true);
            editGrid1.AddColumn("valid_price", "单价", "", 100, 3, "0.00", true);
            editGrid1.AddColumn("sub_amount", "金额", "", 100, 3, "0.00", false);
            editGrid1.AddColumn("other1", "备注", "", 150, 1, "", true);
            editGrid1.AddColumn("price", "参考进价", "", 100, 3, "0.00", false);
            editGrid1.SetTotalColumn("in_qty,sub_amount");//合计项
            editGrid1.DataSource = tb;

            //
            try
            {
                System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor;
                //


                System.Threading.Thread th = new System.Threading.Thread(() =>
                {
                    Cursor.Current = Cursors.WaitCursor;
                    Helper.GlobalData.windows.ShowLoad(this);
                    try
                    {
                        IBLL.ICommonBLL bll2 = new BLL.CommonBLL();

                        var branch = bll2.GetBranchList();
                        this.txtbranch.Invoke((MethodInvoker) delegate
                        {
                            txtbranch.Bind(branch, 300, 200, "branch_no", "branch_no:编号:80,branch_name:名称:140", "branch_no/branch_name->Text");
                        });

                        var cust = bll2.GetAllCustList();
                        this.txt_cust.Invoke((MethodInvoker) delegate
                        {
                            txt_cust.Bind(cust, 350, 200, "supcust_no", "supcust_no:编号:80,sup_name:名称:200", "supcust_no/sup_name->Text");
                        });

                        var deal = bll2.GetPeopleList();
                        this.txt_deal_man.Invoke((MethodInvoker) delegate
                        {
                            txt_deal_man.Bind(deal, 250, 200, "oper_id", "oper_id:编号:80,oper_name:姓名:100", "oper_id/oper_name->Text");
                        });

                        this.Invoke((MethodInvoker) delegate
                        {
                            IOrder ins = this;
                            ins.Add();
                        });
                    }
                    catch (Exception ex)
                    {
                        IvyBack.Helper.LogHelper.writeLog("frmSaleInSheet", ex.ToString());
                        MsgForm.ShowFrom(ex);
                    }
                    Cursor.Current = Cursors.Default;
                    Helper.GlobalData.windows.CloseLoad(this);
                });
                th.Start();
            }
            catch (Exception ex)
            {
                MsgForm.ShowFrom(ex);
                Helper.LogHelper.writeLog("frmSaleInSheet()", ex.ToString());
            }
            finally
            {
                System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default;
            }
        }