public DataSet Check_Declarations(StudentDeclaration _obj)
 {
     try
     {
         _cn.Open();
         SqlCommand _cmd = new SqlCommand("Check_Declarations", _cn);
         _cmd.Parameters.AddWithValue("@studentid", _obj.studentid);
         _cmd.CommandType    = CommandType.StoredProcedure;
         _cmd.CommandTimeout = 300;
         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 CheckDeclarations()
        {
            string FLAG_PROFILE    = "";
            string FLAG_ACADEMIC   = "";
            string FLAG_DOC        = "";
            string FLAG_BACKGROUND = "";

            try
            {
                DeclarationRepository _objRepository = new DeclarationRepository();
                StudentDeclaration    _obj           = new StudentDeclaration();
                _obj.studentid = Session["studentid"].ToString();
                DataSet ds = _objRepository.Check_Declarations(_obj);
                if (ds != null)
                {
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        FLAG_PROFILE    = ds.Tables[0].Rows[0]["FLAG_PROFILE"].ToString();
                        FLAG_ACADEMIC   = ds.Tables[0].Rows[0]["FLAG_ACADEMIC"].ToString();
                        FLAG_DOC        = ds.Tables[0].Rows[0]["FLAG_DOC"].ToString();
                        FLAG_BACKGROUND = ds.Tables[0].Rows[0]["FLAG_BACKGROUND"].ToString();
                    }
                }
            }
            catch (Exception)
            {
                throw;
            }

            return(Json(new
            {
                FLAG_PROFILE = FLAG_PROFILE,
                FLAG_ACADEMIC = FLAG_ACADEMIC,
                FLAG_DOC = FLAG_DOC,
                FLAG_BACKGROUND = FLAG_BACKGROUND
            },
                        JsonRequestBehavior.AllowGet
                        ));
        }