Exemplo n.º 1
0
        public void SelectRow(DataRow row, string condition = "")
        {
            frmSelect frm = new frmSelect();

            frm.dgv.AddColumn("选择", "选择", "", 40, 2, "{0:,1:√}");
            frm.dgv.AddColumn("item_subno", "货号", "", 110, 1, "");
            frm.dgv.AddColumn("barcode", "条码", "", 110, 1, "");
            frm.dgv.AddColumn("item_name", "商品名称", "", 160, 1, "");
            frm.dgv.AddColumn("item_subname", "拼音码", "", 90, 1, "");
            frm.dgv.AddColumn("unit_no", "单位", "", 60, 1, "");
            frm.dgv.AddColumn("item_size", "规格", "", 60, 1, "");
            frm.dgv.AddColumn("price", "价格", "", 100, 3, "0.00");
            frm.dgv.AddColumn("product_area", "产地", "", 150, 1, "");

            frm.Text      = "选择商品";
            frm.condition = condition;

            IBLL.IPriceBLL pricebll = new BLL.PriceBLL();
            var            sup_id   = this.txt_cust.Text.Trim().Split('/')[0];

            List <DataRow> lis = frm.SelectDataRow("货号:", "item_subno");

            int index = 0;

            for (int i = 0; i < this.editGrid1.DataSource.Rows.Count; i++)
            {
                if (this.editGrid1.DataSource.Rows[i] == row)
                {
                    index = i;
                }
            }
            if (lis.Count > 1)
            {
                for (int i = 0; i < lis.Count - 1; i++)
                {
                    this.editGrid1.DataSource.Rows.InsertAt(this.editGrid1.DataSource.NewRow(), index);
                }
            }

            foreach (DataRow dr in lis)
            {
                var dgv_tb = this.editGrid1.DataSource.Copy();
                dgv_tb.ImportRow(dr);
                var dgv_dr = dgv_tb.Rows[dgv_tb.Rows.Count - 1];

                dgv_dr["valid_price"] = pricebll.GetCustItemPrice(sup_id, dr["item_no"].ToString(), "0");
                dgv_dr["sub_amount"]  = Helper.Conv.ToDecimal(dgv_dr["in_qty"]) * Helper.Conv.ToDecimal(dgv_dr["valid_price"]);

                Conv.CopyDataRow(this.editGrid1.DataSource, index, dgv_dr);
                index++;
            }

            if (!string.IsNullOrEmpty(this.editGrid1.DataSource.Rows[this.editGrid1.DataSource.Rows.Count - 1]["item_subno"].ToString()))
            {
                this.editGrid1.DataSource.Rows.Add();
            }

            this.editGrid1.Editing = false;
            this.editGrid1.Refresh();
        }
Exemplo n.º 2
0
        private void btnSelect_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(this.txt_sup.Text))
            {
                MsgForm.ShowFrom("请先选择供应商");
                return;
            }

            IBLL.IInOutBLL bll        = new BLL.InOutBLL();
            var            dt         = new DataTable();
            var            supcust_no = txt_sup.Text.Trim().Split('/')[0];

            dt = bll.GetSimpleInOutList(DateTime.Now.AddMonths(-2), DateTime.Now, supcust_no, "A");

            frmSelect frm = new frmSelect();

            frm.dgv.AddColumn("oper_date", "日期", "", 100, 1, "yyyy-MM-dd");
            frm.dgv.AddColumn("sheet_no", "单据号", "", 150, 1, "");
            frm.dgv.AddColumn("仓库", "仓库", "", 200, 1, "");
            frm.dgv.AddColumn("货商", "货商", "", 200, 1, "");
            frm.dgv.AddColumn("total_amount", "金额", "", 100, 3, "0.00");

            frm.Text         = "选择入库单";
            frm.tb           = dt;
            frm.is_show_left = false;

            this.txt_voucher_no.Text = frm.SelectData("单号:", "sheet_no");
        }
Exemplo n.º 3
0
        public void SelectRow(DataRow row, string condition = "")
        {
            frmSelect frm = new frmSelect();

            frm.dgv.AddColumn("选择", "选择", "", 40, 2, "{0:,1:√}");
            frm.dgv.AddColumn("item_subno", "货号", "", 110, 1, "");
            frm.dgv.AddColumn("barcode", "条码", "", 110, 1, "");
            frm.dgv.AddColumn("item_name", "商品名称", "", 160, 1, "");
            frm.dgv.AddColumn("item_subname", "拼音码", "", 90, 1, "");
            frm.dgv.AddColumn("unit_no", "单位", "", 60, 1, "");
            frm.dgv.AddColumn("item_size", "规格", "", 60, 1, "");
            frm.dgv.AddColumn("price", "价格", "", 100, 3, "0.00");
            frm.dgv.AddColumn("product_area", "产地", "", 150, 1, "");

            frm.Text      = "选择商品";
            frm.condition = condition;

            List <DataRow> lis = frm.SelectDataRow("货号:", "item_subno");

            int index = 0;

            for (int i = 0; i < this.editGrid1.DataSource.Rows.Count; i++)
            {
                if (this.editGrid1.DataSource.Rows[i] == row)
                {
                    index = i;
                }
            }
            if (lis.Count > 1)
            {
                for (int i = 0; i < lis.Count - 1; i++)
                {
                    this.editGrid1.DataSource.Rows.InsertAt(this.editGrid1.DataSource.NewRow(), index);
                }
            }

            foreach (DataRow dr in lis)
            {
                var dgv_tb = this.editGrid1.DataSource.Copy();
                dgv_tb.ImportRow(dr);
                var dgv_dr = dgv_tb.Rows[dgv_tb.Rows.Count - 1];

                dgv_dr["old_price"]  = dr["base_price"];
                dgv_dr["old_price2"] = dr["base_price2"];
                dgv_dr["old_price3"] = dr["base_price3"];

                Conv.CopyDataRow(this.editGrid1.DataSource, index, dgv_dr);
                index++;
            }

            if (!string.IsNullOrEmpty(this.editGrid1.DataSource.Rows[this.editGrid1.DataSource.Rows.Count - 1]["item_subno"].ToString()))
            {
                this.editGrid1.DataSource.Rows.Add();
            }

            this.editGrid1.Editing = false;
            this.editGrid1.Refresh();
        }
