Ejemplo n.º 1
0
        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
                        ));
        }