Esempio n. 1
0
        private void btnCash_Click(object sender, EventArgs e)
        {
            frmCash frm = new frmCash();

            //openWindow(frm, frm.Name);
            frm.Show();
        }
Esempio n. 2
0
        protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
        {
            switch (keyData)
            {
            case Keys.Escape:
                this.Close();
                return(true);

            case Keys.Enter:
                if (tbVipCode.Text.Trim() != "")
                {
                    Dong.BLL.MemberInfo   bMember = new Dong.BLL.MemberInfo();
                    Dong.Model.MemberInfo mMember = new Dong.Model.MemberInfo();
                    mMember = bMember.GetModel(tbVipCode.Text);
                    if (mMember == null)
                    {
                        MessageBox.Show("对不起,无此会员!");
                    }
                    else
                    {
                        tbVipName.Text = mMember.Name;
                        Dong.Model.GlobalsInfo.vipZK   = mMember.Discount;
                        Dong.Model.GlobalsInfo.vipCode = tbVipCode.Text;
                        frmCash frmP = (frmCash)this.Owner;
                        frmP.sumCash();
                    }
                }
                return(true);

            default:
                return(base.ProcessCmdKey(ref msg, keyData));
            }
        }
Esempio n. 3
0
        protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
        {
            switch (keyData)
            {
            case Keys.Escape:

                this.Close();
                return(true);

            case Keys.Enter:
                if (tbCounts.Text != "")
                {
                    frmCash frmP = (frmCash)this.Owner;
                    frmP.editCounts(int.Parse(tbCounts.Text));
                    this.Close();
                }

                return(true);

            default:
                return(base.ProcessCmdKey(ref msg, keyData));
            }
        }
Esempio n. 4
0
        protected void Cash()
        {
            if (tbZL.Text.Trim() == "")
            {
                tbZL.Text = string.Format("{0:F2}", (double.Parse(tbSSJE.Text.Trim()) - double.Parse(tbYS.Text.Trim())));
            }
            else
            {
                Dong.BLL.GoodsInfo  bGoods = new Dong.BLL.GoodsInfo();
                Dong.BLL.SaleInfo   bSale  = new Dong.BLL.SaleInfo();
                Dong.Model.SaleInfo mSale  = new Dong.Model.SaleInfo();

                frmCash      frmP = (frmCash)this.Owner;
                DataGridView dgv  = (DataGridView)frmP.Controls.Find("dGV", true)[0];
                for (int i = 0; i < dgv.Rows.Count; i++)
                {
                    //添加销售记录
                    double price = double.Parse(dgv.Rows[i].Cells[4].Value.ToString());
                    mSale.Pid       = Dong.Model.GlobalsInfo.bill;
                    mSale.GoodsCode = dgv.Rows[i].Cells[0].Value.ToString();
                    mSale.Counts    = int.Parse(dgv.Rows[i].Cells[3].Value.ToString());
                    mSale.Price     = price;
                    mSale.PriceSum  = double.Parse(tbYS.Text);
                    mSale.VipCode   = Dong.Model.GlobalsInfo.vipCode;
                    mSale.Oper      = Dong.Model.GlobalsInfo.UserName;
                    mSale.IDate     = DateTime.Now;
                    bSale.Add(mSale);

                    //减少货物质量
                    bGoods.UpdateCount(int.Parse(dgv.Rows[i].Cells[3].Value.ToString()), dgv.Rows[i].Cells[0].Value.ToString());
                }

                frmP.ClearForm();
                frmP.showPre();
                this.Close();
            }
        }