public DataSet INSERT_UPDATE_tbl_Student_Ch_SelectProgramLevel(mStudent_Ch_Basic _obj) { try { _cn.Open(); SqlCommand _cmd = new SqlCommand("INSERT_UPDATE_tbl_Student_Ch_SelectProgramLevel", _cn); _cmd.Parameters.AddWithValue("@studentid", _obj.studentid); _cmd.Parameters.AddWithValue("@ApplicationNo", _obj.ApplicationNo); _cmd.Parameters.AddWithValue("@SelectedProgramLevel", _obj.SelectedProgramLevel); _cmd.Parameters.AddWithValue("@ModifiedIP", _obj.CreatedIP); _cmd.CommandType = CommandType.StoredProcedure; SqlDataAdapter _adp = new SqlDataAdapter(_cmd); DataSet _ds = new DataSet(); _adp.Fill(_ds); _adp.Dispose(); _cmd.Dispose(); return(_ds); } catch (Exception) { throw; } finally { _cn.Close(); } }
public DataSet RESET_tbl_Student_Ch_Choice_Filling(mStudent_Ch_Basic _obj) { try { _cn.Open(); SqlCommand _cmd = new SqlCommand("RESET_tbl_Student_Ch_Choice_Filling", _cn); _cmd.Parameters.AddWithValue("@studentid", _obj.studentid); _cmd.Parameters.AddWithValue("@ApplicationNo", _obj.ApplicationNo); _cmd.Parameters.AddWithValue("@CreatedIP", _obj.CreatedIP); _cmd.CommandType = CommandType.StoredProcedure; SqlDataAdapter _adp = new SqlDataAdapter(_cmd); DataSet _ds = new DataSet(); _adp.Fill(_ds); _adp.Dispose(); _cmd.Dispose(); return(_ds); } catch (Exception) { throw; } finally { _cn.Close(); } }
public JsonResult CheckBasic(mStudent_Ch_Basic _obj) { string Message = string.Empty, Code = string.Empty; try { ChoiceFillingRepository _objRepository = new ChoiceFillingRepository(); string localIP = "?"; localIP = Request.ServerVariables["REMOTE_ADDR"].ToString(); _obj.CreatedIP = localIP; if (Session["ApplicationNo"] != null) { if (Session["ApplicationNo"].ToString() != "") { _obj.ApplicationNo = Session["ApplicationNo"].ToString(); } } _obj.studentid = Session["studentid"].ToString(); DataSet _ds = _objRepository.CHECK_tbl_Student_Ch_Basic(_obj); if (_ds != null) { if (_ds.Tables[0].Rows.Count > 0) { DataRow _dr = _ds.Tables[0].Rows[0]; if (_dr["EC_FLAG"].ToString().ToLower() == "true" && _dr["AE_FLAG"].ToString().ToLower() == "true") { Message = "Details has been saved successfully!"; Code = "success"; } else { Message = "Any change will reset your filled course choices. More course choice might be available. Do you want to proceed?"; Code = "changes"; } } else { Message = "Error from server side. Kindly refresh the page and try again."; Code = "servererror"; } } } catch (System.Exception) { throw; } return(Json(new { m = Message, c = Code }, JsonRequestBehavior.AllowGet )); }
public JsonResult SaveProgramLevel(mStudent_Ch_Basic _obj) { string Message = string.Empty, Code = string.Empty; try { ChoiceFillingRepository _objRepository = new ChoiceFillingRepository(); string localIP = "?"; localIP = Request.ServerVariables["REMOTE_ADDR"].ToString(); _obj.CreatedIP = localIP; if (Session["ApplicationNo"] != null) { if (Session["ApplicationNo"].ToString() != "") { _obj.ApplicationNo = Session["ApplicationNo"].ToString(); } } _obj.studentid = Session["studentid"].ToString(); DataSet _ds = _objRepository.INSERT_UPDATE_tbl_Student_Ch_SelectProgramLevel(_obj); if (_ds != null) { if (_ds.Tables[0].Rows.Count > 0) { Message = "Program Level(s) have been saved successfully!"; Code = "success"; } else { Message = "Error from server side. Kindly refresh the page and try again."; Code = "servererror"; } } } catch (NullReferenceException) { Message = "Your session has been expired. Kindly login again."; Code = "sessionexpired"; } catch (Exception) { Message = "Error from server side. Kindly refresh the page and try again."; Code = "servererror"; } return(Json(new { m = Message, c = Code }, JsonRequestBehavior.AllowGet )); }
public JsonResult ResetChoiceFilling(mStudent_Ch_Basic _obj) { string Message = string.Empty, Code = string.Empty; try { ChoiceFillingRepository _objRepository = new ChoiceFillingRepository(); string localIP = "?"; localIP = Request.ServerVariables["REMOTE_ADDR"].ToString(); _obj.CreatedIP = localIP; if (Session["ApplicationNo"] != null) { if (Session["ApplicationNo"].ToString() != "") { _obj.ApplicationNo = Session["ApplicationNo"].ToString(); } } _obj.studentid = Session["studentid"].ToString(); DataSet _ds = _objRepository.RESET_tbl_Student_Ch_Choice_Filling(_obj); if (_ds != null) { if (_ds.Tables[0].Rows.Count > 0) { Message = "Reset succcessfully!"; Code = "success"; } else { Message = "Error from server side. Kindly refresh the page and try again."; Code = "servererror"; } } } catch (System.Exception) { throw; } return(Json(new { m = Message, c = Code }, JsonRequestBehavior.AllowGet )); }
public JsonResult SaveBasic(mStudent_Ch_Basic _obj) { //bool flag = false; string Message = string.Empty, Code = string.Empty; try { ChoiceFillingRepository _objRepository = new ChoiceFillingRepository(); string localIP = "?"; localIP = Request.ServerVariables["REMOTE_ADDR"].ToString(); _obj.CreatedIP = localIP; if (Session["ApplicationNo"] != null) { if (Session["ApplicationNo"].ToString() != "") { _obj.ApplicationNo = Session["ApplicationNo"].ToString(); } } DataTable _dt = DeserializeJsonToDataTable(_obj.EduQualifications); bool flag = true; if (_dt != null) { string[] EQIDs = new string[10]; int index = 0; foreach (DataRow _dr in _dt.Rows) { EQIDs[index++] = _dr["EQID"].ToString(); } foreach (DataRow _dr in _dt.Rows) { if (_dr["EQD"].ToString() != "") { var a1 = _dr["EQD"].ToString().Split(','); foreach (string str1 in a1) { var a2 = str1.Split('|'); bool flag2 = false; foreach (string str2 in a2) { if (EQIDs.Contains(str2)) { flag2 = true; } } if (!flag2) { flag = false; } } } } } if (flag) { _obj.studentid = Session["studentid"].ToString(); DataSet _ds = _objRepository.INSERT_UPDATE_tbl_Student_Ch_Basic(_obj); if (_ds != null) { if (_ds.Tables[0].Rows.Count > 0) { Session["ApplicationNo"] = _ds.Tables[0].Rows[0]["ApplicationNo"].ToString(); Message = "Details has been saved successfully!"; Code = "success"; //flag = true; } else { Message = "Error from server side. Kindly refresh the page and try again.!"; Code = "servererror"; } } } else { Message = "Kinldy add all relevant qualification's score first."; Code = "servererror"; } } catch (NullReferenceException) { Message = "Your session has been expired. Kindly login again."; Code = "sessionexpired"; } catch (Exception) { Message = "Error from server side. Kindly refresh the page and try again.!!"; Code = "servererror"; } return(Json(new { m = Message, c = Code }, JsonRequestBehavior.AllowGet )); }