public void TestSaveFeedbackComments() { BloodBL bl = new BloodBL(); Feedback f = new Feedback("Appolo", "Telangana", "Hyderabad", "Not Bad"); Assert.AreEqual(1, bl.SaveFeedbackComments(f, 1)); }
protected void btnFeedback_Click(object sender, EventArgs e) { try { Feedback f = new Feedback(); f.HospitalName = ddlHospital.SelectedItem.Text; f.State = ddlState.SelectedItem.Text; f.Area = ddlArea.SelectedItem.Text; f.FeedbackComments = txtFeedback.Text; BloodBL bl = new BloodBL(); int result = bl.SaveFeedbackComments(f, int.Parse(lblUserId.Text)); if (result == 1) { Response.Write("<script>alert('Thank you for Feedback');window.location.href='HomePage.aspx';</script>"); } else { Response.Write("<script>alert('Your feedback not saved properly... provide feedback again');window.location.href='Feedback';</script>"); } } catch (Exception ex) { Response.Write("<script>alert('" + ex.Message + "');</script>"); } }