Esempio n. 1
0
        private void insertTHRK(string pay_way, decimal pay_amt)
        {
            var gd = new Model.bi_t_item_info();

            decimal amt = 0; //单据总金额

            IBLL.ICGRK bll        = new BLL.CGRK();
            var        lines_cgrk = new List <Model.ic_t_inout_store_detail>();
            int        index      = 0;

            foreach (var item in this.lines)
            {
                if (goodsDic.TryGetValue(item.item_no, out gd) == false)
                {
                    new MsgForm("商品读取错误").ShowDialog();
                    return;
                }
                ++index;
                var line_cgrk = new Model.ic_t_inout_store_detail();
                line_cgrk.sheet_no    = lblsheet_no.Text.Trim();
                line_cgrk.item_no     = item.item_no;
                line_cgrk.item_subno  = item.item_subno;
                line_cgrk.item_name   = item.item_name;
                line_cgrk.unit_no     = gd.unit_no;
                line_cgrk.in_qty      = item.qty;
                line_cgrk.orgi_price  = item.source_price;
                line_cgrk.valid_price = item.price;
                line_cgrk.cost_price  = item.price;
                line_cgrk.valid_date  = DateTime.Now;
                line_cgrk.barcode     = gd.barcode;
                line_cgrk.sheet_sort  = index;
                line_cgrk.other3      = item.is_give;
                amt += line_cgrk.valid_price * line_cgrk.in_qty;
                lines_cgrk.Add(line_cgrk);
            }

            var ord = new Model.ic_t_inout_store_master();

            ord.sheet_no     = lblsheet_no.Text.Trim();
            ord.trans_no     = "D";
            ord.branch_no    = Program.branch_no;
            ord.supcust_no   = supcus_no;
            ord.total_amount = amt;
            ord.inout_amount = pay_amt;
            ord.approve_flag = "0";
            ord.oper_date    = DateTime.Now;
            ord.oper_id      = Program.oper_id;
            ord.pay_way      = pay_way;
            //新建
            bll.InsertOrder(ord, lines_cgrk);
        }
Esempio n. 2
0
        private void newOrder(string text)
        {
            if (lines.Count != 0)
            {
                var frm = new YesNoForm("新增前是否保存本单据?");
                frm.ShowDialog();
                if (frm.DialogResult == DialogResult.Yes)
                {
                    CashPayOrder();
                }
            }
            supcus_no      = "";
            lblcussup.Text = "";
            lines.Clear();
            this.ShowLine();
            selectIndex = -1;
            currGoods   = null;
            panel1.Refresh();

            IBLL.ICGRK bll2 = new BLL.CGRK();
            lblsheet_no.Text = bll2.GetNewTHOrderCode();
        }