private List <TRAN> getTRAN() { List <TRAN> list = new List <TRAN>(); TRAN t = new TRAN(); t.TRAN_DATE = DateTime.Now; t.TRAN_AGS = "4.04"; list.Add(t); return(list); }
public void savecomplaints() { string id = string.Format("Id: {0} Uri: {1}", Guid.NewGuid(), HttpContext.Current.Request.Url); using (Utils utility = new Utils()) { utility.MethodStart(id, System.Reflection.MethodBase.GetCurrentMethod()); } SqlConnection sqlCon = new SqlConnection(ConfigurationManager.AppSettings["Connection_String"].ToString()); SqlTransaction TRAN; sqlCon.Open(); TRAN = sqlCon.BeginTransaction(); try { SqlCommand sqlCmdDelete = new SqlCommand("SP_SAVE_COMPLAINT_DOCTOR_WISE", sqlCon); sqlCmdDelete.CommandType = CommandType.StoredProcedure; sqlCmdDelete.CommandTimeout = 0; sqlCmdDelete.Transaction = TRAN; sqlCmdDelete.Parameters.AddWithValue("@SZ_DOCTOR_ID", txtDoctorId.Text); sqlCmdDelete.Parameters.AddWithValue("@SZ_COMPANY_ID", txtCompanyID.Text); sqlCmdDelete.Parameters.AddWithValue("@FLAG", "DELETE"); sqlCmdDelete.ExecuteNonQuery(); for (int i = 0; i < gv_Complaints.Rows.Count; i++) { CheckBox chk = new CheckBox(); chk = (CheckBox)gv_Complaints.Rows[i].FindControl("ChkComplaintId"); if (chk.Checked == true) { SqlCommand sqlCmd = new SqlCommand("SP_SAVE_COMPLAINT_DOCTOR_WISE", sqlCon); sqlCmd.CommandType = CommandType.StoredProcedure; sqlCmd.CommandTimeout = 0; sqlCmd.Transaction = TRAN; sqlCmd.Parameters.AddWithValue("@SZ_EVENT_ID", Convert.ToInt32(Session["AC_SYNAPTIC_EVENT_ID"].ToString())); sqlCmd.Parameters.AddWithValue("@SZ_DOCTOR_ID", txtDoctorId.Text); sqlCmd.Parameters.AddWithValue("@SZ_COMPANY_ID", txtCompanyID.Text); sqlCmd.Parameters.AddWithValue("@SZ_COMPLAINT_ID", Convert.ToInt32(gv_Complaints.DataKeys[i][0].ToString())); sqlCmd.Parameters.AddWithValue("@FLAG", "SAVE"); sqlCmd.ExecuteNonQuery(); } } TRAN.Commit(); usrMessage.PutMessage("Compaint Saved Successfully"); usrMessage.SetMessageType(UserControl_ErrorMessageControl.DisplayType.Type_UserMessage); usrMessage.Show(); //END CODE SAVE OR UPDATE TXN_COMPLAINT } catch (SqlException ex) { TRAN.Rollback(); Elmah.ErrorSignal.FromCurrentContext().Raise(ex); using (Utils utility = new Utils()) { utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod()); } string str2 = "Error Request=" + id + ".Please share with Technical support."; base.Response.Redirect("Bill_Sys_ErrorPage.aspx?ErrMsg=" + str2); } finally { if (sqlCon.State == ConnectionState.Open) { TRAN.Dispose(); sqlCon.Close(); } } //Method End using (Utils utility = new Utils()) { utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod()); } }