コード例 #1
0
ファイル: BillInfoService.cs プロジェクト: JimDeng/WenJiaPC
 public void AddBillInfo(BillInfo bill)
 {
     try
     {
         string sql = "INSERT INTO `billinfo`(`billKey`,`tabName`,`billMoney`,`paymethod`,`SHmoney`,`SHcash`,`SHvesa`,`SHcard`,`status`,`billtime`,`checktime`,`checkUsername`,`custCount`,`printCount`,`mark`,`vipno`,`cardid`,`discount`,`jiaocai`,`preMoney`,`disMoney`)VALUES (@billKey,@tabName,@billMoney,@paymethod,@SHmoney,@SHcash,@SHvesa,@SHcard,@status,@billtime,@checktime,@checkUsername,@custCount,@printCount,@mark,@vipno,@cardid,@discount,@jiaocai,@preMoney,0.0)";
         DbUtil.ExecuteNonQuery(sql,
             new MySqlParameter("@billKey", bill.billKey),
             new MySqlParameter("@tabName", bill.tabName),
             new MySqlParameter("@billMoney", bill.billMoney),
             new MySqlParameter("@paymethod", bill.paymethod),
             new MySqlParameter("@SHmoney", bill.SHmoney),
             new MySqlParameter("@SHcash", bill.SHcash),
             new MySqlParameter("@SHvesa", bill.SHvesa),
             new MySqlParameter("@SHcard", bill.SHcard),
             new MySqlParameter("@status", bill.status),
             new MySqlParameter("@billtime", bill.billtime),
             new MySqlParameter("@checktime", bill.checktime),
             new MySqlParameter("@checkUsername", bill.checkUsername),
             new MySqlParameter("@custCount", bill.custCount),
             new MySqlParameter("@printCount", bill.printCount),
             new MySqlParameter("@mark", bill.mark),
             new MySqlParameter("@vipno", bill.vipNo),
             new MySqlParameter("@cardid", bill.cardId),
             new MySqlParameter("@discount", bill.discount),
             new MySqlParameter("@jiaocai", bill.jiaocai),
             new MySqlParameter("@preMoney", bill.preMoney));
     }
     catch (Exception ex)
     {
         throw new Exception("新增账单错误"+ex.Message);
     }
 }
コード例 #2
0
ファイル: CheckoutPrinter.cs プロジェクト: JimDeng/WenJiaPC
        public CheckoutPrinter(BillInfo billInfo, int type, List<BillDetailInfo> detailInfos)
        {
            PrintUtils.SetDefaultPrint(PrintUtils.GetConsumePrintName());

            this.bInfo = billInfo;
            this.type = type;
            this.detailInfos = detailInfos;
            pdDocument = new PrintDocument();
            pdDocument.PrintController = new StandardPrintController();
            pdDocument.PrintPage += new PrintPageEventHandler(pdDocument_PrintPage);
        }
コード例 #3
0
        public KitchenBillPrinter(BillInfo billInfo, string printType, List<BillDetailInfo> billDetailInfos)
        {
            this.binfo = billInfo;
            this.printType = printType;
            this.billDetailInfos = billDetailInfos;

            PrintUtils.SetDefaultPrint( PrintUtils.GetKitchenPrintName());

            pdDocument = new PrintDocument();
            pdDocument.PrintController = new StandardPrintController();
            pdDocument.PrintPage += new PrintPageEventHandler(pdDocument_PrintPage);
        }
コード例 #4
0
ファイル: BillInfoService.cs プロジェクト: JimDeng/WenJiaPC
        private BillInfo ToBillInfo(DataRow row)
        {
            BillInfo bill = new BillInfo();
            bill.billid = (int)row["billid"];
            bill.billKey = (string)row["billKey"];
            bill.billMoney = (float)row["billMoney"];
            bill.billtime = (string)row["billtime"];
            bill.cardId = (string)row["cardid"];
            bill.checktime = (string)row["checktime"];
            bill.checkUsername = (string)row["checkUsername"];
            bill.custCount = (int)row["custCount"];
            bill.discount = (string)row["discount"];
            bill.jiaocai = (string)row["jiaocai"];
            bill.mark = (string)row["mark"];
            bill.paymethod = (string)row["paymethod"];
            bill.printCount = (int)row["printCount"];
            bill.SHcard = (float)row["SHcard"];
            bill.SHcash = (float)row["SHcash"];
            bill.SHmoney = (float)row["SHmoney"];
            bill.disMoney = (float)row["disMoney"];
            bill.preMoney = (float)row["preMoney"];
            bill.SHvesa = (float)row["SHvesa"];
            bill.status = (int)row["status"];
            bill.tabName = (string)row["tabName"];
            bill.vipNo = (string)row["vipno"];

            //bill.zl = (int)row["zl"];
            return bill;
        }
