Пример #1
0
 public void Bind()
 {
     CurrentEntity = new PackInfoBLL().GetSingle(this.PackID);
     this.PackForm.SelectedValue  = this.CurrentEntity.PackFrom.ToString();
     this.CoopType.SelectedValue  = this.CurrentEntity.CoopType.ToString();
     this.IsMainVer.SelectedValue = this.CurrentEntity.IsMainVer.ToString();
     this.Status.SelectedValue    = this.CurrentEntity.Status.ToString();
 }
Пример #2
0
        public string BindPackUrl(object val)
        {
            int            id     = Convert.ToInt32(val);
            string         url    = "";
            PackInfoEntity entity = new PackInfoBLL().GetSingle(id);

            if (entity != null)
            {
                url = entity.PackUrl;
            }
            return(url);
        }
Пример #3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         this.IsMainVer.Enabled = false;
         int result = new PackInfoBLL().GetAppToPackCount(this.AppID);
         if (result > 0)
         {
             PackInfoEntity packinfo = new PackInfoBLL().GetNewSingle(AppID);
             AppPicUrl = packinfo.AppPicUrl.Trim();
         }
     }
 }
Пример #4
0
        public void BindData()
        {
            PackInfoEntity entity = new PackInfoEntity()
            {
                AppID = this.AppID
            };

            if (entity.AppID.Equals(0))
            {
                this.Alert("参数非法!");
                return;
            }



            List <PackInfoEntity> list = new PackInfoBLL().GetDataList(entity);

            objRepeater.DataSource = list;
            objRepeater.DataBind();
        }
Пример #5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (nwbase_utils.Tools.GetRequestVal("action", "") == "download")
     {
         string url = "";
         string id  = nwbase_utils.Tools.GetRequestVal("id", "");
         if (id.IndexOf(',') > -1)
         {
             string[] ids = id.Split(',');
             if (ids.Length > 0)
             {
                 foreach (var i in ids)
                 {
                     PackInfoEntity entity = new PackInfoEntity()
                     {
                         AppID = Convert.ToInt32(i)
                     };
                     List <PackInfoEntity> list = new PackInfoBLL().GetDataList(entity);
                     foreach (PackInfoEntity item in list)
                     {
                         if (item.IsMainVer == 1 && item.Status == 1)
                         {
                             if (url == "")
                             {
                                 //url = item.AppID + item.ShowName;
                                 url = item.PackUrl;
                             }
                             else
                             {
                                 //url = url + "," + item.AppID + item.ShowName;
                                 url = url + "," + item.PackUrl;
                             }
                         }
                     }
                 }
             }
             Response.Write(url);
             Response.End();
         }
     }
 }
Пример #6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         string ac = Request.QueryString["ac"];
         if (ac == "permission")
         {
             int id = Int32.Parse(Request.QueryString["id"]);
             if (id > 0)
             {
                 string         permission = "";
                 PackInfoEntity info       = new PackInfoBLL().GetSingle(id);
                 if (info != null)
                 {
                     permission = GetAndroidPermission(info.permission);
                 }
                 Response.Write(permission);
                 Response.End();
             }
         }
         else if (ac == "updatever")
         {
             PackInfoEntity entity = new PackInfoBLL().GetSingle(PackID);
             if (new PackInfoBLL().UpdateMainVer(entity))
             {
                 OperateRecordEntity info = new OperateRecordEntity()
                 {
                     ElemId         = entity.AppID,
                     reason         = "",
                     Status         = 1,
                     OperateFlag    = "7",
                     OperateType    = "2",
                     OperateExplain = "设置主版本",
                     SourcePage     = 1,
                     OperateContent = entity.ShowName + "(" + entity.PackName + ")",
                     UserName       = GetUserName(),
                 };
                 new OperateRecordBLL().Insert(info);
                 Response.Write("主版本设置成功");
                 Response.End();
             }
             else
             {
                 Response.Write("主版本设置失败");
                 Response.End();
             }
         }
         //new PackInfoBLL().AndroidPermission("");
         else
         {
             if (this.PackID != 0)
             {
                 if (new PackInfoBLL().Delete(this.PackID))
                 {
                     int           packcount = new AppInfoBLL().GetPacksCount(AppID);
                     AppInfoEntity info      = new AppInfoEntity()
                     {
                         AppID = AppID, PackCount = packcount
                     };
                     bool ruslt = new AppInfoBLL().UpdatePackCount(info);
                     this.Alert("删除成功");
                 }
                 else
                 {
                     this.Alert("删除失败");
                 }
             }
         }
         this.BindData();
     }
 }
