// Get FeedBack from guest and save
 public bool AddFeedBack(GuestFeedBack obj)
 {
     try
     {
         connect = new Connection().Connect;
         connect.Open();
         Command = new SqlCommand("sp_Add2GuestFeedBack", connect);
         Command.CommandType = System.Data.CommandType.StoredProcedure;
         Command.Parameters.AddWithValue("@Email", obj.Email);
         Command.Parameters.AddWithValue("@FullName", obj.FullName);
         Command.Parameters.AddWithValue("@CompanyName", obj.CompanyName);
         Command.Parameters.AddWithValue("@Address", obj.Address);
         Command.Parameters.AddWithValue("@City", obj.City);
         Command.Parameters.AddWithValue("@Nation", obj.Nation);
         Command.Parameters.AddWithValue("@PhoneNumber", obj.PhoneNumber);
         Command.Parameters.AddWithValue("@PostalCode", obj.PostalCode);
         Command.Parameters.AddWithValue("@Subject", obj.Subject);
         Command.Parameters.AddWithValue("@Comment", obj.Comment);
         Command.ExecuteNonQuery();
         connect.Close();
         return true;
     }
     catch (Exception)
     {
         connect.Close();
         return false;
     }
 }
示例#2
0
 void btnSubmit_ServerClick(object sender, EventArgs e)
 {
     GuestFeedBack objGuestFeedBack = new GuestFeedBack();
     objGuestFeedBack.Email = txtEmail.Value.Trim();
     objGuestFeedBack.FullName = txtFullName.Value.Trim();
     objGuestFeedBack.CompanyName = txtCompanyName.Value.Trim();
     objGuestFeedBack.Address = txtAddress.Value.Trim();
     objGuestFeedBack.City = txtCity.Value.Trim();
     objGuestFeedBack.Nation = txtNation.Value.Trim();
     objGuestFeedBack.PhoneNumber = txtPhoneNumber.Value.Trim();
     objGuestFeedBack.PostalCode = txtPostalCode.Value.Trim();
     objGuestFeedBack.Subject = txtSubject.Value.Trim();
     objGuestFeedBack.Comment = txtAreaMessage.Value.Trim();
     if (blUserInterfaceProcess == null)
     {
         blUserInterfaceProcess = new BLUserInterfaceProcess();
     }
     bool bAddFeedBack =  blUserInterfaceProcess.AddFeedBack(objGuestFeedBack);
     if (bAddFeedBack)
     {
         Page.ClientScript.RegisterStartupScript(GetType(), "MyKey", "Notify('Your message has been sent!');", true);
     }
     else
     {
         Page.ClientScript.RegisterStartupScript(GetType(), "MyKey", "Notify('Failed. Check your connection!');", true);
     }
 }
 // Get FeedBack from guest
 public bool AddFeedBack(GuestFeedBack obj)
 {
     if (dlUserInterfaceProcess == null)
     {
         dlUserInterfaceProcess = new DLUserInterfaceProcess();
     }
     return dlUserInterfaceProcess.AddFeedBack(obj);
 }