Exemplo n.º 4
0
        private void btnSelect_Click(object sender, EventArgs e)
        {
            IBLL.IInOutBLL bll        = new BLL.InOutBLL();
            var            dt         = new DataTable();
            var            supcust_no = txt_cust.Text.Trim().Split('/')[0];

            if (supcust_no != "")
            {
                dt = bll.GetSimpleSaleSheetList(DateTime.Now.AddMonths(-2), DateTime.Now, supcust_no);
            }
            frmSelect frm = new frmSelect();

            frm.dgv.AddColumn("oper_date", "操作时间", "", 100, 1, "yyyy-MM-dd");
            frm.dgv.AddColumn("sheet_no", "单号", "", 150, 1, "");
            frm.dgv.AddColumn("仓库", "仓库", "", 200, 1, "");
            frm.dgv.AddColumn("客户", "客户", "", 200, 1, "");
            frm.dgv.AddColumn("total_amount", "金额", "", 100, 3, "0.00");

            frm.Text         = "选择销售单";
            frm.tb           = dt;
            frm.is_show_left = false;

            this.txt_voucher_no.Text = frm.SelectData("单号:", "sheet_no");
        }
Exemplo n.º 5
0
        private void editGrid1_DoubleClickCell(object sender, string column_name, DataRow row, MouseEventArgs e)
        {
            if (column_name.Equals("item_subno"))
            {
                if (string.IsNullOrEmpty(this.txt_check_no.Text))
                {
                    this.txtsheet_no.Focus();
                    MsgForm.ShowFrom("请选择批次单");
                    return;
                }
                if (string.IsNullOrEmpty(this.txtbranch.Text))
                {
                    this.txtbranch.Focus();
                    MsgForm.ShowFrom("请选择仓库");
                    return;
                }


                IBLL.ICheckBLL bll     = new BLL.CheckBLL();
                var            tbgoods = bll.GetCheckItemBak(new ic_t_check_bak()
                {
                    sheet_no = this.txt_check_no.Text, branch_no = this.txtbranch.Text.Split('/')[0]
                });

                frmSelect frm = new frmSelect();
                frm.dgv.AddColumn("选择", "选择", "", 40, 2, "{0:,1:√}");
                frm.dgv.AddColumn("item_no", "商品编号", "", 110, 1, "");
                frm.dgv.AddColumn("item_subno", "货号", "", 110, 1, "");
                frm.dgv.AddColumn("barcode", "条码", "", 110, 1, "");
                frm.dgv.AddColumn("item_name", "商品名称", "", 160, 1, "");
                frm.dgv.AddColumn("item_subname", "拼音码", "", 90, 1, "");
                frm.dgv.AddColumn("unit_no", "单位", "", 60, 1, "");
                frm.dgv.AddColumn("item_size", "规格", "", 60, 1, "");
                frm.dgv.AddColumn("price", "价格", "", 100, 3, "0.00");
                frm.dgv.AddColumn("product_area", "产地", "", 150, 1, "");

                frm.Text = "选择商品";
                frm.tb   = tbgoods;

                List <DataRow> lis   = frm.SelectDataRow("货号:", "item_subno");
                int            index = 0;
                for (int i = 0; i < this.editGrid1.DataSource.Rows.Count; i++)
                {
                    if (this.editGrid1.DataSource.Rows[i] == row)
                    {
                        index = i;
                    }
                }
                if (lis.Count > 1)
                {
                    for (int i = 0; i < lis.Count - 1; i++)
                    {
                        this.editGrid1.DataSource.Rows.InsertAt(this.editGrid1.DataSource.NewRow(), index);
                    }
                }

                foreach (DataRow dr in lis)
                {
                    var dgv_tb = this.editGrid1.DataSource.Copy();
                    dgv_tb.ImportRow(dr);
                    var dgv_dr = dgv_tb.Rows[dgv_tb.Rows.Count - 1];

                    dgv_dr["real_qty"]    = dgv_dr["stock_qty"];
                    dgv_dr["item_pack"]   = "0.00";
                    dgv_dr["packqty"]     = dgv_dr["real_qty"];
                    dgv_dr["sgqty"]       = "0.00";
                    dgv_dr["sgqty"]       = "0.00";
                    dgv_dr["balance_qty"] = "0.00";
                    dgv_dr["real_amount"] = "0.00";
                    dgv_dr["in_price"]    = dr["price"];

                    Conv.CopyDataRow(this.editGrid1.DataSource, index, dgv_dr);
                    index++;
                }

                this.editGrid1.Editing = false;
                this.editGrid1.Refresh();
            }
        }