Пример #7
0
        /// <summary>
        /// 添加安装包   2014-10-27 momo update
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                PackInfoEntity packInfoEntity = new PackInfoEntity()
                {
                    //应用ID
                    AppID = this.AppID,
                    //显示名称
                    ShowName = this.ShowName,
                    //合作类型,定义:1=联运,2=CPS,3=CPA,99=未合作
                    CoopType = this.CoopType.SelectedValue.Convert <int>(0),
                    //安装包来源:1=直接合作,2=自由市场,3=豌豆荚
                    PackFrom = this.PackForm.SelectedValue.Convert <int>(0),
                    //下载量,定期更新(不影响更新时间)
                    DownTimes = this.Request <int>("DownTimes", 0),
                    //是否主版本,定义:1=是,2=否
                    IsMainVer = this.IsMainVer.SelectedValue.Convert <int>(0),
                    //安装包大小,单位:字节 B
                    PackSize = this.Request <int>("PackSize", 0),
                    //版本代码
                    VerCode = this.Request <int>("VerCode", 0),
                    //版本号
                    VerName = this.Request <string>("VerName", string.Empty),
                    //包名
                    PackName = this.Request <string>("PackName", string.Empty),
                    //签名验证码
                    PackSign = this.Request <string>("SignCode", string.Empty),
                    //ICON URL
                    IconUrl = this.Request <string>("IconPicUrl", string.Empty),
                    //首选安装包URL
                    PackUrl = this.Request <string>("PackUrl", string.Empty),
                    //备用安装包URL
                    PackUrl2 = "",
                    //安装包的MD5
                    PackMD5 = this.Request <string>("PackMD5", string.Empty),
                    //适用性描述
                    CompDesc = this.Request <string>("CompDesc", string.Empty).HtmlEncode(),
                    //更新描述
                    UpdateDesc = this.Request <string>("UpDateDesc", string.Empty).HtmlEncode(),
                    //备注
                    Remarks = this.Request <string>("Remarks", string.Empty).HtmlEncode(),
                    //状态,定义:1=正常,2=禁用
                    Status = this.Status.SelectedValue.Convert <int>(0),

                    permission = AndroidPermission(this.Request <string>("permission", string.Empty))
                };

                #region 判断数据有效性

                if (string.IsNullOrEmpty(this.ShowName))
                {
                    this.Alert("显示名称不能为空");
                    return;
                }
                else if (string.IsNullOrEmpty(packInfoEntity.PackUrl))
                {
                    this.Alert("请先上传安装包");
                    return;
                }
                else if (string.IsNullOrEmpty(packInfoEntity.PackName))
                {
                    this.Alert("安装包包名不能为空");
                    return;
                }
                else if (string.IsNullOrEmpty(packInfoEntity.IconUrl))
                {
                    this.Alert("Icon不能为空");
                    return;
                }

                //if (appPicUrl.Length == 0)
                //{
                //    this.Alert("请先上传应用截图");
                //    return;
                //}

                //判断安装包是否重复 2014-10-30 momo--------------- begin

                int result = 0;
                //判断此应用是否已添加安装包,有则判断新增安装包的PackName + PackSign 与旧安装包是否一致,否则根据PackName + PackSign判断其他应用是否存在此安装包
                result = new PackInfoBLL().GetAppToPackCount(this.AppID);
                if (result > 0)
                {
                    //判断新增安装包的PackName + PackSign 与旧安装包是否一致,一致则可进行添加操作,否则提示用户上传的安装包不一致,如需添加则可通过新增应用方式添加此安装包
                    result = new AppInfoBLL().CheckAppRepeat(this.AppID, packInfoEntity.PackName, packInfoEntity.PackSign);
                    if (result == 0)
                    {
                        this.Alert("上传的安装包与现有的安装包不一致");
                        return;
                    }
                }
                else
                {
                    //判断其他应用是否存在此安装包
                    result = new AppInfoBLL().CheckAppRepeat(0, packInfoEntity.PackName, packInfoEntity.PackSign);
                    //if (result > 0)
                    //{
                    //    AppInfoEntity appInfo = new AppInfoBLL().GetAppByPackNameAndPackSign(packInfoEntity.PackName, packInfoEntity.PackSign);
                    //    string msg = "应用" + appInfo.AppName + "-" + appInfo.AppID + "已存在此安装包";
                    //    this.Alert(msg);
                    //    return;
                    //}
                }

                //判断安装包是否重复 2014-10-30 momo--------------- end

                #endregion
                string[] appPicUrl = this.Request.Params["AppPicUrl"].Split(',');

                //添加应用截图,URL之间用英文逗号分隔
                string str_PicUrl = "";
                for (int i = 0; i < appPicUrl.Length; i++)
                {
                    str_PicUrl = str_PicUrl == "" ? appPicUrl[i] : (str_PicUrl + ',' + appPicUrl[i]);
                }
                packInfoEntity.AppPicUrl = str_PicUrl;
                if (str_PicUrl == "")
                {
                    PackInfoEntity packentity = new AppInfoBLL().GetNewInfo(AppID);
                    if (packentity != null)
                    {
                        packInfoEntity.AppPicUrl = packentity.AppPicUrl;
                    }
                }

                new PackInfoBLL().UpdateMainVersion(packInfoEntity);
                //添加安装包
                int           packID = new PackInfoBLL().Insert(packInfoEntity);
                AppInfoEntity app    = new AppInfoEntity()
                {
                    UpdateTime = DateTime.Now, OpUpdateTime = DateTime.Now, AppID = AppID
                };
                new AppInfoBLL().ChangeUpdateTime(app);
                if (packID > 0)
                {
                    int           packcount = new AppInfoBLL().GetPacksCount(AppID);
                    AppInfoEntity info      = new AppInfoEntity()
                    {
                        AppID = AppID, PackCount = packcount
                    };
                    bool ruslt = new AppInfoBLL().UpdatePackCount(info);

                    /*由于数据表结构的变动,故无需此操作 2014-10-27  momo
                     * for (int i = 0; i < appPicUrl.Length; i++)
                     * {
                     *  AppPicListEntity appPicListEntity = new AppPicListEntity()
                     *  {
                     *      AppID = this.AppID,
                     *      PackID = packID,
                     *      OrderNo = 0,
                     *      PicUrl = appPicUrl[i]
                     *  };
                     *
                     *  new AppPicListBLL().Insert(appPicListEntity);
                     * }
                     */

                    //如果当前安装包版本为主版本,则把安装包信息更新到应用信息表中
                    if (packInfoEntity.IsMainVer == 1)
                    {
                        AppInfoEntity appInfoEntity = new AppInfoEntity()
                        {
                            AppID        = this.AppID,
                            MainPackID   = packID,
                            CoopType     = this.CoopType.SelectedValue.Convert <int>(0),
                            MainPackSize = packInfoEntity.PackSize,
                            MainVerCode  = this.Request <int>("VerCode", 0),
                            MainVerName  = this.Request <string>("VerName", string.Empty),
                            MainIconUrl  = packInfoEntity.IconUrl,
                            PackName     = this.Request <string>("PackName", string.Empty),
                            PackSign     = this.Request <string>("SignCode", string.Empty),
                            DataStatus   = 1 // 数据状态正常
                        };

                        new AppInfoBLL().UpDatePackInfo(appInfoEntity);
                    }

                    this.Response.Redirect(string.Format("PackInfoList.aspx?AppID={0}&ShowName={1}", this.AppID, packInfoEntity.ShowName));
                }
                else
                {
                    this.Alert("新增安装包失败!");
                }
            }
            catch (Exception ex)
            {
                nwbase_utils.TextLog.Default.Error(ex.Message);
                throw ex;
            }
        }
