示例#1
0
 private void btn_clear_Click(object sender, EventArgs e)
 {
     if (new YesNoForm("确定执行清库操作吗?").ShowDialog() == System.Windows.Forms.DialogResult.Yes)
     {
         var     frm = new InputNumerForm("清库密码", 0);
         decimal pwd = 0;
         if (frm.Input(out pwd) && pwd == 8686)
         {
             try
             {
                 Cursor.Current = Cursors.WaitCursor;
                 IBLL.ISysBLL bll = new BLL.SysBLL();
                 bll.clear_db();
                 new MsgForm("清库完成,将退出系统").ShowDialog();
                 System.Environment.Exit(0);
             }
             catch (Exception ex)
             {
                 Log.writeLog("frmDownload ->btn_clear_Click()", ex.ToString(), Program.oper_id);
                 new MsgForm(ex.GetMessage()).ShowDialog();
             }
             finally
             {
                 Cursor.Current = Cursors.Default;
             }
         }
     }
 }
示例#2
0
        private void btn_change_qty_Click(object sender, EventArgs e)
        {
            var row = dataGridView1.CurrentRow;

            if (row != null && row.Tag != null && row.Tag.ToString() != "")
            {
                if (Program.oper_type != "1000")
                {
                    //new MsgForm("当前用户不属于[系统管理员]组").ShowDialog();
                    return;
                }

                InputNumerForm frm = new InputNumerForm("数量", 2);
                decimal        qty = 0;
                if (frm.Input(out qty) == true)
                {
                    if (qty <= 0)
                    {
                        new MsgForm("数量不正确").ShowDialog();
                        return;
                    }
                    else
                    {
                        int            flow_id = Conv.ToInt(row.Tag);
                        var            line    = this.lines.FirstOrDefault(d => d.flow_id == flow_id);
                        IBLL.ISaleData bll     = new BLL.SaleData();
                        bll.UpdateSaleFlowQty(line.sheet_no, flow_id, qty, Program.oper_id);
                        line.qty = qty;
                        line.amt = line.qty * line.price;
                        this.ShowLine();
                    }
                }
            }
        }
示例#3
0
        private void lbl_show_ml_Click(object sender, EventArgs e)
        {
            InputNumerForm frm = new InputNumerForm("抹零", 2);
            decimal        qty = 0;

            if (frm.Input(out qty) == true)
            {
                if (qty < 0)
                {
                    new MsgForm("金额不正确").ShowDialog();
                    return;
                }
                ml.Text = qty.ToString("0.00");

                cal_amt();
            }
        }
示例#4
0
        private void lbl_show_dz_Click(object sender, EventArgs e)
        {
            InputNumerForm frm = new InputNumerForm("折扣", 2);
            decimal        qty = 0;

            if (frm.Input(out qty) == true)
            {
                if (qty < 0 || qty > 1)
                {
                    new MsgForm("折扣不正确").ShowDialog();
                    return;
                }
                zk.Text = qty.ToString("0.00");
                //折扣变化,自动抹零也跟着变
                decimal temp_ys = Conv.ToDecimal((this.ys * Conv.ToDecimal(this.zk.Text)).ToString("F2"));
                decimal temp_ss = Conv.RemoveZero(temp_ys);
                this.ml.Text = (temp_ys - temp_ss).ToString("0.00");
                //
                cal_amt();
            }
        }
示例#5
0
        //取重、输入数量
        private void inputQty(string text)
        {
            if (supcus_no == "")
            {
                new MsgForm("未选择客户").ShowDialog();
                return;
            }
            if (currGoods != null)
            {
                if (Program.is_continue_weight == "1" && total_weight == Weight)
                {
                    new MsgForm("请先放商品,再取重").ShowDialog();
                    return;
                }
                IBLL.ISaleData       bll      = new BLL.SaleData();
                IBLL.IGoods          goodsBLL = new BLL.Goods();
                Model.bi_t_item_info gd       = currGoods;
                Model.t_order_detail item     = new Model.t_order_detail();
                item.item_no = gd.item_no;
                switch (text)
                {
                case "取重":
                    if (Program.is_continue_weight == "1" && total_weight != 0)
                    {
                        item.qty = Weight - total_weight;
                    }
                    else
                    {
                        item.qty = Weight;
                    }
                    break;

                case "手输数量":
                    if (Program.can_input_qty == "1" && currGoods.item_flag == "1")
                    {
                        new MsgForm("称重商品不可手输数量").ShowDialog();
                        return;
                    }
                    InputNumerForm frm = new InputNumerForm("数量", 3);
                    decimal        qty = 0;
                    if (frm.Input(out qty) == true)
                    {
                        if (qty <= 0)
                        {
                            new MsgForm("数量不正确").ShowDialog();
                            return;
                        }
                        item.qty = qty;
                    }
                    else
                    {
                        return;
                    }

                    break;
                }
                if (bll.CheckCusIsRetail(supcus_no))
                {
                    item.price = currGoods.base_price;//一级批发价
                }
                else
                {
                    IBLL.IClientBLL bll2 = new BLL.ClientBLL();
                    item.price = bll2.GetCusItemPrice(supcus_no, item.item_no); //在线取客户零批价
                }
                total_weight = Weight;

                item.item_subno   = gd.item_subno;
                item.item_name    = gd.item_name;
                item.unit_no      = gd.unit_no;
                item.amt          = item.qty * item.price;
                item.sheet_no     = lblsheet_no.Text;
                item.oper_id      = Program.oper_id;
                item.oper_date    = DateTime.Now;
                item.jh           = Program.jh;
                item.cost_price   = goodsBLL.GetCost(gd.item_no, Program.branch_no);
                item.branch_no    = Program.branch_no;
                item.cus_no       = supcus_no;
                item.sup_no       = supcus_no;
                item.is_give      = "0";
                item.source_price = item.price;
                item.discount     = 1;

                int flow_id = 0;
                bll.Insert(item, out flow_id);
                item.flow_id = flow_id;
                this.lines.Add(item);
                this.ShowLine();
            }
        }