public List <CollegeDay> GetAllNextCollegeUpcoming() { List <CollegeDay> Result = new List <CollegeDay>(); try { using (SqlConnection con = new SqlConnection(conn)) { SqlCommand com = new SqlCommand("SP_GetAllNextCollegeUpcoming", con); com.CommandType = CommandType.StoredProcedure; con.Open(); SqlDataReader reader = com.ExecuteReader(); while (reader.Read()) { CollegeDay temp = new CollegeDay(); temp.ID = Convert.ToInt16(reader["NxtCollege_ID"]); temp.CollegeName = Convert.ToString(reader["NxtCollege_Name"]); temp.Event_Date = Convert.ToString(reader["NxtCollege_AddedDate"]); temp.IsUpcoming = Convert.ToBoolean(reader["IsUpcoming"]); Result.Add(temp); } con.Close(); } } catch (Exception ex) { WriteLogFile.WriteErrorLog("Error.txt", ex.Message); } return(Result); }
public JsonResult UpdateCollegeDetails(CollegeDay Data) { ResultInfo <string> ResultInfo = new ResultInfo <string>() { Status = false, Description = "Failed|Login" }; try { if (Data != null) { User_Backend Obj = new User_Backend(); ResultInfo.Info = Obj.UpdateCollegeDetails(Data); if (ResultInfo.Info != null) { ResultInfo.Description = "Success| Update Sucess "; ResultInfo.Status = true; } } } catch (Exception ex) { } return(Json(ResultInfo, JsonRequestBehavior.AllowGet)); }
public CollegeDay GetCollegeEventDetailsByID(long id) { CollegeDay Result = new CollegeDay(); try { using (SqlConnection con = new SqlConnection(conn)) { SqlCommand com = new SqlCommand("SP_GetCollegeEventDetails", con); com.Parameters.AddWithValue("@id", id); com.CommandType = CommandType.StoredProcedure; con.Open(); SqlDataReader reader = com.ExecuteReader(); while (reader.Read()) { Result.ID = Convert.ToInt16(reader["NxtCollege_ID"]); Result.video = Convert.ToString(reader["NxtCollege_Video"]); Result.CollegeName = Convert.ToString(reader["NxtCollege_Name"]); Result.EventDate = Convert.ToDateTime(reader["NxtCollege_AddedDate"]); break; } con.Close(); } } catch (Exception ex) { WriteLogFile.WriteErrorLog("Error.txt", ex.Message); } return(Result); }