コード例 #1
0
        public JsonResult GetRequestCategory()
        {
            string LoginUser = (string)Session["LoginSAPID"];

            try
            {
                string userkey = ConfigurationManager.AppSettings["userkey"];
                string uid     = ConfigurationManager.AppSettings["uid"];
                string ROLE_ID = (string)Session["ROLE_ID"];

                Employer.Employer employer = new Employer.Employer();
                DataTable         dt       = employer.FetchRequestCategories(ROLE_ID, userkey, uid);
                dt.TableName = "Fetchrequestcategory";
                dt.Columns.ToString();
                var requestCategory = (from DataRow dr in dt.Rows
                                       select new
                {
                    ID = dr["ID"].ToString(),
                    Descr = dr["Descr"].ToString(),
                    Mail = dr["Mail"].ToString(),
                    Dynamictext = dr["dynamictext"].ToString(),
                    Dynamicurl = dr["dynamicurls"].ToString(),
                    IsAES = dr["IsAES"].ToString()
                }).ToList();

                return(Json(new { data = requestCategory }, JsonRequestBehavior.AllowGet));
            }
            catch (Exception ex)
            {
                LogError logerror = new LogError();
                logerror.ErrorLog("", LoginUser, "", "Requests/GetRequestCategory", "Requests", "GetRequestCategory", "FetchRequestCategories Error", ex.Message.ToString(), 0);
                return(Json(new { data = "Error has occured" }, JsonRequestBehavior.AllowGet));
            }
        }