Пример #8
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            DataSet   dataset   = new DataSet();
            DataTable datatable = new DataTable();

            dataset   = new GroupElemsBLL().QueryDataSetByGroupID2(GroupID);
            datatable = GetGroupInfo(GroupID);
            DataTable dt = dataset.Tables[0];

            if (dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    for (int j = 0; j < dt.Columns.Count; j++)
                    {
                        if (dt.Columns[j].ColumnName.ToString() == "PosID")
                        {
                            int           posid  = int.Parse(dt.Rows[i][j].ToString());
                            int           id     = int.Parse(dt.Rows[i][4].ToString());
                            AppInfoEntity entity = new AppInfoBLL().GetSingle(id);
                            int           a      = 0;
                            for (int k = 0; k < datatable.Rows.Count; k++)
                            {
                                if (int.Parse(datatable.Rows[k][datatable.Columns.Count - 1].ToString()) == id)
                                {
                                    a = k;
                                }
                            }
                            if (a > 0)
                            {
                                datatable.Rows.RemoveAt(a);
                            }
                            DataRow drr = datatable.NewRow();
                            if (entity != null)
                            {
                                drr["ID"]  = entity.AppID;
                                drr["游戏名"] = entity.ShowName;
                                drr["包名"]  = entity.PackName;
                                drr["版本"]  = entity.MainVerName;
                                AppTypeEntity type = new AppTypeBLL().GetSingle(entity.AppType);
                                if (type != null)
                                {
                                    drr["游戏分类"] = type.AppTypeName;
                                }

                                drr["合作类型"] = entity.CoopType;
                                drr["开发者"]  = entity.DevName;
                                drr["状态"]   = entity.Status;
                                PackInfoEntity info = new PackInfoBLL().GetSingle(entity.MainPackID);
                                if (info != null)
                                {
                                    drr["调用权限"] = info.permission;
                                }
                            }
                            //datatable.Rows.RemoveAt(posid-1);
                            datatable.Rows.InsertAt(drr, posid - 1);
                        }
                    }
                }
            }
            string fileName = string.Format("GroupInfo_{0}.xls", DateTime.Now.ToString("yyyyMMddHHmmss"));
            string path     = Server.MapPath(ServerMapPath() + fileName);

            new AppInfoListNew().WriteExcel2(BaseCommon.DtSelectTop(500, datatable), path, fileName);
            DownloadFile(path);
        }
Пример #9
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                PackInfoEntity packInfoEntity = new PackInfoEntity()
                {
                    AppID     = this.AppID,
                    PackID    = this.PackID,
                    ShowName  = this.ShowName,
                    PackName  = this.Request <string>("PackName", string.Empty),
                    VerCode   = this.Request <int>("VerCode", 0),
                    VerName   = this.Request <string>("VerName", string.Empty),
                    PackMD5   = this.Request <string>("PackMD5", string.Empty),
                    PackSize  = this.Request <int>("PackSize", 0),
                    CompDesc  = this.Request <string>("CompDesc", string.Empty).HtmlEncode(),
                    PackFrom  = this.PackForm.SelectedValue.Convert <int>(0),
                    CoopType  = this.CoopType.SelectedValue.Convert <int>(0),
                    IsMainVer = this.IsMainVer.SelectedValue.Convert <int>(0),
                    //运营状态,定义:1=正常,2=禁用
                    Status     = this.Status.SelectedValue.Convert <int>(0),
                    Remarks    = this.Request <string>("Remarks", string.Empty).HtmlEncode(),
                    UpdateDesc = this.Request <string>("UpDateDesc", string.Empty).HtmlEncode(),
                    PackUrl    = this.Request <string>("PackUrl", string.Empty),
                    IconUrl    = this.Request <string>("IconPicUrl", string.Empty),
                    DownTimes  = this.Request <int>("DownTimes", 0),
                    PackSign   = this.Request <string>("SignCode", string.Empty),
                    AppPicUrl  = "",
                    PackUrl2   = "",
                    //permission = this.Request<string>("permission", string.Empty)
                };
                string per = this.Request <string>("permission", string.Empty);
                if (per.Contains("#"))
                {
                    packInfoEntity.permission = AndroidPermission(per);
                }
                else
                {
                    packInfoEntity.permission = per;
                }
                bool ruslt = true;
                #region 判断数据有效性

                if (string.IsNullOrEmpty(this.ShowName))
                {
                    this.Alert("显示名称不能为空");
                    ruslt = false;
                }
                else if (string.IsNullOrEmpty(packInfoEntity.PackUrl))
                {
                    this.Alert("请先上传安装包");
                    ruslt = false;
                }
                else if (string.IsNullOrEmpty(packInfoEntity.PackName))
                {
                    this.Alert("安装包包名不能为空");
                    ruslt = false;
                }
                else if (string.IsNullOrEmpty(packInfoEntity.IconUrl))
                {
                    this.Alert("Icon不能为空");
                    ruslt = false;
                }

                //判断安装包是否重复 2014-10-30 momo--------------- begin

                int result = 0;
                //判断此应用是否已添加安装包,有则判断新增安装包的PackName + PackSign 与旧安装包是否一致,否则根据PackName + PackSign判断其他应用是否存在此安装包
                result = new PackInfoBLL().GetAppToPackCount(this.AppID);
                if (result > 0)
                {
                    //判断新增安装包的PackName + PackSign 与旧安装包是否一致,一致则可进行添加操作,否则提示用户上传的安装包不一致,如需添加则可通过新增应用方式添加此安装包
                    result = new AppInfoBLL().CheckAppRepeat(this.AppID, packInfoEntity.PackName, packInfoEntity.PackSign);
                    if (result == 0)
                    {
                        this.Alert("上传的安装包与现有的安装包不一致");
                        ruslt = false;
                    }
                }
                else
                {
                    //判断其他应用是否存在此安装包
                    result = new AppInfoBLL().CheckAppRepeat(0, packInfoEntity.PackName, packInfoEntity.PackSign);
                    if (result > 0)
                    {
                        AppInfoEntity appInfo = new AppInfoBLL().GetAppByPackNameAndPackSign(packInfoEntity.PackName, packInfoEntity.PackSign);
                        string        msg     = "应用" + appInfo.AppName + "-" + appInfo.AppID + "已存在此安装包";
                        this.Alert(msg);
                        ruslt = false;
                    }
                }

                //判断安装包是否重复 2014-10-30 momo--------------- end

                #endregion
                //如果当前安装包版本为主版本,则更新应用表信息
                if (packInfoEntity.IsMainVer == 1)
                {
                    // 更新应用的主安装包ID及包名
                    AppInfoEntity appInfoEntity = new AppInfoEntity()
                    {
                        AppID        = this.AppID,
                        CoopType     = this.CoopType.SelectedValue.Convert <int>(0),
                        MainPackID   = packInfoEntity.PackID,
                        MainPackSize = packInfoEntity.PackSize,
                        MainVerCode  = packInfoEntity.VerCode,
                        MainVerName  = packInfoEntity.VerName,
                        MainIconUrl  = packInfoEntity.IconUrl,
                        PackName     = packInfoEntity.PackName,
                        PackSign     = packInfoEntity.PackSign,
                        DataStatus   = 1
                    };

                    if (!new AppInfoBLL().UpDatePackInfo(appInfoEntity))
                    {
                        this.Alert("更新ICON、包名等信息时发生错误");
                        ruslt = false;
                    }
                }

                if (ruslt == true)
                {
                    int OldAppID = Request.Params["OldAppID"].Convert <int>(0);

                    if (Request.Params["AppPicUrls"] != null && Request.Params["AppPicUrls"].ToString() != "")
                    {
                        string[] AppPicUrls = Request.Params["AppPicUrls"].ToString().Split(',');
                        if (AppPicUrls.Length > 0)
                        {
                            string str_PicUrl = "";
                            for (int i = 0; i < AppPicUrls.Length; i++)
                            {
                                str_PicUrl = str_PicUrl == "" ? AppPicUrls[i] : (str_PicUrl + ',' + AppPicUrls[i]);
                            }

                            packInfoEntity.AppPicUrl = str_PicUrl;
                        }
                    }
                    else
                    {
                        packInfoEntity.AppPicUrl = " ";
                    }
                    string OldAppPicIDs = Request.Params["OldAppPicID"];

                    new PackInfoBLL().UpdateMainVersion(packInfoEntity);

                    bool packID = new PackInfoBLL().Update(packInfoEntity);

                    if (packID)
                    {
                        int           packcount = new AppInfoBLL().GetPacksCount(AppID);
                        AppInfoEntity info      = new AppInfoEntity()
                        {
                            AppID = AppID, PackCount = packcount
                        };
                        new AppInfoBLL().UpdatePackCount(info);
                        this.Response.Redirect(string.Format("PackInfoList.aspx?AppID={0}&ShowName={1}&type={2}", this.AppID, packInfoEntity.ShowName, this.Type));
                    }
                    else
                    {
                        this.Alert("新增安装包失败!");
                    }
                }
                else
                {
                    CurrentEntity = packInfoEntity;
                    this.PackForm.SelectedValue  = packInfoEntity.PackFrom.ToString();
                    this.CoopType.SelectedValue  = packInfoEntity.CoopType.ToString();
                    this.IsMainVer.SelectedValue = packInfoEntity.IsMainVer.ToString();
                    this.Status.SelectedValue    = packInfoEntity.Status.ToString();
                }
            }
            catch (Exception ex)
            {
                nwbase_utils.TextLog.Default.Error(ex.Message);
                throw ex;
            }
        }