public JsonResult Save_KeyStatistics(KeyStatistics _obj) { bool flag = false; try { KeyStatisticsRepository _objKeyStatistics = new KeyStatisticsRepository(); string localIP = "?"; localIP = Request.ServerVariables["REMOTE_ADDR"].ToString(); _obj.CreatedIP = localIP; _obj.InstituteID = Session["InstituteID"].ToString(); _obj.Edited_by = Session["User_id"].ToString(); DataSet _ds = _objKeyStatistics.KeyStatistics_Insert(_obj); if (_ds != null) { if (_ds.Tables[0].Rows.Count > 0) { if (_ds.Tables[0].Rows[0]["FLAG"].ToString() == "1") { flag = true; } } } } catch (System.Exception) { throw; } return(Json(new { flag = flag }, JsonRequestBehavior.AllowGet )); }
public JsonResult Select_KeyStatistics(string ID) { KeyStatisticsRepository _objKeyStatistics = new KeyStatisticsRepository(); DataSet ds = _objKeyStatistics.KeyStatistics_Select(ID, Session["InstituteID"].ToString()); List <KeyStatistics> _list = new List <KeyStatistics>(); if (ds != null) { if (ds.Tables[0].Rows.Count > 0) { foreach (DataRow row in ds.Tables[0].Rows) { KeyStatistics _ObjModel = new KeyStatistics(); _ObjModel.ID = row["ID"].ToString(); _ObjModel.InstituteID = row["InstituteID"].ToString(); _ObjModel.NoOfStudentDegreeAward = row["NoOfStudentDegreeAward"].ToString(); _ObjModel.NoOfStudentStrength = row["NoOfStudentStrength"].ToString(); _ObjModel.NoOfInterStudentIntake = row["NoOfInterStudentIntake"].ToString(); _ObjModel.NoOfResearch = row["NoOfResearch"].ToString(); _ObjModel.NoOfPatents = row["NoOfPatents"].ToString(); _ObjModel.NoOfFullTimeStafStrength = row["NoOfFullTimeStafStrength"].ToString(); _ObjModel.NoOfPartTimeStafStrength = row["NoOfPartTimeStafStrength"].ToString(); //_ObjModel.CreatedIP = row["CreatedIP"].ToString(); _list.Add(_ObjModel); } } } return(Json(new { List = _list }, JsonRequestBehavior.AllowGet )); }