Exemplo n.º 1
0
 public void ProcessRequest(HttpContext context)
 {
     BLLJIMP.Model.AppManageVersion ver = bllApp.ConvertRequestToModel <BLLJIMP.Model.AppManageVersion>(new BLLJIMP.Model.AppManageVersion());
     if (string.IsNullOrWhiteSpace(ver.WebsiteOwner))
     {
         ver.WebsiteOwner = bllApp.WebsiteOwner;
     }
     if (ver.AutoID == 0)
     {
         ver.AppOS = ver.AppOS.ToLower();
         if (!ver.AppVersionPublishDate.HasValue)
         {
             ver.AppVersionPublishDate = DateTime.Now;
         }
         apiResp.status = bllApp.Add(ver);
     }
     else
     {
         BLLJIMP.Model.AppManageVersion oVer = bllApp.GetVersion(ver.WebsiteOwner, ver.AppOS, ver.AutoID.ToString());
         oVer.AppVersion            = ver.AppVersion;
         oVer.AppVersionInfo        = ver.AppVersionInfo;
         oVer.AppVersionPublish     = ver.AppVersionPublish;
         oVer.AppVersionPublishPath = ver.AppVersionPublishPath;
         oVer.AppVersionInstallPath = ver.AppVersionInstallPath;
         if (ver.AppVersionPublishDate.HasValue && ver.AppVersionPublishDate.Value.ToString("yyyy/MM/dd HH:mm:ss") != oVer.AppVersionPublishDate.Value.ToString("yyyy/MM/dd HH:mm:ss"))
         {
             oVer.AppVersionPublishDate = ver.AppVersionPublishDate;
         }
         apiResp.status = bllApp.Update(oVer);
     }
     apiResp.code = apiResp.status ? (int)BLLJIMP.Enums.APIErrCode.IsSuccess : (int)BLLJIMP.Enums.APIErrCode.OperateFail;
     apiResp.msg  = apiResp.status ? "提交完成" : "提交失败";
     bllApp.ContextResponse(context, apiResp);
 }
Exemplo n.º 2
0
        public void ProcessRequest(HttpContext context)
        {
            int    rows         = Convert.ToInt32(context.Request["rows"]);
            int    page         = Convert.ToInt32(context.Request["page"]);
            string keyword      = context.Request["keyword"];
            string websiteOwner = context.Request["websiteOwner"];

            if (string.IsNullOrWhiteSpace(websiteOwner))
            {
                websiteOwner = bllApp.WebsiteOwner;
            }
            else if (websiteOwner == "all")
            {
                websiteOwner = "";
            }

            int            total = bllApp.GetAppCount(websiteOwner, keyword);
            List <dynamic> rList = new List <dynamic>();

            if (total > 0)
            {
                List <BLLJIMP.Model.AppManage> list = bllApp.GetAppList(rows, page, websiteOwner, keyword);
                foreach (BLLJIMP.Model.AppManage item in list)
                {
                    int androidCount = bllApp.GetVersionCount(websiteOwner, "android", "");
                    int iosCount     = bllApp.GetVersionCount(websiteOwner, "ios", "");
                    BLLJIMP.Model.AppManageVersion androidVer = bllApp.GetVersion(websiteOwner, "android", "");
                    BLLJIMP.Model.AppManageVersion iosVer     = bllApp.GetVersion(websiteOwner, "ios", "");

                    rList.Add(new
                    {
                        item.AutoID,
                        item.AppId,
                        item.AppName,
                        item.AppInfo,
                        item.WebsiteOwner,
                        item.StartAdHref,
                        AndroidCount = androidCount,
                        AndroidPath  = androidVer == null?"":androidVer.AppVersionPublishPath,
                        IosCount     = iosCount,
                        IosPath      = iosVer == null ? "" : iosVer.AppVersionPublishPath
                    });
                }
            }

            apiResp.status = true;
            apiResp.code   = (int)BLLJIMP.Enums.APIErrCode.IsSuccess;
            apiResp.result = new
            {
                totalcount = total,
                list       = rList
            };
            apiResp.msg = "查询完成";
            bllApp.ContextResponse(context, apiResp);
        }
Exemplo n.º 3
0
Arquivo: Get.ashx.cs Projeto: uvbs/mmp
        public void ProcessRequest(HttpContext context)
        {
            string id           = context.Request["id"];
            string os           = context.Request["os"];
            string websiteOwner = context.Request["websiteOwner"];

            if (string.IsNullOrWhiteSpace(websiteOwner))
            {
                websiteOwner = bllApp.WebsiteOwner;
            }

            BLLJIMP.Model.AppManageVersion ver = bllApp.GetVersion(websiteOwner, os, id);
            apiResp.status = true;
            apiResp.code   = (int)BLLJIMP.Enums.APIErrCode.IsSuccess;
            apiResp.result = ver;
            apiResp.msg    = "查询完成";
            bllApp.ContextResponse(context, apiResp);
        }
Exemplo n.º 4
0
        public void ProcessRequest(HttpContext context)
        {
            string os           = context.Request["os"];
            string websiteOwner = context.Request["websiteOwner"];

            if (string.IsNullOrWhiteSpace(websiteOwner))
            {
                websiteOwner = bllApp.WebsiteOwner;
            }

            BLLJIMP.Model.AppManageVersion ver = bllApp.GetVersion(websiteOwner, os, "");
            apiResp.status = (ver != null);
            apiResp.code   = apiResp.status ? (int)BLLJIMP.Enums.APIErrCode.IsSuccess : (int)BLLJIMP.Enums.APIErrCode.OperateFail;
            apiResp.result = !apiResp.status ? null:new {
                version = ver.AppVersion,
                info    = ver.AppVersionInfo,
                show    = ver.AppVersionPublishPath,
                install = ver.AppVersionInstallPath
            };
            apiResp.msg = "查询完成";
            bllApp.ContextResponse(context, apiResp);
        }