Пример #1
0
        public void Page_Load(object sender, EventArgs e)
        {
            var jsonAttributes = new NameValueCollection();

            if (TranslateUtils.ToBool(Request.QueryString["isContentPhoto"]))
            {
                string message;
                string url;
                string smallUrl;
                string middleUrl;
                string largeUrl;
                var    success = UploadContentPhotoImage(out message, out url, out smallUrl, out middleUrl, out largeUrl);
                jsonAttributes.Add("success", success.ToString().ToLower());
                jsonAttributes.Add("message", message);
                jsonAttributes.Add("url", url);
                jsonAttributes.Add("smallUrl", smallUrl);
                jsonAttributes.Add("middleUrl", middleUrl);
                jsonAttributes.Add("largeUrl", largeUrl);
            }
            else if (TranslateUtils.ToBool(Request.QueryString["isContentPhotoSwfUpload"]))
            {
                string message;
                string url;
                string smallUrl;
                string middleUrl;
                string largeUrl;
                var    success = UploadContentPhotoSwfUpload(out message, out url, out smallUrl, out middleUrl, out largeUrl);
                jsonAttributes.Add("success", success.ToString().ToLower());
                jsonAttributes.Add("message", message);
                jsonAttributes.Add("url", url);
                jsonAttributes.Add("smallUrl", smallUrl);
                jsonAttributes.Add("middleUrl", middleUrl);
                jsonAttributes.Add("largeUrl", largeUrl);
            }
            else if (TranslateUtils.ToBool(Request.QueryString["isWordSwfUpload"]))
            {
                string message;
                string fileName;
                var    success = UploadWordSwfUpload(out message, out fileName);
                jsonAttributes.Add("success", success.ToString().ToLower());
                jsonAttributes.Add("message", message);
                jsonAttributes.Add("fileName", fileName);
            }
            else if (TranslateUtils.ToBool(Request.QueryString["isResume"]))
            {
                string message;
                string url;
                string value;
                var    success = UploadResumeImage(out message, out url, out value);
                jsonAttributes.Add("success", success.ToString().ToLower());
                jsonAttributes.Add("message", message);
                jsonAttributes.Add("url", url);
                jsonAttributes.Add("value", value);
            }

            var jsonString = TranslateUtils.NameValueCollectionToJsonString(jsonAttributes);

            jsonString = StringUtils.ToJsString(jsonString);

            Response.Write(jsonString);
            Response.End();
        }
Пример #2
0
        public void Page_Load(object sender, EventArgs e)
        {
            var    type          = Request["type"];
            var    retval        = new NameValueCollection();
            string retString     = null;
            string retSiteString = null;
            var    body          = new RequestBody();

            if (type == TypeGetCountArray)
            {
                var userKeyPrefix = Request["userKeyPrefix"];
                retval = GetCountArray(userKeyPrefix);
            }
            else if (type == TypeSiteTemplateDownload)
            {
                var userKeyPrefix = Request["userKeyPrefix"];
                var downloadUrl   = TranslateUtils.DecryptStringBySecretKey(Request["downloadUrl"]);
                var directoryName = Request["directoryName"];
                retval = SiteTemplateDownload(downloadUrl, directoryName, userKeyPrefix);
            }
            else if (type == TypeSiteTemplateZip)
            {
                var userKeyPrefix = Request["userKeyPrefix"];
                var directoryName = Request["directoryName"];
                retval = SiteTemplateZip(directoryName, userKeyPrefix);
            }
            else if (type == TypeGetLoadingChannels)
            {
                var publishmentSystemId = TranslateUtils.ToInt(Request["publishmentSystemID"]);
                var parentId            = TranslateUtils.ToInt(Request["parentID"]);
                var loadingType         = Request["loadingType"];
                var additional          = Request["additional"];
                retString = GetLoadingChannels(publishmentSystemId, parentId, loadingType, additional, body);
            }
            else if (type == TypeGetLoadingSites)
            {
                var parentId    = TranslateUtils.ToInt(Request["parentID"]);
                var loadingType = Request["loadingType"];
                var additional  = Request["additional"];
                retSiteString = GetLoadingSites(parentId, body.AdministratorName, body.AdministratorInfo.PublishmentSystemId);
            }
            //else if (type == "GetLoadingGovPublicCategories")
            //{
            //    string classCode = base.Request["classCode"];
            //    int publishmentSystemID = TranslateUtils.ToInt(base.Request["publishmentSystemID"]);
            //    int parentID = TranslateUtils.ToInt(base.Request["parentID"]);
            //    string loadingType = base.Request["loadingType"];
            //    string additional = base.Request["additional"];
            //    retString = GetLoadingGovPublicCategories(classCode, publishmentSystemID, parentID, loadingType, additional);
            //}
            //else if (type == "GetLoadingTemplates")
            //{
            //    int publishmentSystemID = TranslateUtils.ToInt(base.Request["publishmentSystemID"]);
            //    string templateType = base.Request["templateType"];
            //    retString = GetLoadingTemplates(publishmentSystemID, templateType);
            //}
            //else if (type == "StlTemplate")
            //{
            //    int publishmentSystemID = TranslateUtils.ToInt(base.Request["publishmentSystemID"]);
            //    int templateID = TranslateUtils.ToInt(base.Request["templateID"]);
            //    string includeUrl = base.Request["includeUrl"];
            //    string operation = base.Request["operation"];
            //    retval = TemplateDesignOperation.Operate(publishmentSystemID, templateID, includeUrl, operation, base.Request.Form);
            //}

            if (retString != null)
            {
                Page.Response.Write(retString);
                Page.Response.End();
            }
            else if (retSiteString != null)
            {
                Page.Response.Write(retSiteString);
                Page.Response.End();
            }
            else
            {
                var jsonString = TranslateUtils.NameValueCollectionToJsonString(retval);
                Page.Response.Write(jsonString);
                Page.Response.End();
            }
        }
