コード例 #1
0
        private void tsbDel_Click(object sender, EventArgs e)
        {
            try
            {
                if (!MyLove.PermissionsBalidation(this.Text, "02"))
                {
                    return;
                }
                if (txtsheet_no.Text.Trim() != "")
                {
                    string sheet_no = txtsheet_no.Text.Trim();

                    if (YesNoForm.ShowFrom("确认删除单据" + sheet_no + "?") == DialogResult.Yes)
                    {
                        IBLL.ICusPriceOrder bll = new BLL.CusPriceOrderBLL();
                        bll.Delete(sheet_no);
                        IOrder ins = this;
                        ins.Add();
                    }
                }
            }
            catch (Exception ex)
            {
                MsgForm.ShowFrom(ex);
            }
        }
コード例 #2
0
        private void refreshData()
        {
            try
            {
                System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor;
                //
                IBLL.ICusPriceOrder bll = new BLL.CusPriceOrderBLL();
                DateTime            date1;
                DateTime            date2;
                DateTime.TryParse(dateTextBox1.Text.Trim(), out date1);
                DateTime.TryParse(dateTextBox2.Text.Trim(), out date2);
                if (date1 == DateTime.MinValue)
                {
                    throw new Exception("期间不正确");
                }
                if (date2 == DateTime.MinValue)
                {
                    throw new Exception("期间不正确");
                }
                DataTable tb = bll.GetList(date1, date2);

                this.dataGrid1.DataSource = tb;
            }
            catch (Exception ex)
            {
                System.Windows.Forms.MessageBox.Show(ex.Message);
            }
            finally
            {
                System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default;
            }
        }
コード例 #3
0
        public frmCusPriceOrder()
        {
            InitializeComponent();
            //
            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("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("barcode", "条码", "", 120, 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("old_price", "原一级批发价", "原价", 100, 3, "0.00", false);
            editGrid1.AddColumn("old_price2", "原二级批发价", "原价", 100, 3, "0.00", false);
            editGrid1.AddColumn("old_price3", "原三级批发价", "原价", 100, 3, "0.00", false);
            editGrid1.AddColumn("new_price", "新一级批发价", "新价", 100, 3, "0.00", true);
            editGrid1.AddColumn("new_price2", "新二级批发价", "新价", 100, 3, "0.00", true);
            editGrid1.AddColumn("new_price3", "新三级批发价", "新价", 100, 3, "0.00", true);
            editGrid1.DataSource = tb;
            //
            try
            {
                System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor;
                //
                BLL.CusPriceOrderBLL bll = new BLL.CusPriceOrderBLL();
                var tbgoods = bll.GetGoodsList();
                editGrid1.Bind("item_subno", tbgoods, 500, 200, "item_subno", "item_subno:货号:80,item_name:品名:150," +
                               "barcode:条码:100,item_subname:拼音码:80", "item_no->item_no,item_subno->item_subno,barcode->barcode," +
                               "item_name->item_name,unit_no->unit_no,item_size->item_size,base_price->old_price," +
                               "base_price2->old_price2,base_price3->old_price3");

                editGrid1.Bind("barcode", tbgoods, 500, 200, "barcode", "item_subno:货号:80,item_name:品名:150," +
                               "barcode:条码:100,item_subname:拼音码:80", "item_no->item_no,item_subno->item_subno,barcode->barcode," +
                               "item_name->item_name,unit_no->unit_no,item_size->item_size,base_price->old_price," +
                               "base_price2->old_price2,base_price3->old_price3");

                //
                txtbranch.Bind(bll.GetBranchList(), 300, 200, "branch_no", "branch_no:机构号:80,branch_name:机构名:140", "branch_no/branch_name->Text");
                txtpeople.Bind(bll.GetPeopleList(), 250, 200, "oper_id", "oper_id:职员编号:80,oper_name:姓名:80", "oper_id/oper_name->Text");
            }
            catch (Exception ex)
            {
                System.Windows.Forms.MessageBox.Show(ex.Message);
            }
            finally
            {
                System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default;
            }
        }
コード例 #4
0
        void IOrder.Add()
        {
            try
            {
                RunType = 1;

                IBLL.ICusPriceOrder bll = new BLL.CusPriceOrderBLL();
                this.txtprice_type.Text   = "批发价";
                this.txtbranch.Text       = "0001/总仓";
                this.txtsheet_no.Text     = bll.MaxCode();
                this.txtoper_date.Text    = System.DateTime.Now.ToString("yyyy-MM-dd");
                this.txtpeople.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();
            }
            catch (Exception ex)
            {
                System.Windows.Forms.MessageBox.Show(ex.Message);
            }
        }
コード例 #5
0
 private void tsbCheck_Click(object sender, EventArgs e)
 {
     try
     {
         if (!MyLove.PermissionsBalidation(this.Text, "05"))
         {
             return;
         }
         if (this.dataGrid1.CurrentRow() != null)
         {
             string sheet_no         = this.dataGrid1.CurrentRow()["sheet_no"].ToString();
             IBLL.ICusPriceOrder bll = new BLL.CusPriceOrderBLL();
             bll.Check(sheet_no, Program.oper.oper_id);
             var row = this.dataGrid1.CurrentRow();
             row["approve_flag"] = "1";
             row["approve_man"]  = Program.oper.oper_id;
             row["approve_date"] = System.DateTime.Now;
             this.dataGrid1.Refresh();
         }
     }
     catch (Exception ex)
     {
         MsgForm.ShowFrom(ex);
     }
 }
コード例 #6
0
 private void tsbDel_Click(object sender, EventArgs e)
 {
     try
     {
         if (!MyLove.PermissionsBalidation(this.Text, "02"))
         {
             return;
         }
         if (this.dataGrid1.CurrentRow() != null)
         {
             string sheet_no = this.dataGrid1.CurrentRow()["sheet_no"].ToString();
             if (YesNoForm.ShowFrom("确认删除单据" + sheet_no + "?") == DialogResult.Yes)
             {
                 IBLL.ICusPriceOrder bll = new BLL.CusPriceOrderBLL();
                 bll.Delete(sheet_no);
                 var tb = this.dataGrid1.DataSource;
                 tb.Rows.Remove(this.dataGrid1.CurrentRow());
                 this.dataGrid2.DataSource = new DataTable();
                 this.dataGrid1.Refresh();
             }
         }
     }
     catch (Exception ex)
     {
         MsgForm.ShowFrom(ex);
     }
 }
コード例 #7
0
        public void GetPrintTb()
        {
            if (string.IsNullOrEmpty(this.txtsheet_no.Text))
            {
                throw new Exception("请选择单据!");
            }

            IBLL.ICusPriceOrder bll = new BLL.CusPriceOrderBLL();
            DataTable           tb1;
            DataTable           tb2;

            bll.GetOrder(this.txtsheet_no.Text, out tb1, out tb2);

            PrintForm.PrintHelper.tb_main   = tb1;
            PrintForm.PrintHelper.tb_detail = tb2;
        }
コード例 #8
0
 private void tsbCheck_Click(object sender, EventArgs e)
 {
     try
     {
         if (txtsheet_no.Text.Trim() != "")
         {
             string sheet_no         = txtsheet_no.Text.Trim();
             IBLL.ICusPriceOrder bll = new BLL.CusPriceOrderBLL();
             bll.Check(sheet_no, Program.oper.oper_id);
             IOrder ins = this;
             ins.ShowOrder(sheet_no);
         }
     }
     catch (Exception ex)
     {
         System.Windows.Forms.MessageBox.Show(ex.Message);
     }
 }
コード例 #9
0
 private void dataGrid1_CurrentCellChange(object sender, string column_name, DataRow row)
 {
     try
     {
         if (sheet_no != row["sheet_no"].ToString())
         {
             sheet_no = row["sheet_no"].ToString();
             IBLL.ICusPriceOrder   bll = new BLL.CusPriceOrderBLL();
             System.Data.DataTable tb1;
             System.Data.DataTable tb2;
             bll.GetOrder(sheet_no, out tb1, out tb2);
             this.dataGrid2.DataSource = tb2;
         }
     }
     catch (Exception ex)
     {
         System.Windows.Forms.MessageBox.Show(ex.Message);
     }
 }
コード例 #10
0
 private void tsbCheck_Click(object sender, EventArgs e)
 {
     try
     {
         if (this.dataGrid1.CurrentRow() != null)
         {
             string sheet_no         = this.dataGrid1.CurrentRow()["sheet_no"].ToString();
             IBLL.ICusPriceOrder bll = new BLL.CusPriceOrderBLL();
             bll.Check(sheet_no, Program.oper.oper_id);
             var row = this.dataGrid1.CurrentRow();
             row["approve_flag"] = "1";
             row["approve_man"]  = Program.oper.oper_id;
             row["approve_date"] = System.DateTime.Now;
             this.dataGrid1.Refresh();
         }
     }
     catch (Exception ex)
     {
         System.Windows.Forms.MessageBox.Show(ex.Message);
     }
 }
コード例 #11
0
        private void tsbDel_Click(object sender, EventArgs e)
        {
            try
            {
                if (txtsheet_no.Text.Trim() != "")
                {
                    string sheet_no = txtsheet_no.Text.Trim();

                    if (System.Windows.Forms.MessageBox.Show("确认删除单据" + sheet_no + "?", "提示", MessageBoxButtons.YesNo) == DialogResult.Yes)
                    {
                        IBLL.ICusPriceOrder bll = new BLL.CusPriceOrderBLL();
                        bll.Delete(sheet_no);
                        IOrder ins = this;
                        ins.Add();
                    }
                }
            }
            catch (Exception ex)
            {
                System.Windows.Forms.MessageBox.Show(ex.Message);
            }
        }
コード例 #12
0
 private void tsbCheck_Click(object sender, EventArgs e)
 {
     try
     {
         if (!MyLove.PermissionsBalidation(this.Text, "05"))
         {
             return;
         }
         if (txtsheet_no.Text.Trim() != "")
         {
             string sheet_no         = txtsheet_no.Text.Trim();
             IBLL.ICusPriceOrder bll = new BLL.CusPriceOrderBLL();
             bll.Check(sheet_no, Program.oper.oper_id);
             IOrder ins = this;
             ins.ShowOrder(sheet_no);
         }
     }
     catch (Exception ex)
     {
         MsgForm.ShowFrom(ex);
     }
 }
コード例 #13
0
 private void tsbDel_Click(object sender, EventArgs e)
 {
     try
     {
         if (this.dataGrid1.CurrentRow() != null)
         {
             string sheet_no = this.dataGrid1.CurrentRow()["sheet_no"].ToString();
             if (System.Windows.Forms.MessageBox.Show("确认删除单据" + sheet_no + "?", "提示", MessageBoxButtons.YesNo) == DialogResult.Yes)
             {
                 IBLL.ICusPriceOrder bll = new BLL.CusPriceOrderBLL();
                 bll.Delete(sheet_no);
                 var tb = this.dataGrid1.DataSource;
                 tb.Rows.Remove(this.dataGrid1.CurrentRow());
                 this.dataGrid1.Refresh();
             }
         }
     }
     catch (Exception ex)
     {
         System.Windows.Forms.MessageBox.Show(ex.Message);
     }
 }
コード例 #14
0
        void IOrder.Save()
        {
            try
            {
                System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor;
                //
                if (txtbranch.Text.Trim().Contains("/") == false)
                {
                    throw new Exception("机构必填!");
                }
                if (txtoper_date.Text.Trim() == "")
                {
                    throw new Exception("单据日期必填!");
                }
                pm_t_flow_main ord = new pm_t_flow_main();
                List <pm_t_price_flow_detial> lines = new List <pm_t_price_flow_detial>();
                ord.sheet_no     = txtsheet_no.Text.Trim();
                ord.branch_no    = txtbranch.Text.Trim().Split('/')[0];
                ord.vip_type     = "";
                ord.price_type   = "1";
                ord.oper_date    = Helper.Conv.ToDateTime(txtoper_date.Text.Trim());
                ord.oper_id      = txtoper_man.Text.Split('/')[0];
                ord.approve_flag = "0";
                ord.memo         = txtmemo.Text.Trim();
                ord.other1       = "";
                ord.other2       = "";
                ord.other3       = "";
                ord.cm_branch    = "00";
                ord.start_date   = System.DateTime.MinValue;
                ord.end_date     = System.DateTime.MinValue;
                ord.start_time   = "";
                ord.end_time     = "";
                ord.buy_amt      = 0;
                ord.add_amt      = 0;
                ord.deal_man     = txtpeople.Text.Split('/')[0];
                ord.approve_man  = txtapprove_man.Text.Split('/')[0];
                ord.approve_date = System.DateTime.MinValue;
                ord.num1         = 0;
                ord.num2         = 0;
                ord.num3         = 0;
                int flag = 0;
                foreach (DataRow row in editGrid1.DataSource.Rows)
                {
                    if (row["item_no"].ToString() != "")
                    {
                        pm_t_price_flow_detial line = new pm_t_price_flow_detial();
                        lines.Add(line);
                        line.sheet_no   = ord.sheet_no;
                        line.item_no    = row["item_no"].ToString();
                        line.price_type = ord.price_type;
                        line.start_date = ord.start_date;
                        line.end_date   = ord.end_date;
                        line.old_price  = Helper.Conv.ToDecimal(row["old_price"].ToString());
                        line.new_price  = Helper.Conv.ToDecimal(row["new_price"].ToString());
                        line.discount   = 0;
                        line.buy_qnty   = 0;
                        line.other1     = "";
                        line.other2     = "";
                        line.other3     = "";
                        line.start_time = "";
                        line.end_time   = "";
                        line.stock_qty  = 0;
                        line.num1       = 0;
                        line.num2       = 0;
                        line.num3       = 0;
                        line.old_price2 = Helper.Conv.ToDecimal(row["old_price2"].ToString());
                        line.old_price3 = Helper.Conv.ToDecimal(row["old_price3"].ToString());

                        line.new_price2 = Helper.Conv.ToDecimal(row["new_price2"].ToString());
                        line.new_price3 = Helper.Conv.ToDecimal(row["new_price3"].ToString());

                        flag = 1;
                    }
                }
                if (flag == 0)
                {
                    throw new Exception("表体无合法数据!");
                }
                if (runType == 1)
                {
                    IBLL.ICusPriceOrder bll = new BLL.CusPriceOrderBLL();
                    bll.Add(ord, lines);
                    IOrder ins = this;
                    ins.ShowOrder(ord.sheet_no);
                }
                else if (runType == 2)
                {
                    IBLL.ICusPriceOrder bll = new BLL.CusPriceOrderBLL();
                    bll.Change(ord, lines);
                    IOrder ins = this;
                    ins.ShowOrder(ord.sheet_no);
                }
            }
            catch (Exception ex)
            {
                System.Windows.Forms.MessageBox.Show(ex.Message);
            }
            finally
            {
                System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default;
            }
        }
コード例 #15
0
        private void refreshData()
        {
            try
            {
                System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor;
                //
                DateTime date1;
                DateTime date2;
                DateTime.TryParse(dateTextBox1.Text.Trim(), out date1);
                DateTime.TryParse(dateTextBox2.Text.Trim(), out date2);
                System.Threading.Thread th = new System.Threading.Thread(() =>
                {
                    Cursor.Current = Cursors.WaitCursor;
                    Helper.GlobalData.windows.ShowLoad(this);
                    try
                    {
                        IBLL.ICusPriceOrder bll = new BLL.CusPriceOrderBLL();

                        if (date1 == DateTime.MinValue)
                        {
                            throw new Exception("期间不正确");
                        }
                        if (date2 == DateTime.MinValue)
                        {
                            throw new Exception("期间不正确");
                        }
                        DataTable tb = bll.GetList(date1, date2);


                        this.dataGrid1.Invoke((MethodInvoker) delegate
                        {
                            this.dataGrid1.DataSource = tb;
                            if (tb.Rows.Count > 0)
                            {
                                sheet_no = tb.Rows[0]["sheet_no"].ToString();

                                System.Data.DataTable tb1;
                                System.Data.DataTable tb2;
                                bll.GetOrder(sheet_no, out tb1, out tb2);
                                this.dataGrid2.DataSource = tb2;
                            }
                        });
                    }
                    catch (Exception ex)
                    {
                        IvyBack.Helper.LogHelper.writeLog("refreshData", 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;
            }
        }
コード例 #16
0
        void IOrder.ShowOrder(string sheet_no)
        {
            try
            {
                System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor;
                //
                RunType = 2;

                IBLL.ICusPriceOrder bll = new BLL.CusPriceOrderBLL();
                DataTable           tb1;
                DataTable           tb2;
                bll.GetOrder(sheet_no, out tb1, out tb2);
                //

                //
                var r1 = tb1.Rows[0];

                if (r1["branch_no"].ToString() == "")
                {
                    txtbranch.Text = "";
                }
                else
                {
                    txtbranch.Text = r1["branch_no"].ToString() + "/" + r1["branch_name"].ToString();
                }
                txtsheet_no.Text  = r1["sheet_no"].ToString();
                txtoper_date.Text = Helper.Conv.ToDateTime(r1["oper_date"].ToString()).ToString("yyyy-MM-dd");
                if (r1["deal_man"].ToString() == "")
                {
                    txtpeople.Text = "";
                }
                else
                {
                    txtpeople.Text = r1["deal_man"].ToString() + "/" + r1["deal_man_name"].ToString();
                }
                if (r1["approve_man"].ToString() == "")
                {
                    txtapprove_man.Text = "";
                }
                else
                {
                    txtapprove_man.Text = r1["approve_man"].ToString() + "/" + r1["approve_man_name"].ToString();
                }
                if (r1["oper_id"].ToString() == "")
                {
                    txtoper_man.Text = "";
                }
                else
                {
                    txtoper_man.Text = r1["oper_id"] + "/" + r1["oper_name"];
                }
                txtmemo.Text = r1["memo"].ToString();
                DateTime dt;
                if (DateTime.TryParse(r1["approve_date"].ToString(), out dt) == true)
                {
                    txtapprove_date.Text = dt.ToString("yyyy-MM-dd");
                }
                else
                {
                    txtapprove_date.Text = "";
                }
                //
                editGrid1.DataSource = tb2;
            }
            catch (Exception ex)
            {
                System.Windows.Forms.MessageBox.Show(ex.Message);
            }
            finally
            {
                System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default;
            }
        }
コード例 #17
0
        void IOrder.Save()
        {
            try
            {
                System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor;
                //
                if (txtbranch.Text.Trim().Contains("/") == false)
                {
                    throw new Exception("机构必填!");
                }
                if (txtoper_date.Text.Trim() == "")
                {
                    throw new Exception("单据日期必填!");
                }
                pm_t_flow_main ord = new pm_t_flow_main();
                List <pm_t_price_flow_detial> lines = new List <pm_t_price_flow_detial>();
                ord.sheet_no     = txtsheet_no.Text.Trim();
                ord.branch_no    = txtbranch.Text.Trim().Split('/')[0];
                ord.vip_type     = "";
                ord.price_type   = "1";
                ord.oper_date    = Helper.Conv.ToDateTime(txtoper_date.Text.Trim());
                ord.oper_id      = txtoper_man.Text.Split('/')[0];
                ord.approve_flag = "0";
                ord.memo         = txtmemo.Text.Trim();
                ord.other1       = "";
                ord.other2       = "";
                ord.other3       = "";
                ord.cm_branch    = "00";
                ord.start_date   = System.DateTime.MinValue;
                ord.end_date     = System.DateTime.MinValue;
                ord.start_time   = "";
                ord.end_time     = "";
                ord.buy_amt      = 0;
                ord.add_amt      = 0;
                ord.deal_man     = txtpeople.Text.Split('/')[0];
                ord.approve_man  = txtapprove_man.Text.Split('/')[0];
                ord.approve_date = System.DateTime.MinValue;
                ord.num1         = 0;
                ord.num2         = 0;
                ord.num3         = 0;
                int flag = 0;
                foreach (DataRow row in editGrid1.DataSource.Rows)
                {
                    if (row["item_no"].ToString() != "")
                    {
                        pm_t_price_flow_detial line = new pm_t_price_flow_detial();
                        lines.Add(line);
                        line.sheet_no   = ord.sheet_no;
                        line.item_no    = row["item_no"].ToString();
                        line.price_type = ord.price_type;
                        line.start_date = ord.start_date;
                        line.end_date   = ord.end_date;
                        line.discount   = 0;
                        line.buy_qnty   = 0;
                        line.other1     = "";
                        line.other2     = "";
                        line.other3     = "";
                        line.start_time = "";
                        line.end_time   = "";
                        line.stock_qty  = 0;
                        line.num1       = 0;
                        line.num2       = 0;
                        line.num3       = 0;

                        line.old_price  = Helper.Conv.ToDecimal(row["old_price"].ToString());
                        line.old_price2 = Helper.Conv.ToDecimal(row["old_price2"].ToString());
                        line.old_price3 = Helper.Conv.ToDecimal(row["old_price3"].ToString());

                        line.new_price  = string.IsNullOrEmpty(row["new_price"].ToString()) ? line.old_price : Helper.Conv.ToDecimal(row["new_price"].ToString());
                        line.new_price2 = string.IsNullOrEmpty(row["new_price2"].ToString()) ? line.old_price2 : Helper.Conv.ToDecimal(row["new_price2"].ToString());
                        line.new_price3 = string.IsNullOrEmpty(row["new_price3"].ToString()) ? line.old_price3 : Helper.Conv.ToDecimal(row["new_price3"].ToString());

                        flag = 1;
                    }
                }
                if (flag == 0)
                {
                    throw new Exception("表体无合法数据!");
                }
                if (runType == 1)
                {
                    IBLL.ICusPriceOrder bll = new BLL.CusPriceOrderBLL();
                    string sheet_no;
                    bll.Add(ord, lines, out sheet_no);
                    IOrder ins = this;
                    ins.ShowOrder(sheet_no);
                }
                else if (runType == 2)
                {
                    IBLL.ICusPriceOrder bll = new BLL.CusPriceOrderBLL();
                    bll.Change(ord, lines);
                    IOrder ins = this;
                    ins.ShowOrder(ord.sheet_no);
                }

                Dictionary <string, object> dic = this.Tag as Dictionary <string, object>;
                this.Tag = Helper.Conv.ControlsAdds(this, dic);

                IBLL.ISys sys       = new BLL.SysBLL();
                string    isApprove = sys.Read("approve_at_ones");
                if ("1".Equals(isApprove))
                {
                    if (YesNoForm.ShowFrom("保存成功!是否立即审核") == DialogResult.Yes)
                    {
                        tsbCheck_Click(new object(), new EventArgs());
                    }
                }
            }
            catch (Exception ex)
            {
                MsgForm.ShowFrom(ex);
            }
            finally
            {
                System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default;
            }
        }
コード例 #18
0
        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;
            }
        }