Ejemplo n.º 1
0
        private bool AddPayment(DateTime TimeNow, Booking book)
        {
            bool rs = false;

            try
            {
                //string was not reconize as a datetime???
                float fullcost = CalcuDays(DateTime.Parse(txtCheckIn.Text), DateTime.Parse(txtCheckOut.Text), book.Breakfirst, book.Nights);
                // MessageBox.Show("Full cost để add được vào payment mới là: " + fullcost);
                Payment pay = new Payment()
                {
                    Amount     = fullcost,
                    Cancelled  = false,
                    Paid       = fullcost * 0.3f,
                    BookingID  = book.BookingID,
                    CustomerID = txtCusID.Text
                };
                rs = ManagerDAL.AddNewPayment(pay);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            return(rs);
        }