Beispiel #1
0
        private void NewSheet()
        {
            sale_master = new sm_t_salesheet();
            curr_cust   = new bi_t_supcust_info();
            sale_detail.Clear();
            this.dgvItem.DataSource = sale_detail;
            NewItem();

            frmSaleSheetMaster frm = new frmSaleSheetMaster();

            if (frm.GetSheetMaster(null, null, out sm_t_salesheet o_master, out bi_t_supcust_info o_supcust) == DialogResult.Yes)
            {
                this.sale_master = o_master;
                this.curr_cust   = o_supcust;
            }
Beispiel #2
0
        private void NewSheet()
        {
            sale_master = new co_t_order_main();
            curr_cust   = new bi_t_supcust_info();
            sale_detail.Clear();
            this.dgvItem.DataSource = sale_detail;
            NewItem();

            frmSaleSheetMaster frm = new frmSaleSheetMaster();

            ;
            if (frm.GetSheetSSMaster(null, null, out co_t_order_main master, out bi_t_supcust_info cust) == DialogResult.Yes)
            {
                this.sale_master = master;
                this.curr_cust   = cust;
            }
Beispiel #3
0
        public bi_t_supcust_info GetItem(string supcust_no)
        {
            JsonRequest r = new JsonRequest();

            r.Write("supcust_no", supcust_no);

            r.request("/cus?t=get_item");

            if (!r.ReadSuccess())
            {
                throw new Exception(r.ReadMessage());
            }

            bi_t_supcust_info sup = r.GetObject <bi_t_supcust_info>("data");

            return(sup);
        }
        public DialogResult GetSheetMaster(sm_t_salesheet sheet_master, bi_t_supcust_info supcust, out sm_t_salesheet master, out bi_t_supcust_info cust)
        {
            this.sheet_master = sheet_master;
            this.supcust      = supcust;

            DialogResult result = this.ShowDialog();

            if (result == DialogResult.Yes)
            {
                master = this.sheet_master;
                cust   = this.supcust;
            }
            else
            {
                master = null;
                cust   = null;
            }


            return(result);
        }
        public DialogResult GetSheetSSMaster(co_t_order_main sheet_master, bi_t_supcust_info supcust, out co_t_order_main master, out bi_t_supcust_info cust)
        {
            this.sheet_master = null;
            if (sheet_master != null)
            {
                this.sheet_master = new sm_t_salesheet
                {
                    cust_no   = sheet_master.sup_no,
                    other1    = sheet_master.memo,
                    oper_date = sheet_master.oper_date
                };

                this.supcust = supcust;
            }
            DialogResult result = this.ShowDialog();

            if (result == DialogResult.Yes)
            {
                master = null;
                if (this.sheet_master != null)
                {
                    master = new co_t_order_main
                    {
                        sup_no    = this.sheet_master.cust_no,
                        memo      = this.sheet_master.other1,
                        oper_date = this.sheet_master.oper_date,
                        branch_no = this.sheet_master.branch_no,
                    };
                }
                cust = this.supcust;
            }
            else
            {
                master = null;
                cust   = null;
            }


            return(result);
        }
        private void txt_cust_Leave(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txt_cust.Text.Trim()))
            {
                errMsg = "请输入客户";
                return;
            }
            else
            {
                errMsg = "";
            }

            string cust = this.txt_cust.Text.Trim();

            IBLL.ICus bll     = new BLL.CusBLL();
            var       supcust = bll.GetItem(cust);

            if (supcust == null || string.IsNullOrEmpty(supcust.supcust_no))
            {
                var frm = new frmSelect("2", cust);
                frm.ShowDialog();
                if (frm.item_no != "")
                {
                    supcust = bll.GetItem(frm.item_no);
                }
            }

            this.supcust = supcust;
            if (supcust == null)
            {
                errMsg = "客户不存在";
                this.lbl_cust_name.Text = "";
                this.txt_cust.Text      = "";
            }
            else
            {
                this.lbl_cust_name.Text = supcust.sup_name;
                this.txt_cust.Text      = supcust.supcust_no;
            }
        }
Beispiel #7
0
        private void OK()
        {
            if (_runType == 0)
            {
                IBLL.ISup bll = new BLL.SupBLL();
                if (supcust == null || string.IsNullOrEmpty(supcust.supcust_no))
                {
                    //添加
                    bi_t_supcust_info sup = new bi_t_supcust_info()
                    {
                        supcust_flag  = "S",
                        sup_man       = txtSupMan.Text,
                        sup_type      = cbSupType.SelectedValue.ToString(),
                        sup_tel       = txtTel.Text,
                        sup_name      = txtSupName.Text,
                        supcust_no    = txtSupNo.Text,
                        sup_addr      = txtAddress.Text,
                        sup_email     = txtEmail.Text,
                        credit_amt    = Conv.ToDecimal(txtCredit_amt.Text),
                        sale_man      = this.txtPeo.Text.Split('/')[0],
                        display_flag  = "1",
                        region_no     = this.txtRegion.Text.Split('/')[0],
                        cust_level    = this.cbPriceLevel.SelectedValue.ToString(),
                        update_time   = DateTime.Now,
                        sup_pyname    = this.txtPyname.Text,
                        is_retail     = this.cbIsRetail.Checked ? "1" : "0",
                        login_no      = this.txt_login_no.Text,
                        pwd           = string.IsNullOrEmpty(this.txt_pwd.Text) ? "123456" : this.txt_pwd.Text,
                        is_branch     = this.cb_is_branch.Checked ? "1" : "0",
                        supcust_group = cb_supcust_group.SelectedValue.ToString(),
                    };
                    bll.Add(sup);
                }
                else
                {
                    //修改
                    supcust.sup_man       = txtSupMan.Text;
                    supcust.sup_type      = cbSupType.SelectedValue.ToString();
                    supcust.sup_tel       = txtTel.Text;
                    supcust.sup_name      = txtSupName.Text;
                    supcust.supcust_no    = txtSupNo.Text;
                    supcust.sup_addr      = txtAddress.Text;
                    supcust.sup_email     = txtEmail.Text;
                    supcust.credit_amt    = Conv.ToDecimal(txtCredit_amt.Text);
                    supcust.sale_man      = this.txtPeo.Text.Split('/')[0];
                    supcust.display_flag  = this.mycbStop.Checked ? "0" : "1";
                    supcust.region_no     = this.txtRegion.Text.Split('/')[0];
                    supcust.cust_level    = this.cbPriceLevel.SelectedValue.ToString();
                    supcust.update_time   = DateTime.Now;
                    supcust.sup_pyname    = this.txtPyname.Text;
                    supcust.is_retail     = this.cbIsRetail.Checked ? "1" : "0";
                    supcust.login_no      = this.txt_login_no.Text;
                    supcust.pwd           = string.IsNullOrEmpty(this.txt_pwd.Text) ? "123456" : this.txt_pwd.Text;
                    supcust.is_branch     = this.cb_is_branch.Checked ? "1" : "0";
                    supcust.supcust_group = cb_supcust_group.SelectedValue.ToString();

                    bll.Update(supcust);
                }
            }
            else if (_runType == 1)
            {
                IBLL.ICus bll = new BLL.CusBLL();
                if (supcust == null || string.IsNullOrEmpty(supcust.supcust_no))
                {
                    //添加
                    bi_t_supcust_info sup = new bi_t_supcust_info()
                    {
                        supcust_flag  = "C",
                        sup_man       = txtSupMan.Text,
                        sup_type      = cbSupType.SelectedValue.ToString(),
                        sup_tel       = txtTel.Text,
                        sup_name      = txtSupName.Text,
                        supcust_no    = txtSupNo.Text,
                        sup_addr      = txtAddress.Text,
                        sup_email     = txtEmail.Text,
                        credit_amt    = Conv.ToDecimal(txtCredit_amt.Text),
                        sale_man      = this.txtPeo.Text.Split('/')[0],
                        display_flag  = "1",
                        cust_level    = this.cbPriceLevel.SelectedValue.ToString(),
                        region_no     = this.txtRegion.Text.Split('/')[0],
                        update_time   = DateTime.Now,
                        sup_pyname    = this.txtPyname.Text,
                        is_retail     = this.cbIsRetail.Checked ? "1" : "0",
                        login_no      = this.txt_login_no.Text,
                        pwd           = string.IsNullOrEmpty(this.txt_pwd.Text) ? "123456" : this.txt_pwd.Text,
                        is_branch     = this.cb_is_branch.Checked ? "1" : "0",
                        supcust_group = cb_supcust_group.SelectedValue.ToString(),
                    };
                    bll.Add(sup);
                }
                else
                {
                    //修改
                    supcust.sup_man       = txtSupMan.Text;
                    supcust.sup_type      = cbSupType.SelectedValue.ToString();
                    supcust.sup_tel       = txtTel.Text;
                    supcust.sup_name      = txtSupName.Text;
                    supcust.supcust_no    = txtSupNo.Text;
                    supcust.sup_addr      = txtAddress.Text;
                    supcust.sup_email     = txtEmail.Text;
                    supcust.credit_amt    = Conv.ToDecimal(txtCredit_amt.Text);
                    supcust.sale_man      = this.txtPeo.Text.Split('/')[0];
                    supcust.display_flag  = this.mycbStop.Checked ? "0" : "1";
                    supcust.region_no     = this.txtRegion.Text.Split('/')[0];
                    supcust.cust_level    = this.cbPriceLevel.SelectedValue.ToString();
                    supcust.update_time   = DateTime.Now;
                    supcust.sup_pyname    = this.txtPyname.Text;
                    supcust.is_retail     = this.cbIsRetail.Checked ? "1" : "0";
                    supcust.login_no      = this.txt_login_no.Text;
                    supcust.pwd           = string.IsNullOrEmpty(this.txt_pwd.Text) ? "123456" : this.txt_pwd.Text;
                    supcust.is_branch     = this.cb_is_branch.Checked ? "1" : "0";
                    supcust.supcust_group = cb_supcust_group.SelectedValue.ToString();

                    bll.Update(supcust);
                }
            }
        }
 private void btn_cancel_Click(object sender, EventArgs e)
 {
     supcust           = null;
     this.DialogResult = DialogResult.No;
     this.Close();
 }