public bool SaveCustomerBillInformation(CustomerBillInformation aBillInformation)
        {
            string query = "INSERT INTO BillInformation VALUES('" + aBillInformation.BillNumber +
                           "','" + aBillInformation.BillStatus + "'," + aBillInformation.DueDate + ",'"
                           + aBillInformation.CustomerMobileNumber + "'," + aBillInformation.TotalBillAmount + ");";

            Command.CommandText = query;
            Connection.Open();
            var rowsAffected = Command.ExecuteNonQuery();

            Connection.Close();
            return(rowsAffected > 0);
        }
        public void SaveTotalBillAmount()
        {
            Random aRandom = new Random();
            CustomerBillInformation aBillInformation = new CustomerBillInformation();

            aBillInformation.BillNumber = string.Format("#" + DateTime.Now.ToString() +
                                                        "BILL_{0}", aRandom.Next(100, 10000));
            aBillInformation.BillStatus           = "Unpaid";
            aBillInformation.TotalBillAmount      = Convert.ToDouble(totalTextBox.Text);
            aBillInformation.DueDate              = "GetDate()";
            aBillInformation.CustomerMobileNumber = mobileNumberTextBox.Text;
            entrySaveMessageLabel.Text            = _aTestReuestManager.SaveCustomerBillInformation(aBillInformation);
            GeneratePdf();
        }
Exemplo n.º 3
0
 public string SaveCustomerBillInformation(CustomerBillInformation aBillInformation)
 {
     return(_aTestRequestGateway.SaveCustomerBillInformation(aBillInformation)?
            "Saved BillInformation":"Save Failed BillInformation");
 }