Esempio n. 1
0
        private void tsbDel_Click(object sender, EventArgs e)
        {
            if (!MyLove.PermissionsBalidation(this.Text, "02"))
            {
                return;
            }
            DataRow dr = this.dgvSup.CurrentRow();

            if (dr == null)
            {
                return;
            }

            if (YesNoForm.ShowFrom("确认要删除吗?") == DialogResult.Yes)
            {
                if (_runType == 0)
                {
                    IBLL.ISup bll = new BLL.SupBLL();
                    var       sup = DB.ReflectionHelper.DataRowToModel <bi_t_supcust_info>(dr);
                    bll.Del(sup);
                }
                else if (_runType == 1)
                {
                    IBLL.ICus bll = new BLL.CusBLL();
                    var       sup = DB.ReflectionHelper.DataRowToModel <bi_t_supcust_info>(dr);
                    bll.Del(sup);
                }
                LoadSup();
            }
        }
Esempio n. 2
0
        public frmCusSettleList()
        {
            InitializeComponent();
            //
            Helper.GlobalData.InitForm(this);
            //
            dataGrid1.AddColumn("sheet_no", "单据号", "", 130, 1, "");
            dataGrid1.AddColumn("cus_no", "客户编号", "", 80, 1, "");
            dataGrid1.AddColumn("cus_name", "客户名称", "", 150, 1, "");
            dataGrid1.AddColumn("total_amount", "结算金额", "", 90, 3, "0.00");
            dataGrid1.AddColumn("free_money", "免付金额", "", 90, 3, "0.00");
            dataGrid1.AddColumn("pay_way_a", "付款方式", "", 120, 1, "");
            dataGrid1.AddColumn("branch_no_a", "发生机构", "", 130, 1, "");
            dataGrid1.AddColumn("deal_man_a", "经办人", "", 100, 1, "");
            dataGrid1.AddColumn("approve_man_a", "审核人", "", 110, 1, "");
            dataGrid1.AddColumn("approve_date", "审核日期", "", 100, 1, "yyyy-MM-dd");
            dataGrid1.AddColumn("oper_id_a", "操作员", "", 100, 1, "");
            dataGrid1.AddColumn("oper_date", "操作日期", "", 100, 1, "yyyy-MM-dd");
            dataGrid1.DataSource = new DataTable();
            dataGrid1.SetTotalColumn("total_amount,free_money");
            //
            dataGrid2.AddColumn("select_flag", "核销", "", 50, 2, "{0:,1:√}");
            dataGrid2.AddColumn("path", "方向", "", 50, 2, "{0:-,1:+}");
            dataGrid2.AddColumn("voucher_no", "业务单号", "", 150, 1, "");
            dataGrid2.AddColumn("voucher_first", "业务类型", "", 90, 2, IvyTransFunction.tran_no_str);
            dataGrid2.AddColumn("sheet_amount", "单据金额", "", 100, 3, "0.00");
            dataGrid2.AddColumn("paid_amount", "已付金额", "", 100, 3, "0.00");
            dataGrid2.AddColumn("paid_free", "已免付金额", "", 100, 3, "0.00");
            dataGrid2.AddColumn("yf_amount", "应付金额", "", 100, 3, "0.00");
            dataGrid2.AddColumn("pay_amount", "本次付款金额", "", 120, 3, "0.00");
            dataGrid2.AddColumn("pay_free", "免付金额", "", 100, 3, "0.00");
            dataGrid2.AddColumn("memo", "备注", "", 180, 1, "");
            dataGrid2.AddColumn("voucher_type", "业务描述", "", 100, 1, "");
            dataGrid2.DataSource = new DataTable();
            //
            this.dateTextBox1.Text = System.DateTime.Now.AddDays(-30).ToString("yyyy-MM-dd");
            this.dateTextBox2.Text = System.DateTime.Now.ToString("yyyy-MM-dd");
            IBLL.ICus bll = new BLL.CusBLL();
            int       tmp;

            this.myTextBox1.Bind(bll.GetDataTable("", "", 1, 1, 20000, out tmp), 300, 200, "supcust_no", "supcust_no:客户编码:100,sup_name:客户名称:150",
                                 "supcust_no/sup_name->Text");
        }
        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;
            }
        }
Esempio n. 4
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);
                }
            }
        }
Esempio n. 5
0
        private void LoadSup()
        {
            if (!MyLove.PermissionsBalidation(this.Text, "18"))
            {
                return;
            }
            page.PageSize = this.dgvSup.MaxDisplayRowCount();

            Thread th = new Thread(() =>
            {
                Helper.GlobalData.windows.ShowLoad(this);
                try
                {
                    Cursor.Current = Cursors.WaitCursor;
                    string cls_no  = "";

                    this.tv.Invoke((MethodInvoker) delegate
                    {
                        if (this.tv.SelectedNode != null)
                        {
                            if (this.tv.SelectedNode.Tag != null)
                            {
                                var item = (Model.bi_t_region_info) this.tv.SelectedNode.Tag;
                                cls_no   = item.region_no;
                            }
                        }
                    });

                    string SelectedNode = "";
                    string Keyword      = "";
                    int ShowStopSup     = 0;

                    this.Invoke((MethodInvoker) delegate
                    {
                        SelectedNode = this.tv.SelectedNode == null ? "" : cls_no;
                        Keyword      = this.txtKeyword.Text.Trim();
                        ShowStopSup  = this.cbShowStopSup.Checked ? 1 : 0;
                    });

                    if (_runType == 0)
                    {
                        IBLL.ISup bll = new BLL.SupBLL();
                        page          = bll.GetDataTable(
                            SelectedNode,
                            Keyword,
                            ShowStopSup,
                            page
                            );
                    }
                    else if (_runType == 1)
                    {
                        IBLL.ICus bll = new BLL.CusBLL();
                        page          = bll.GetDataTable(
                            SelectedNode,
                            Keyword,
                            ShowStopSup,
                            page
                            );
                    }

                    Conv.AddColorTable(page.tb, "display_flag");

                    this.Invoke((MethodInvoker) delegate
                    {
                        this.dgvSup.DataSource = page.tb;

                        this.lblMaxIndex.Text = page.PageMax.ToString();
                        this.lblIndex.Text    = page.PageIndex.ToString();
                    });

                    Cursor.Current = Cursors.Default;
                }
                catch (Exception ex)
                {
                    LogHelper.writeLog("LoadSup", "获取商品分类出错!");
                    MsgForm.ShowFrom(ex);
                }
                Helper.GlobalData.windows.CloseLoad(this);
            });

            th.Start();
        }
Esempio n. 6
0
        private void LoadItem()
        {
            string    keyword = this.txtKeyword.Text.Trim();
            DataTable dt      = new DataTable();

            if (this.op_type == "1")
            {
                //商品
                IBLL.IItem bll = new BLL.ItemBLL();
                dt = bll.QuickSearchList(keyword);
                if (dt.Rows.Count == 0)
                {
                }
                else if (dt.Rows.Count == 1)
                {
                    this.item_no = dt.Rows[0]["item_subno"].ToString();
                    DialogResult = System.Windows.Forms.DialogResult.OK;
                    this.Close();
                }
            }
            else if (this.op_type == "2")
            {
                //客户
                IBLL.ICus bll = new BLL.CusBLL();
                dt = bll.QuickSearchList(keyword);
                if (dt.Rows.Count == 1)
                {
                    this.item_no = dt.Rows[0]["supcust_no"].ToString();
                    DialogResult = System.Windows.Forms.DialogResult.OK;
                    this.Close();
                }
            }
            else if (this.op_type == "3")
            {
                //供应商
                IBLL.ISup bll = new BLL.SupBLL();
                dt = bll.QuickSearchList(keyword);
                if (dt.Rows.Count == 1)
                {
                    this.item_no = dt.Rows[0]["supcust_no"].ToString();
                    DialogResult = System.Windows.Forms.DialogResult.OK;
                    this.Close();
                }
            }
            else if (this.op_type == "4")
            {
                //业务员
                IBLL.IPeople bll = new BLL.PeopleBLL();
                dt = bll.QuickSearchList("02", keyword);
                if (dt.Rows.Count == 1)
                {
                    this.item_no = dt.Rows[0]["oper_id"].ToString();
                    DialogResult = System.Windows.Forms.DialogResult.OK;
                    this.Close();
                }
            }
            else if (this.op_type == "5")
            {
                //仓库
                IBLL.IBranch bll = new BLL.BranchBLL();
                dt = bll.QuickSearchList(keyword);
                if (dt.Rows.Count == 1)
                {
                    this.item_no = dt.Rows[0]["branch_no"].ToString();
                    DialogResult = System.Windows.Forms.DialogResult.OK;
                    this.Close();
                }
            }
            this.dgvItem.DataSource = dt;
            if (dt.Rows.Count > 0)
            {
                this.dgvItem.Focus();
            }
            else
            {
                this.txtKeyword.Focus();
            }
        }