Exemplo n.º 1
0
        private void CalcCash()
        {
            //计算当日的销售情况

            DataSet ds = new DataSet();

            Dong.BLL.SaleInfo bSaleInfo = new Dong.BLL.SaleInfo();
            ds = bSaleInfo.getToday(Dong.Model.GlobalsInfo.UserName);
            gvList.DataSource = ds.Tables[0];
            if (gvList.Rows.Count > 0)
            {
                double cash = 0;
                int    c    = 0;
                for (int i = 0; i < gvList.Rows.Count; i++)
                {
                    double price = double.Parse(gvList.Rows[i].Cells[2].Value.ToString());
                    cash = cash + price;
                    int c1 = int.Parse(gvList.Rows[i].Cells[1].Value.ToString());
                    c = c + c1;
                }
                lblBCounts.Text = (gvList.Rows.Count - 1).ToString();
                lblGCounts.Text = c.ToString();
                lblPrice.Text   = string.Format("{0:F2}", cash);
            }
        }
Exemplo n.º 2
0
        public frmReportMonth()
        {
            InitializeComponent();
            Dong.BLL.SaleInfo bll = new Dong.BLL.SaleInfo();
            var dateyears         = bll.GetAllDateYearList();

            cbYear.DataSource = dateyears;
        }
Exemplo n.º 3
0
 public void showPre()
 {
     Dong.BLL.SaleInfo   bSaleInfo = new Dong.BLL.SaleInfo();
     Dong.Model.SaleInfo mSaleInfo = new Dong.Model.SaleInfo();
     mSaleInfo           = bSaleInfo.GetPreModel(Dong.Model.GlobalsInfo.UserName);
     lblPreBillNo.Text   = mSaleInfo.Pid;
     lblPreBillCash.Text = string.Format("{0:F2}", mSaleInfo.Price.ToString());
     lblPreTime.Text     = mSaleInfo.IDate.ToString();
 }
Exemplo n.º 4
0
        private void fillGVList(string key, int pageSize, int page)
        {
            strSql  = key;
            intPage = page;
            Dong.BLL.SaleInfo bll = new Dong.BLL.SaleInfo();
            DataSet           ds  = new DataSet();

            ds = bll.GetListPage(key, pageSize, page);

            gvList.DataSource = ds.Tables[0];
            if (ds.Tables[0].Rows.Count > 0)
            {
                intPages();
            }
            else
            {
                MessageBoxEx.Show("对不起,没有您搜索的记录!");
            }
        }
Exemplo n.º 5
0
        private void fillGVList(string key)
        {
            Dong.BLL.SaleInfo bll = new Dong.BLL.SaleInfo();
            DataTable         dt  = new DataTable();

            dt = bll.getMonthRePort(key);
            gvList.DataSource = dt;
            int    count = 0;
            double price = 0;
            double gain  = 0;

            foreach (DataRow dr in dt.Rows)
            {
                count += int.Parse(dr[0].ToString());
                price += double.Parse(dr[1].ToString());
                gain  += double.Parse(dr[2].ToString());
            }
            lblCount.Text = count.ToString();
            lblXSZE.Text  = price.ToString();
            lblGain.Text  = gain.ToString();
        }
Exemplo n.º 6
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();
            }
        }