public List <SocietyListModel> GetApprovedSocieties(int OfficerCode) { connection.Open(); List <SocietyListModel> lstSLM = new List <SocietyListModel>(); SqlCommand cmd = new SqlCommand("[dbo].[GetApprovedSocieties]", connection) { CommandType = CommandType.StoredProcedure }; cmd.Parameters.AddWithValue("@OfficerCode", OfficerCode); var dr = cmd.ExecuteReader(); var dt = new DataTable(); if (dr.HasRows) { dt.Load(dr); if (dt.Rows.Count > 0) { foreach (DataRow r in dt.Rows) { SocietyListModel objSLM = new SocietyListModel { SocietyName = r["SocietyName"].ToString(), SocietyTransId = r["SocietyTransId"].ToString() }; lstSLM.Add(objSLM); } } } connection.Close(); return(lstSLM); }
public List <SocietyListModel> GetTotalFreezeSocietyList(int OfficerCode) { connection.Open(); List <SocietyListModel> lstSLM = new List <SocietyListModel>(); SqlCommand cmd = new SqlCommand("[dbo].[Blog_GetTotalFreezeForARCSOfficer]", connection); cmd.Parameters.AddWithValue("@OfficerCode", OfficerCode); cmd.Parameters.AddWithValue("@Role", Convert.ToInt32(HttpContext.Current.Session["RoleId"])); cmd.CommandType = CommandType.StoredProcedure; var dr = cmd.ExecuteReader(); var dt = new DataTable(); if (dr.HasRows) { dt.Load(dr); if (dt.Rows.Count > 0) { foreach (DataRow r in dt.Rows) { SocietyListModel objSLM = new SocietyListModel { SocietyName = r["SocietyName"].ToString(), SocietyTransId = r["SocietyTransId"].ToString() }; lstSLM.Add(objSLM); } } } connection.Close(); return(lstSLM); }