コード例 #5
0
ファイル: BillInfoService.cs プロジェクト: JimDeng/WenJiaPC
 public void UpdateBillInfo(BillInfo bill)
 {
     try
     {
         string sql = "UPDATE `billinfo` SET `tabName` = @tabName,`billMoney` = @billMoney,`paymethod` = @paymethod,`SHmoney` = @SHmoney,`SHcash` = @SHcash,`SHvesa` = @SHvesa,`SHcard` = @SHcard,`status` = @status,`billtime` = @billtime,`checktime`=@checktime,`checkUsername` = @checkUsername,`custCount`=@custCount,`printCount`=@printCount,`mark`=@mark,`vipno`=@vipno,`cardid`=@cardid,`discount`=@discount,`jiaocai`=@jiaocai,`preMoney` = @preMoney,`disMoney` = @disMoney WHERE `billkey` = @billkey";
         DbUtil.ExecuteNonQuery(sql,
             new MySqlParameter("@billKey", bill.billKey),
             new MySqlParameter("@tabName", bill.tabName),
             new MySqlParameter("@billMoney", bill.billMoney),
             new MySqlParameter("@paymethod", bill.paymethod),
             new MySqlParameter("@SHmoney", bill.SHmoney),
             new MySqlParameter("@SHcash", bill.SHcash),
             new MySqlParameter("@SHvesa", bill.SHvesa),
             new MySqlParameter("@SHcard", bill.SHcard),
             new MySqlParameter("@status", bill.status),
             new MySqlParameter("@billtime", bill.billtime),
             new MySqlParameter("@checktime", bill.checktime),
             new MySqlParameter("@checkUsername", bill.checkUsername),
             new MySqlParameter("@custCount", bill.custCount),
             new MySqlParameter("@printCount", bill.printCount),
             new MySqlParameter("@mark", bill.mark),
             new MySqlParameter("@vipno", bill.vipNo),
             new MySqlParameter("@cardid", bill.cardId),
             new MySqlParameter("@discount", bill.discount),
             new MySqlParameter("@jiaocai", bill.jiaocai),
             new MySqlParameter("@preMoney", bill.preMoney),
             new MySqlParameter("@disMoney", bill.disMoney));
     }
     catch (Exception ex)
     {
         throw new Exception("修改账单错误" + ex.Message);
     }
 }
コード例 #6
0
ファイル: FormOpen.cs プロジェクト: JimDeng/WenJiaPC
        private void OpenTab()
        {
            string billkey = CommService.GetBillkey();
            BillInfo bill = new BillInfo();
            bill.billKey = billkey;
            bill.billMoney = 0.0f;
            bill.billtime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            bill.cardId = "";
            bill.cardSeriaId = "";
            bill.checktime = "";
            bill.checkUsername = "";
            bill.custCount = (int)nuCustCount.Value;
            bill.discount = "无";
            bill.jiaocai = "";
            bill.mark = "";
            bill.paymethod = "";
            bill.printCount = 0;
            bill.SHcard = 0.0f;
            bill.SHcash = 0.0f;
            bill.SHmoney = 0.0f;
            bill.SHvesa = 0.0f;
            bill.status = 0;
            bill.tabName = lbTabName.Text.Trim();
            bill.vipNo = "";
            bill.zl = 0;
            bill.preMoney = 0.0f;
            BillInfoService service = new BillInfoService();
            try
            {
                service.AddBillInfo(bill);
                TabInfoService.UpdateTabInfoForOpen(tabName);

            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }