예제 #1
0
        public MoneyPayModel CaculatePaymentStepCustomerGive(float moneyCustomerGive)
        {
            MoneyPayModel moneyDetailPayment = new MoneyPayModel()
            {
                MoneyCustomer = moneyCustomerGive
            };

            return(moneyDetailPayment);
        }
예제 #2
0
 public PaymentViewModel(float totalPay)
 {
     _MoneyModel = new MoneyPayModel()
     {
         TotalPay            = totalPay,
         MoneyCustomerGive   = 0,
         MoneyReturnCustomer = 0
     };
 }
예제 #3
0
        public bool WriteToBill(Order orderInfo, int user_id, MoneyPayModel moneyPay, CustomerModel cus, string type, string billId)
        {
            string query = $"INSERT INTO ires.BILL (BILL_CODE, ORDER_ID, ORDER_TOTAL_PRICE, CUSTOMER_ID, EMPLOYEE_ID, PAYMENT, TIP, PROMOTION_ID, PROMOTION_COST, CREATED_DATETIME, " +
                           $"UPDATED_BY, CUSTOMER_NAME, PERSON_QUANTITY) values('{billId}' , {orderInfo.Id}, {moneyPay.TotalPay}, {cus.ID}, " +
                           $"{user_id}, {moneyPay.MoneyCustomer}, {moneyPay.MoneyCustomerTip + moneyPay.MoneyCustomerGive}, null, 0, '{DateTime.Now}', {user_id}, '{cus.Name}'," +
                           $" {orderInfo.PersonQuantity})";

            WorkerToDB billToDB = new WorkerToDB();

            return(billToDB.insertCommand(query));
        }
예제 #4
0
 public bool FinishPayment(Order orderInfo, int user_id, int table_id, MoneyPayModel moneyPay, CustomerModel cus, string type, string billId)
 {
     if (WriteToBill(orderInfo, user_id, moneyPay, cus, type, billId) && UpdateOrder(orderInfo.Id, user_id) &&
         UpdateBookingTable(orderInfo.Id) && UpdateTableList(orderInfo.Id))
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
예제 #5
0
        public Boolean FinishPayment(Order orderInfo, int table_id, CustomerModel cus, MoneyPayModel money, string type, string billId)
        {
            int user_id = 1;
            PaymentImplement paymentImp = new PaymentImplement();

            if (paymentImp.FinishPayment(orderInfo, user_id, table_id, money, cus, type, billId))
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }