コード例 #1
0
        void IOrder.Add()
        {
            try
            {
                RunType = 1;

                foreach (Control c in this.panel1.Controls)
                {
                    c.Enabled = true;
                }

                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.txt_cust.Text = "";
                this.txtbranch.GetDefaultValue();
                this.txtsheet_no.Text     = "";
                this.txt_voucher_no.Text  = "";
                this.txtoper_date.Text    = System.DateTime.Now.ToString("yyyy-MM-dd");
                this.txt_pay_date.Text    = System.DateTime.Now.ToString("yyyy-MM-dd");
                this.txt_sale_man.Text    = "";
                this.txtapprove_man.Text  = "";
                this.txtoper_man.Text     = Program.oper.oper_id + "/" + Program.oper.oper_name;
                this.txtmemo.Text         = "";
                this.txtapprove_date.Text = "";

                //
                var tb = editGrid1.DataSource;
                tb.Clear();
                for (int i = 0; i < 1; i++)
                {
                    tb.Rows.Add(tb.NewRow());
                }
                editGrid1.Refresh();

                Dictionary <string, object> dic = this.Tag as Dictionary <string, object>;
                this.Tag = Helper.Conv.ControlsAdds(this, dic);
            }
            catch (Exception ex)
            {
                MsgForm.ShowFrom(ex);
            }
        }
コード例 #2
0
        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;
            }
        }