Пример #3
0
        public void Page_Load(object sender, EventArgs e)
        {
            var    type      = Request["type"];
            var    retval    = new NameValueCollection();
            string retString = null;
            var    request   = new RequestImpl();

            if (!request.IsAdminLoggin)
            {
                return;
            }

            if (type == TypeGetCountArray)
            {
                var userKeyPrefix = Request["userKeyPrefix"];
                retval = GetCountArray(userKeyPrefix);
            }
            else if (type == TypeSiteTemplateDownload)
            {
                var userKeyPrefix = Request["userKeyPrefix"];
                var downloadUrl   = TranslateUtils.DecryptStringBySecretKey(Request["downloadUrl"]);
                var directoryName = Request["directoryName"];
                retval = SiteTemplateDownload(downloadUrl, directoryName, userKeyPrefix);
            }
            else if (type == TypeSiteTemplateZip)
            {
                var userKeyPrefix = Request["userKeyPrefix"];
                var directoryName = Request["directoryName"];
                retval = SiteTemplateZip(directoryName, userKeyPrefix);
            }
            else if (type == TypeSiteTemplateUnZip)
            {
                var userKeyPrefix = Request["userKeyPrefix"];
                var fileName      = Request["fileName"];
                retval = SiteTemplateUnZip(fileName, userKeyPrefix);
            }
            else if (type == TypeGetLoadingChannels)
            {
                var siteId = TranslateUtils.ToInt(Request["siteId"]);
                var contentModelPluginId = Request["contentModelPluginId"];
                var parentId             = TranslateUtils.ToInt(Request["parentId"]);
                var loadingType          = Request["loadingType"];
                var additional           = Request["additional"];
                retString = GetLoadingChannels(siteId, contentModelPluginId, parentId, loadingType, additional, request);
            }
            else if (type == TypePluginDownload)
            {
                var userKeyPrefix = Request["userKeyPrefix"];
                var downloadUrl   = TranslateUtils.DecryptStringBySecretKey(Request["downloadUrl"]);
                retval = PluginDownload(downloadUrl, userKeyPrefix);
            }
            //else if (type == "GetLoadingGovPublicCategories")
            //{
            //    string classCode = base.Request["classCode"];
            //    int siteID = TranslateUtils.ToInt(base.Request["siteID"]);
            //    int parentID = TranslateUtils.ToInt(base.Request["parentID"]);
            //    string loadingType = base.Request["loadingType"];
            //    string additional = base.Request["additional"];
            //    retString = GetLoadingGovPublicCategories(classCode, siteID, parentID, loadingType, additional);
            //}
            //else if (type == "GetLoadingTemplates")
            //{
            //    int siteID = TranslateUtils.ToInt(base.Request["siteID"]);
            //    string templateType = base.Request["templateType"];
            //    retString = GetLoadingTemplates(siteID, templateType);
            //}
            //else if (type == "StlTemplate")
            //{
            //    int siteID = TranslateUtils.ToInt(base.Request["siteID"]);
            //    int templateID = TranslateUtils.ToInt(base.Request["templateID"]);
            //    string includeUrl = base.Request["includeUrl"];
            //    string operation = base.Request["operation"];
            //    retval = TemplateDesignOperation.Operate(siteID, templateID, includeUrl, operation, base.Request.Form);
            //}

            if (retString != null)
            {
                Page.Response.Write(retString);
                Page.Response.End();
            }
            else
            {
                var jsonString = TranslateUtils.NameValueCollectionToJsonString(retval);
                Page.Response.Write(jsonString);
                Page.Response.End();
            }
        }
Пример #4
0
        public void Page_Load(object sender, EventArgs e)
        {
            var type          = Request.QueryString["type"];
            var userKeyPrefix = Request["userKeyPrefix"];
            var retval        = new NameValueCollection();
            var body          = new RequestBody();

            if (type == TypeGetCountArray)
            {
                retval = GetCountArray(userKeyPrefix);
            }
            //else if (type == "GetCountArrayForService")
            //{
            //    retval = GetCountArrayForService(userKeyPrefix);
            //}
            //    else if (type == "CreateChannels")
            //    {
            //        int publishmentSystemID = TranslateUtils.ToInt(base.Request.Form["publishmentSystemID"]);
            //        retval = CreateChannels(publishmentSystemID, userKeyPrefix);
            //    }
            //    else if (type == "CreateChannelsOneByOne")
            //    {
            //        int publishmentSystemID = TranslateUtils.ToInt(base.Request.Form["publishmentSystemID"]);
            //        bool isIncludeChildren = TranslateUtils.ToBool(base.Request.Form["isIncludeChildren"]);
            //        bool isCreateContents = TranslateUtils.ToBool(base.Request.Form["isCreateContents"]);
            //        retval = CreateChannelsOneByOne(publishmentSystemID, userKeyPrefix, isIncludeChildren, isCreateContents);
            //    }
            //    else if (type == "CreateContents")
            //    {
            //        int publishmentSystemID = TranslateUtils.ToInt(base.Request.Form["publishmentSystemID"]);
            //        retval = CreateContents(publishmentSystemID, userKeyPrefix);
            //    }
            //    else if (type == "CreateContentsByService")
            //    {
            //        int publishmentSystemID = TranslateUtils.ToInt(base.Request.Form["publishmentSystemID"]);
            //        int createTaskID = TranslateUtils.ToInt(base.Request.Form["createTaskID"]);
            //        retval = CreateContentsByService(publishmentSystemID, userKeyPrefix, createTaskID);
            //    }
            //    else if (type == "CreateContentsOneByOne")
            //    {
            //        int publishmentSystemID = TranslateUtils.ToInt(base.Request.Form["publishmentSystemID"]);
            //        int nodeID = TranslateUtils.ToInt(base.Request.Form["nodeID"]);
            //        retval = CreateContentsOneByOne(publishmentSystemID, nodeID, userKeyPrefix);
            //    }
            //    else if (type == "CreateByTemplate")
            //    {
            //        int publishmentSystemID = TranslateUtils.ToInt(base.Request.Form["publishmentSystemID"]);
            //        int templateID = TranslateUtils.ToInt(base.Request.Form["templateID"]);
            //        retval = CreateByTemplate(publishmentSystemID, templateID, userKeyPrefix);
            //    }
            //    else if (type == "CreateByIDsCollection")
            //    {
            //        int publishmentSystemID = TranslateUtils.ToInt(base.Request.Form["publishmentSystemID"]);
            //        retval = CreateByIDsCollection(publishmentSystemID, userKeyPrefix);
            //    }
            //    else if (type == "CreateFiles")
            //    {
            //        int publishmentSystemID = TranslateUtils.ToInt(base.Request.Form["publishmentSystemID"]);
            //        retval = CreateFiles(publishmentSystemID, userKeyPrefix);
            //    }
            if (type == TypeCreatePublishmentSystem)
            {
                var publishmentSystemId = TranslateUtils.ToInt(Request.Form["publishmentSystemID"]);
                var isUseSiteTemplate   = TranslateUtils.ToBool(Request.Form["isUseSiteTemplate"]);
                var isImportContents    = TranslateUtils.ToBool(Request.Form["isImportContents"]);
                var isImportTableStyles = TranslateUtils.ToBool(Request.Form["isImportTableStyles"]);
                var siteTemplateDir     = Request.Form["siteTemplateDir"];
                var isUseTables         = TranslateUtils.ToBool(Request.Form["isUseTables"]);
                var returnUrl           = Request.Form["returnUrl"];
                var isTop = TranslateUtils.ToBool(Request.Form["isTop"], false);
                retval = CreatePublishmentSystem(publishmentSystemId, isUseSiteTemplate, isImportContents, isImportTableStyles, siteTemplateDir, isUseTables, userKeyPrefix, returnUrl, isTop, body.AdministratorName);
            }
            //    else if (type == "CreateAll")
            //    {
            //        int publishmentSystemID = TranslateUtils.ToInt(base.Request.Form["publishmentSystemID"]);
            //        retval = CreateAll(publishmentSystemID, userKeyPrefix);
            //    }

            var jsonString = TranslateUtils.NameValueCollectionToJsonString(retval);

            Page.Response.Write(jsonString);
            Page.Response.End();
        }