public List <BackLogHistoryForOfficer> GetHistoryForOfficer(ParamForHistory objPFH) { List <BackLogHistoryForOfficer> lst = new List <BackLogHistoryForOfficer>(); using (SqlConnection con = new SqlConnection(ConStr)) { con.Open(); SqlCommand com = new SqlCommand("[dbo].[GetHistoryForOfficer]", con) { CommandType = CommandType.StoredProcedure }; com.Parameters.AddWithValue("@Formname", objPFH.Formname); com.Parameters.AddWithValue("@InspectorCode", objPFH.InspectorCode); com.Parameters.AddWithValue("@ARCSCode", objPFH.ARCSCode); SqlDataReader rdr = com.ExecuteReader(); while (rdr.Read()) { lst.Add(new BackLogHistoryForOfficer { ColumnName = rdr["ColumnName"].ToString(), OldValue = rdr["OldValue"].ToString(), NewVAlue = rdr["NewVAlue"].ToString(), SocietyTransID = rdr["SocietyTransID"].ToString(), ChangeDate = Convert.ToDateTime(rdr["ChangeDate"]), FirstName = rdr["FirstName"].ToString(), SocietyName = rdr["SocietyName"].ToString(), OldRedgNo = rdr["OldRedgNo"].ToString(), Formname = rdr["Formname"].ToString(), }); } return(lst); } }
public ActionResult BackLogHistory(FormCollection fc) { FormNamelst = GetFormNameList(); ViewBag.lstARCSCode = lstARCSCode; ViewBag.FormNamelst = FormNamelst; InsPklLst = GetInspectorList(); ViewBag.InsPklLst = InsPklLst; ParamForHistory objPFH = new ParamForHistory { ARCSCode = Convert.ToInt32(Session["ARCSCode"]), InspectorCode = Convert.ToInt16(fc.Get("InspectorCode")), Formname = fc.Get("FormNameId") }; ViewBag.BackLogHistory = objBdata.GetHistoryForOfficer(objPFH); return(View()); }