Пример #1
0
        public virtual JsonResult UpdateModule(FormCollection frm)
        {
            string         sPath        = Request.QueryString["path"];
            clsRequestInfo oRequestInfo = getRequestPathInfo(sPath);

            var cmd = new clsCmd();

            webUtil.addParamFromPost(cmd, frm);


            if (!sPath.isEmpty())
            {
                try
                {
                    var result = getTier(oRequestInfo.appName).exec(oRequestInfo.Path, cmd);
                    return(Json(new { msg = result.Message, data = result.Obj }, JsonRequestBehavior.AllowGet));
                }
                catch (Exception ex)
                {
                    return(Json(new { msg = ex.Message, data = "" }, JsonRequestBehavior.AllowGet));
                }
            }
            else
            {
                object n = null;
                return(Json(new { msg = "You have not specified [Module Name] and OperationName", data = n }, JsonRequestBehavior.AllowGet));
            }
        }
Пример #2
0
        public ContentResult getdataAll(FormCollection frm)
        {
            var cmd = new clsCmd();

            webUtil.addParamFromPost(cmd, frm);

            string         spath        = Request.QueryString["path"];
            clsRequestInfo oRequestInfo = getRequestPathInfo(spath);

            DataTable t = null;
            clsMsg    result;

            if (oRequestInfo.Path.StartsWith("drp\\"))
            {
                result = getTier(oRequestInfo.appName).getDropDownData(oRequestInfo.Path.Substring(4), cmd);
            }
            else
            {
                result = getTier(oRequestInfo.appName).getData(oRequestInfo.Path, cmd);
            }


            t = result.Obj as DataTable;
            return(Content(Newtonsoft.Json.JsonConvert.SerializeObject(t), "application/json"));
        }
Пример #3
0
        public ContentResult getdataPaging(FormCollection frm)
        {
            var cmd = new clsCmd();

            webUtil.addParamFromPost(cmd, frm);
            string sPath = Request.QueryString["path"];

            clsRequestInfo oRequestInfo = getRequestPathInfo(sPath);

            string sSortType = cmd.getStringValue("$sort");

            if (cmd.ContainFields("$sort"))
            {
                cmd.Remove(cmd["$sort"]);
            }

            var result = getTier(oRequestInfo.appName).getData(oRequestInfo.Path, cmd);

            if (result.Validated)
            {
                //var t = _tier.getData(sPath, cmd).Obj as DataTable;
                DataTable t       = result.Obj as DataTable;
                var       tPaging = g.getJsonPaging(t, sSortType, start, length);
                return(Content(Newtonsoft.Json.JsonConvert.SerializeObject(tPaging), "application/json"));
            }
            else
            {
                var res = new { draw = draw, recordsTotal = 0, recordsFiltered = 0, data = "", error = true, error_msg = result.Message };
                return(Content(Newtonsoft.Json.JsonConvert.SerializeObject(res), "application/json"));
            }
        }
Пример #4
0
        public clsMsg exec(string sPath, clsCmd cmd)
        {
            clsRequestInfo oRequestInfo = getRequestPathInfo(sPath);

            return(getTier(oRequestInfo.appName).exec(oRequestInfo.Path, cmd));
        }
Пример #5
0
        private clsRequestInfo getRequestPathInfo(string sPath)
        {
            var oRequestPathInfo = new clsRequestInfo(AppName, sPath);

            return(oRequestPathInfo);
        }
Пример #6
0
        public CRUD.clsCRUD getCRUD(string sCRUDName)
        {
            clsRequestInfo oRequestInfo = getRequestPathInfo(sCRUDName);

            return(getTier(oRequestInfo.appName).getCRUD(oRequestInfo.Path));
        }
Пример #7
0
        public clsMsg getDropDownData(string sPath, clsCmd cmd)
        {
            clsRequestInfo oRequestInfo = getRequestPathInfo(sPath);

            return(getTier(oRequestInfo.appName).getDropDownData(oRequestInfo.Path, cmd));
        }
Пример #8
0
        private clsRequestInfo getRequestPathInfo(string sPath)
        {
            var oRequestPathInfo = new clsRequestInfo(_sMainApp, sPath);

            return(oRequestPathInfo);
        }
Пример #9
0
        public clsMsg getFileContent(string sPath, clsCmd cmd)
        {
            clsRequestInfo oRequestInfo = getRequestPathInfo(sPath);

            return(getTier(oRequestInfo.appName).getFileContent(oRequestInfo.Path, cmd));
        }
Пример #10
0
        public string getPath(string sPath)
        {
            clsRequestInfo oRequestInfo = getRequestPathInfo(sPath);

            return(getTier(oRequestInfo.appName).getPath(oRequestInfo.Path));
        }
Пример #11
0
        public sqlReport.SQLReportBase getSQLReport(string sPath, clsCmd cmd)
        {
            clsRequestInfo oRequestInfo = getRequestPathInfo(sPath);

            return(getTier(oRequestInfo.appName).getSQLReport(oRequestInfo.Path, cmd));
        }
Пример #12
0
        public adapter.clsDataAdapterBase getAdapter(string sKey = "")
        {
            clsRequestInfo oRequestInfo = getRequestPathInfo(sKey);

            return(getTier(oRequestInfo.appName).getAdapter(oRequestInfo.Path));
        }