Context() 공개 메소드

public Context ( ) : DataTable
리턴 System.Data.DataTable
예제 #1
0
        public void ProcessRequest(HttpContext context)
        {
            try
            {
                PortalController.Instance.GetCurrentPortalSettings();

                if ((context.Request.QueryString["tabid"] == null || context.Request.QueryString["mid"] == null) ||
                    !(context.Request.IsAuthenticated))
                {
                    return;
                }
                // get TabId
                var tabId = Convert.ToInt32(-1);
                if (context.Request.QueryString["tabid"] != null)
                {
                    tabId = int.Parse(context.Request.QueryString["tabid"]);
                }

                // get ModuleId
                var moduleId = Convert.ToInt32(-1);
                if (context.Request.QueryString["mid"] != null)
                {
                    moduleId = int.Parse(context.Request.QueryString["mid"]);
                }

                var userInfo = UserController.Instance.GetCurrentUserInfo();
                var mc       = new ModuleController();

                var moduleInfo = new ModuleController().GetModule(moduleId, tabId);
                var settings   = moduleInfo.ModuleSettings;

                if (ModulePermissionController.CanManageModule(moduleInfo))
                {
                    var udt = new UserDefinedTableController(moduleId, tabId, userInfo);
                    var ds  = udt.GetDataSet(true);

                    ds.Tables.Add(udt.Context(moduleInfo, userInfo,
                                              context.Request[Definition.QueryStringParameter].AsString(),
                                              settings[SettingName.SortField].AsString(),
                                              settings[SettingName.SortOrder].AsString(),
                                              settings[SettingName.Paging].AsString()));
                    context.Response.ContentType = "Text/Xml";
                    ds.WriteXml(context.Response.OutputStream);
                }
            }
            catch (Exception)
            {
                context.Response.Write("Not defined");
            }
        }
예제 #2
0
        public void ProcessRequest(HttpContext context)
        {
            try
            {
                PortalController.GetCurrentPortalSettings();

                if ((context.Request.QueryString["tabid"] == null || context.Request.QueryString["mid"] == null) ||
                    !(context.Request.IsAuthenticated))
                {
                    return;
                }
                // get TabId
                var tabId = Convert.ToInt32(-1);
                if (context.Request.QueryString["tabid"] != null)
                {
                    tabId = int.Parse(context.Request.QueryString["tabid"]);
                }

                // get ModuleId
                var moduleId = Convert.ToInt32(-1);
                if (context.Request.QueryString["mid"] != null)
                {
                    moduleId = int.Parse(context.Request.QueryString["mid"]);
                }

                var userInfo = UserController.GetCurrentUserInfo();
                var mc = new ModuleController();
                var settings = mc.GetModuleSettings(moduleId);
                var moduleInfo = new ModuleController().GetModule(moduleId, tabId);

                if (ModulePermissionController.CanManageModule(moduleInfo))
                {
                    var udt = new UserDefinedTableController(moduleId, tabId, userInfo);
                    var ds = udt.GetDataSet(true);

                    ds.Tables.Add(udt.Context(moduleInfo, userInfo,
                                                 context.Request[Definition.QueryStringParameter].AsString(),
                                                 settings[SettingName.SortField].AsString(),
                                                 settings[SettingName.SortOrder].AsString(),
                                                 settings[SettingName.Paging].AsString()));
                    context.Response.ContentType = "Text/Xml";
                    ds.WriteXml(context.Response.OutputStream);
                }
            }
            catch (Exception)
            {
                context.Response.Write("Not defined");
            }
        }