コード例 #1
0
 public DataSet SELECT_tbl_Student_Ch_Choice_Filling(mStudent_Ch_Choice_Filling_Save _obj)
 {
     try
     {
         _cn.Open();
         SqlCommand _cmd = new SqlCommand("SELECT_tbl_Student_Ch_Choice_Filling", _cn);
         _cmd.Parameters.AddWithValue("@studentid", _obj.studentid);
         _cmd.Parameters.AddWithValue("@ApplicationNo", _obj.ApplicationNo);
         _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();
     }
 }
コード例 #2
0
 public DataSet INSERT_UPDATE_tbl_Student_Ch_Choice_Filling(mStudent_Ch_Choice_Filling_Save _obj)
 {
     try
     {
         _cn.Open();
         SqlCommand _cmd = new SqlCommand("INSERT_UPDATE_tbl_Student_Ch_Choice_Filling", _cn);
         _cmd.Parameters.AddWithValue("@studentid", _obj.studentid);
         _cmd.Parameters.AddWithValue("@ApplicationNo", _obj.ApplicationNo);
         _cmd.Parameters.AddWithValue("@InstituteID", _obj.InstituteID);
         _cmd.Parameters.AddWithValue("@InstituteCourse_ID", _obj.InstituteCourse_ID);
         _cmd.Parameters.AddWithValue("@Discipline_Id", _obj.Discipline_Id);
         _cmd.Parameters.AddWithValue("@ProgramLevel_Id", _obj.ProgramLevel_Id);
         _cmd.Parameters.AddWithValue("@NatureOfCourse_Id", _obj.NatureOfCourse_Id);
         _cmd.Parameters.AddWithValue("@Branch_Course_Id", _obj.Branch_Course_Id);
         _cmd.Parameters.AddWithValue("@Stud_Ch_EC", _obj.Stud_Ch_EC);
         _cmd.Parameters.AddWithValue("@Stud_Ch_AE", _obj.Stud_Ch_AE);
         _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();
     }
 }
コード例 #3
0
        public JsonResult SelectStdCh()
        {
            mStudent_Ch_Choice_Filling_Save _obj = new mStudent_Ch_Choice_Filling_Save();
            string Code = string.Empty, Message = string.Empty;

            if (Session["ApplicationNo"] != null)
            {
                if (Session["ApplicationNo"].ToString() != "")
                {
                    _obj.ApplicationNo = Session["ApplicationNo"].ToString();
                }
            }
            _obj.studentid = Session["studentid"].ToString();
            List <mStudent_Ch_Choice_Filling_Saved_List> _list = new List <mStudent_Ch_Choice_Filling_Saved_List>();

            try
            {
                ChoiceFillingRepository _objRepository = new ChoiceFillingRepository();
                DataSet _ds = _objRepository.SELECT_tbl_Student_Ch_Choice_Filling(_obj);
                if (_ds != null)
                {
                    if (_ds.Tables[0].Rows.Count > 0)
                    {
                        foreach (DataRow _dr in _ds.Tables[0].Rows)
                        {
                            _list.Add(new mStudent_Ch_Choice_Filling_Saved_List
                            {
                                id                  = _dr["ID"].ToString(),
                                InstituteName       = _dr["InstituteName"].ToString(),
                                InstituteCourseName = _dr["Coursename"].ToString(),
                                InstituteType       = _dr["InstituteType"].ToString(),
                                Discipline          = _dr["Discipline"].ToString(),
                                ProgramLevel        = _dr["ProgramLevel"].ToString(),
                                Coursename          = _dr["Coursename"].ToString(),
                                Specialization      = _dr["Specialization"].ToString(),
                                SequenceNumber      = _dr["SequenceNumber"].ToString()
                            });
                        }
                    }
                }
            }
            catch (NullReferenceException)
            {
                Code    = "error";
                Message = "Your session has been expired. Kindly refresh and try again.";
            }
            catch (Exception)
            {
                Code    = "error";
                Message = "Error from server side. Kindly refresh and try again.";
            }
            return(Json(new
            {
                List = _list,
                c = Code,
                m = Message
            },
                        JsonRequestBehavior.AllowGet
                        ));
        }
コード例 #4
0
        public JsonResult DeleteStdCh(string id = "0")
        {
            mStudent_Ch_Choice_Filling_Save _obj = new mStudent_Ch_Choice_Filling_Save();
            string Code = string.Empty, Message = string.Empty;

            if (Session["ApplicationNo"] != null)
            {
                if (Session["ApplicationNo"].ToString() != "")
                {
                    _obj.ApplicationNo = Session["ApplicationNo"].ToString();
                }
            }
            _obj.studentid = Session["studentid"].ToString();
            List <mStudent_Ch_Choice_Filling_Saved_List> _list = new List <mStudent_Ch_Choice_Filling_Saved_List>();

            try
            {
                ChoiceFillingRepository _objRepository = new ChoiceFillingRepository();
                DataSet _ds = _objRepository.DELETE_tbl_Student_Ch_Choice_Filling(id, Session["ApplicationNo"].ToString(), Session["studentid"].ToString());
                if (_ds != null)
                {
                    if (_ds.Tables[0].Rows.Count > 0)
                    {
                        Code    = "success";
                        Message = "Choice has been deleted successfully.";
                    }
                }
            }
            catch (NullReferenceException)
            {
                Code    = "error";
                Message = "Your session has been expired. Kindly refresh and try again.";
            }
            catch (Exception)
            {
                Code    = "error";
                Message = "Error from server side. Kindly refresh and try again.";
            }
            return(Json(new
            {
                List = _list,
                c = Code,
                m = Message
            },
                        JsonRequestBehavior.AllowGet
                        ));
        }
コード例 #5
0
        public JsonResult SaveStdCh(mStudent_Ch_Choice_Filling_Save _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_Choice_Filling(_obj);
                if (_ds != null)
                {
                    if (_ds.Tables[0].Rows.Count > 0)
                    {
                        if (_ds.Tables[0].Rows[0]["msg"].ToString() == "Success")
                        {
                            Message = "Choice have been saved successfully!";
                            Code    = "success";
                        }
                        else if (_ds.Tables[0].Rows[0]["msg"].ToString() == "NotEligible")
                        {
                            Message = "You are not eligible for this course!";
                            Code    = "servererror";
                        }
                        else
                        {
                            Message = "Error from server side. Kindly refresh the page and try again.";
                            Code    = "servererror";
                        }
                    }
                    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
                        ));
        }