Exemple #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.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.txt_sup.Text = "";
                this.txtbranch.GetDefaultValue();
                this.txtsheet_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_no.Text     = "A/购销";
                this.txtapprove_man.Text  = "";
                this.txtoper_man.Text     = Program.oper.oper_id + "/" + Program.oper.oper_name;
                this.txt_other3.Text      = "";
                this.txtapprove_date.Text = "";
                this.txt_voucher_no.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);
            }
        }
Exemple #2
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;
            }
        }