Exemple #1
0
 private void initBll()
 {
     BllFactory.DLLBasePath = Application.StartupPath;
     recordBll   = BllFactory.GetMemberCardRecordBll();
     catBll      = BllFactory.GetMemberCardCategoryBll();
     catValueBll = BllFactory.GetMemberCardCategoryValueBll();
     cardBll     = BllFactory.GetMemberCardBll();
     saleBll     = BllFactory.GetSaleLogBll();
 }
Exemple #2
0
        private void FrmSaleLog_Load(object sender, EventArgs e)
        {
            BllFactory.DLLBasePath = Application.StartupPath;
            bll      = BllFactory.GetReportBll();
            logBll   = BllFactory.GetSaleLogBll();
            goodsBll = BllFactory.GetGoodsBll();
            catBll   = BllFactory.GetGoodsCategoryBll();

            loadData();
        }
Exemple #3
0
        private void btnSubmit_Click(object sender, System.EventArgs e)
        {
            String msg = null;

            if (String.IsNullOrEmpty(this.txtFee.Text.Trim()))
            {
                msg = "请填写销售金额!";
            }
            else if (Convert.ToDecimal(this.txtFee.Text.Trim()) < 1)
            {
                msg = "销售金额必须大于0元!";
            }

            if (!String.IsNullOrEmpty(msg))
            {
                MessageBox.Show(msg, "保存失败", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            SaleLog log = new SaleLog();

            log.CreatedAt = TimeStamp.GetNowTimeStamp();
            log.Money     = Convert.ToDecimal(this.txtFee.Text.Trim());
            log.GoodsId   = this.goods.Id;
            log.MemberNo  = "";
            log.Summary   = String.Format("{0}出售了{1}元的{2}",
                                          DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
                                          this.txtFee.Text.Trim(),
                                          this.goods.Name);

            ISaleLogBLL logBll = BllFactory.GetSaleLogBll();

            if (!logBll.AddLog(log))
            {
                MessageBox.Show("商品销售记录失败!", "保存失败", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            callback(log.Summary);
            this.Close();
        }