Ejemplo n.º 1
0
        private bool ExecuteNonQuery(string commandText, OperateRecordEntity entity)
        {
            List <MySqlParameter> paramsList = GetMySqlParameters(entity);

            int result = MySqlHelper.ExecuteNonQuery(this.ConnectionString, commandText, paramsList.ToArray());

            return(base.ExecuteStatus(result));
        }
        private void Add()
        {
            GroupElemsEntity entity = new GroupElemsEntity();

            entity.GroupID   = new GroupBLL().LauncherRecommendGetGroupId(SchemeID, GroupTypeID);
            entity.PosID     = this.PosID;
            entity.ElemType  = this.ElemType.SelectedValue.Convert <int>(1);
            entity.GroupType = this.GroupType.Value.Convert <int>(0);
            entity.OrderNo   = this.OrderNo;
            entity.ElemID    = this.ElemID.Value.Convert <int>(0);

            entity.RecommTitle  = this.RecommTitle.Value.Trim();
            entity.RecommPicUrl = this.MainIconPicUrl.Value.Trim();
            entity.RecommWord   = this.RecommWord.Text;
            entity.RecommVal    = this.RecommVal.Value.Convert <int>(0);
            entity.Status       = this.Status.SelectedValue.Convert <int>(0);
            entity.Remarks      = this.Remarks.Text.Trim();

            entity.StartTime = DateTime.Now.AddYears(-100);
            entity.EndTime   = DateTime.Now.AddYears(100);



            if (new GroupElemsBLL().IsExist(entity))
            {
                this.Alert("当前应用已存在,添加失败");
            }
            else
            {
                bool result = new GroupElemsBLL().Insert(entity);

                if (result)
                {
                    if (SchemeID == 104)
                    {
                        OperateRecordEntity info = new OperateRecordEntity()
                        {
                            ElemId         = entity.ElemID,
                            reason         = "",
                            Status         = 1,
                            OperateFlag    = "1",
                            SourcePage     = 65,
                            OperateType    = "9",
                            OperateExplain = "热门管理:新增游戏",
                            OperateContent = new AppInfoBLL().GetSingle(entity.ElemID).ShowName,
                            UserName       = GetUserName(),
                        };
                        new OperateRecordBLL().Insert(info);
                    }
                    // this.Alert("添加成功", string.Format("LauncherRecommendList.aspx?acttype={0}",ActType));
                    Response.Redirect(string.Format("LauncherRecommendList.aspx?acttype={0}&page={1}", ActType, PageType));
                }
                else
                {
                    this.Alert("添加失败");
                }
            }
        }
Ejemplo n.º 3
0
        protected void OnDel(object s, CommandEventArgs e)
        {
            int id = nwbase_sdk.Tools.GetInt(e.CommandArgument, 0);

            if (id > 0)
            {
                var result = new GroupBLL().DeleteElem(id);
                if (result)
                {
                    if (SchemeID == 104)
                    {
                        OperateRecordEntity info = new OperateRecordEntity()
                        {
                            ElemId         = id,
                            reason         = "",
                            Status         = 1,
                            OperateFlag    = "3",
                            OperateContent = new GroupBLL().GetGroupElemByID(id).RecommTitle,
                            UserName       = GetUserName(),
                        };
                        if (GroupID != 93 && GroupID != 94)
                        {
                            info.SourcePage     = 62;
                            info.OperateType    = "6";
                            info.OperateExplain = GroupName + ": 删除游戏";
                        }
                        else
                        {
                            if (GroupID == 93)
                            {
                                info.SourcePage     = 63;
                                info.OperateType    = "7";
                                info.OperateExplain = "游戏排行: 删除游戏";
                            }
                            else if (GroupID == 94)
                            {
                                info.SourcePage     = 64;
                                info.OperateType    = "8";
                                info.OperateExplain = "最新游戏: 删除游戏";
                            }
                        }
                        new OperateRecordBLL().Insert(info);
                    }
                    this.Alert("删除成功");
                    Bind();
                    BindDataLog();
                }
                else
                {
                    this.Alert("删除失败");
                }
            }
            else
            {
                this.Alert("删除参数无效");
            }
        }
Ejemplo n.º 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Bind();
            }
            BindDataLog();
            if (Request.QueryString["action"] == "ChangeOrdeNo")
            {
                string[] elemIdArray  = SubStr(Request.Form["elemId"]);
                string[] OrderNoArray = SubStr(Request.Form["OrderNo"]);
                //修改OrderNO
                bool rult = true;
                for (int i = 0; i < elemIdArray.Length; i++)
                {
                    if (new GroupBLL().UpdateGroupOrderNoById(Convert.ToInt32(elemIdArray[i]), Convert.ToInt32(OrderNoArray[i])) > 0)
                    {
                        rult = true;
                    }
                    else
                    {
                        rult = false;
                    }
                }
                if (rult == true)
                {
                    int scid = int.Parse(Request.QueryString["SchemeID"]);
                    if (scid == 104)
                    {
                        OperateRecordEntity info = new OperateRecordEntity()
                        {
                            ElemId         = 0,
                            reason         = "",
                            Status         = 1,
                            OperateFlag    = "4",
                            SourcePage     = 61,
                            OperateType    = "5",
                            OperateExplain = "专题列表位置排序",
                            OperateContent = "专题列表位置排序",
                            UserName       = GetUserName(),
                        };
                        new OperateRecordBLL().Insert(info);
                    }

                    Response.Write("保存成功!");
                    Response.End();
                }
                else
                {
                    Response.Write("保存失败!");
                    Response.End();
                }
            }
        }
        protected void lbtnMoveIndex_Command(object sender, CommandEventArgs e)
        {
            int groupElemID = Convert.ToInt32(e.CommandName);

            if (groupElemID > 0)
            {
                GroupElemsEntity groupElem = new GroupBLL().GetGroupElemByID(groupElemID);
                if (groupElem != null)
                {
                    string strWhere = "";
                    string strOrder = "OrderNo";
                    int    posId    = Tools.GetRequestVal("PosID", -1);
                    string cmd      = e.CommandArgument.ToString();
                    if (cmd == "up") // 上移
                    {
                        strWhere  = string.Format("OrderNo < {0} and status=1", groupElem.OrderNo);
                        strOrder += " desc";
                    }
                    else // 下移
                    {
                        strWhere = string.Format("OrderNo > {0} and status=1", groupElem.OrderNo);
                    }
                    strWhere += string.Format(" and GroupID={0} and PosID={1}", groupElem.GroupID, posId);

                    List <GroupElemsEntity> groupElemList = new GroupBLL().GetList(1, strWhere, strOrder);

                    if (groupElemList != null && groupElemList.Count > 0)
                    {
                        Dictionary <int, int> orderNoDic = new Dictionary <int, int>();
                        orderNoDic.Add(groupElem.GroupElemID, groupElemList[0].OrderNo);
                        orderNoDic.Add(groupElemList[0].GroupElemID, groupElem.OrderNo);
                        new GroupBLL().UpdateElemOrder(orderNoDic);
                        if (SchemeID == 104)
                        {
                            OperateRecordEntity info = new OperateRecordEntity()
                            {
                                ElemId         = 0,
                                reason         = "",
                                Status         = 1,
                                OperateFlag    = "4",
                                OperateType    = "1",
                                OperateExplain = "首页位置排序",
                                OperateContent = "首页位置排序(Banner)",
                                SourcePage     = 60,
                                UserName       = GetUserName(),
                            };
                            new OperateRecordBLL().Insert(info);
                        }
                        Bind(); // 重新绑定页面
                    }
                }
            }
        }
        protected void DelItem(object s, CommandEventArgs e)
        {
            int id = Tools.GetInt(e.CommandArgument, 0);

            GroupElemsEntity entity = new GroupBLL().GetGroupElemByID(id);

            if (new GroupBLL().DeleteElem(id))
            {
                if (SchemeID == 104)
                {
                    OperateRecordEntity info = new OperateRecordEntity()
                    {
                        ElemId         = id,
                        reason         = "",
                        Status         = 1,
                        OperateFlag    = "3",
                        OperateType    = "1",
                        OperateExplain = "首页推荐位删除",
                        SourcePage     = 60,
                        UserName       = GetUserName(),
                    };
                    if (entity.PosID == 1)
                    {
                        info.OperateContent = entity.RecommTitle + "(Bnaner)";
                    }
                    else
                    {
                        if (entity.ShowType == 1)
                        {
                            info.OperateContent = entity.RecommTitle + "(广告位)";
                        }
                        else
                        {
                            info.OperateContent = entity.RecommTitle + "(推荐位)";
                        }
                    }
                    new OperateRecordBLL().Insert(info);
                }
                new SyncManagerBLL().NewRedis();

                this.Alert("删除成功!");
                Response.Redirect("HomePageRecommendByAppCenterList.aspx?acttype=" + GroupTypeID + "," + SchemeID + "&page=" + PageType);
                Response.End();
                Bind();
            }
            else
            {
                this.Alert("删除失败");
            }
        }
Ejemplo n.º 7
0
        protected void OnDel(object s, CommandEventArgs e)
        {
            int id = nwbase_sdk.Tools.GetInt(e.CommandArgument, 0);

            if (id > 0)
            {
                GroupInfoEntity entity = new GroupBLL().GetGroupInfoByID(id);
                if (entity.GroupTypeID > GroupTypeID)
                {
                    this.Alert("删除操作无效");
                }
                else
                {
                    var result = new GroupBLL().DeleteInfo(id);
                    if (result)
                    {
                        if (SchemeID == 104)
                        {
                            OperateRecordEntity info = new OperateRecordEntity()
                            {
                                ElemId         = entity.GroupID,
                                reason         = "",
                                Status         = 1,
                                OperateFlag    = "3",
                                SourcePage     = 61,
                                OperateType    = "5",
                                OperateExplain = "删除专题",
                                OperateContent = "删除专题(" + entity.GroupName + ")",
                                UserName       = GetUserName(),
                            };
                            new OperateRecordBLL().Insert(info);
                        }
                        this.Alert("删除成功");
                        BindDataLog();
                        Bind();
                    }
                    else
                    {
                        this.Alert("删除失败");
                    }
                }
            }
            else
            {
                this.Alert("删除参数无效");
            }
        }
        private void Update()
        {
            GroupElemsEntity entity = new GroupElemsEntity();

            entity.GroupElemID  = this.GroupElemID;
            entity.ElemID       = this.ElemID.Value.Convert <int>(0);
            entity.RecommTitle  = this.RecommTitle.Value.Trim();
            entity.RecommPicUrl = this.MainIconPicUrl.Value.Trim();
            entity.RecommWord   = this.RecommWord.Text;
            entity.RecommVal    = this.RecommVal.Value.Convert <int>(0);
            entity.Status       = this.Status.SelectedValue.Convert <int>(0);
            entity.Remarks      = this.Remarks.Text.Trim();



            bool result = new GroupBLL().UpdateLauncherRecommend(entity);

            if (result)
            {
                if (SchemeID == 104)
                {
                    OperateRecordEntity info = new OperateRecordEntity()
                    {
                        ElemId         = entity.ElemID,
                        reason         = "",
                        Status         = 1,
                        OperateFlag    = "2",
                        SourcePage     = 65,
                        OperateType    = "9",
                        OperateExplain = "热门游戏管理:编辑游戏",
                        OperateContent = new AppInfoBLL().GetSingle(entity.ElemID).ShowName,
                        UserName       = GetUserName(),
                    };
                    new OperateRecordBLL().Insert(info);
                }
                //this.Alert("更新成功"); Response.Redirect(string.Format("LauncherRecommendList.aspx?acttype={0}&page={1}", ActType, PageType));
                this.Alert("更新成功", Request.ApplicationPath + string.Format("LauncherRecommendList.aspx?acttype={0}&page={1}", ActType, PageType));
                //Response.Redirect(Request.Url. "/LauncherRecommendList.aspx");
                //Response.Redirect(Request.Url.AbsolutePath + string.Format("?acttype={0}", ActType));
            }
            else
            {
                this.Alert("更新失败");
            }
        }
Ejemplo n.º 9
0
        private List <MySqlParameter> GetMySqlParameters(OperateRecordEntity entity)
        {
            List <MySqlParameter> paramsList = new List <MySqlParameter>();

            paramsList.Add(new MySqlParameter("@Id", entity.Id));
            paramsList.Add(new MySqlParameter("@ElemId", entity.ElemId));
            paramsList.Add(new MySqlParameter("@OperateTime", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")));
            paramsList.Add(new MySqlParameter("@UserName", entity.UserName));
            paramsList.Add(new MySqlParameter("@OperateType", entity.OperateType));
            paramsList.Add(new MySqlParameter("@OperateFlag", entity.OperateFlag));
            paramsList.Add(new MySqlParameter("@SourcePage", entity.SourcePage));
            paramsList.Add(new MySqlParameter("@OperateExplain", entity.OperateExplain));
            paramsList.Add(new MySqlParameter("@OperateContent", entity.OperateContent));
            paramsList.Add(new MySqlParameter("@reason", entity.reason));
            paramsList.Add(new MySqlParameter("@CreateTime", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")));
            paramsList.Add(new MySqlParameter("@Status", entity.Status));
            return(paramsList);
        }
 /// <summary>
 /// 操作日志
 /// </summary>
 public void UpdateLog(int SchemeID, string name)
 {
     if (SchemeID == 104)
     {
         OperateRecordEntity info = new OperateRecordEntity()
         {
             ElemId         = 0,
             reason         = "",
             Status         = 1,
             OperateFlag    = "3",
             OperateType    = "1",
             OperateExplain = "首页推荐位排序",
             OperateContent = "首页推荐位排序",
             SourcePage     = 60,
             UserName       = name
         };
         new OperateRecordBLL().Insert(info);
     }
 }
 public void AddLog(int elemId, int SchemeID, int GroupTypeID, string username)
 {
     if (SchemeID == 104)
     {
         if (GroupTypeID == 4108)
         {
             OperateRecordEntity info = new OperateRecordEntity()
             {
                 ElemId         = elemId,
                 reason         = "",
                 Status         = 1,
                 OperateFlag    = "3",
                 SourcePage     = 65,
                 OperateType    = "9",
                 OperateExplain = "热门游戏管理: 删除游戏",
                 OperateContent = new GroupBLL().GetGroupElemByID(elemId).RecommTitle,
                 UserName       = username,
             };
             new OperateRecordBLL().Insert(info);
         }
     }
 }
Ejemplo n.º 12
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (this.AppID != 0)
                {
                    if (new AppInfoBLL().Delete(this.AppID))
                    {
                        AppInfoEntity       entity = new AppInfoBLL().GetSingle(AppID);
                        OperateRecordEntity info   = new OperateRecordEntity()
                        {
                            ElemId         = AppID,
                            reason         = "",
                            Status         = 1,
                            OperateFlag    = "3",
                            OperateType    = "2",
                            OperateExplain = "删除游戏",
                            SourcePage     = 1,
                            OperateContent = entity.ShowName,
                            UserName       = GetUserName(),
                        };
                        new OperateRecordBLL().Insert(info);
                        this.Alert("删除成功");
                    }
                    else
                    {
                        this.Alert("删除失败");
                    }
                }

                this.BindAppType();
            }


            BindData();
        }
Ejemplo n.º 13
0
        /// <summary>
        /// 新增信息
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public int Insert(OperateRecordEntity entity)
        {
            #region CommandText

            string commandText = @" INSERT INTO OperateRecord (
                                                        ElemId,
                                                        UserName,
                                                        OperateType,
                                                        OperateFlag,
                                                         SourcePage,
                                                        OperateExplain,
                                                        OperateContent,
                                                        reason,
                                                        Status
                                                    ) 
                                                    VALUES
                                                        (
                                                           @ElemId,
                                                           @UserName,
                                                           @OperateType,
                                                           @OperateFlag,
                                                            @SourcePage,
                                                           @OperateExplain,
                                                           @OperateContent,
                                                           @reason,
                                                           @Status
                                                        ); SELECT LAST_INSERT_ID(); ";

            #endregion

            List <MySqlParameter> paramsList = this.GetMySqlParameters(entity);

            int result = MySqlHelper.ExecuteScalar(this.ConnectionString, commandText, paramsList.ToArray()).Convert <int>();

            return(result);
        }
Ejemplo n.º 14
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            CurrentEntity = new AppInfoiosBLL().GetSingle(this.AppID);
            try
            {
                AppInfoiosEntity appInfoios = new AppInfoiosEntity();
                appInfoios.AppID   = this.AppID;
                appInfoios.AppName = this.AppName.Text.Trim();

                appInfoios.RecommFlagWord = this.RecommFlagWord.Text.Trim();
                appInfoios.AppType        = this.AppType.Text.Trim();
                appInfoios.AppSize        = this.AppSize.Text.Trim();
                appInfoios.AppPrice       = this.AppPrice.Text.Trim();
                appInfoios.AppVersion     = this.AppVersion.Text.Trim();
                appInfoios.ThumbPicUrl    = this.ThumbPicUrl.Value;

                appInfoios.ShowName   = this.ShowName.Text.Trim();
                appInfoios.DevName    = this.DevName.Text.Trim();
                appInfoios.RecommWord = this.RecommWord.Text.Trim();
                appInfoios.IconPicUrl = this.IconUrl.Value;
                appInfoios.AppDesc    = this.AppDesc.Text.Trim();
                appInfoios.Remarks    = this.Remarks.Text.Trim();
                appInfoios.Status     = this.Status.SelectedValue.Convert <int>();
                appInfoios.AppUrl     = this.AppUrl.Text.Trim();
                appInfoios.AdsPicUrl  = this.AdsPicUrl.Value;
                appInfoios.AppPicUrl  = (this.AppPicUrl == "") ? CurrentEntity.AppPicUrl : this.AppPicUrl;


                this.X1     = Math.Round(this.Request.Params["x1"].Convert <double>(0));
                this.X2     = Math.Round(this.Request.Params["x2"].Convert <double>(0));
                this.Y1     = Math.Round(this.Request.Params["y1"].Convert <double>(0));
                this.Y2     = Math.Round(this.Request.Params["y2"].Convert <double>(0));
                this.Width  = Math.Round(this.Request.Params["w"].Convert <double>(0));
                this.Height = Math.Round(this.Request.Params["h"].Convert <double>(0));



                #region 处理缩略图
                if (!string.IsNullOrEmpty(appInfoios.IconPicUrl))
                {
                    if (this.Width != 0 && this.Height != 0)
                    {
                        //裁剪方式
                        string croptype = this.Request <string>("cropType", string.Empty);

                        Bitmap bitSource = ImageHelper.GetBitmapFromUrl(appInfoios.IconPicUrl);

                        if (bitSource == null)
                        {
                            this.Alert("远程图片解析失败,请刷新后再试");
                            return;
                        }


                        int rX = Convert.ToInt32(Math.Round(this.X1, MidpointRounding.AwayFromZero));
                        int rY = Convert.ToInt32(Math.Round(this.Y1, MidpointRounding.AwayFromZero));
                        int rW = Convert.ToInt32(Math.Round(this.Width, MidpointRounding.AwayFromZero));
                        int rH = Convert.ToInt32(Math.Round(this.Height, MidpointRounding.AwayFromZero));

                        bitSource = ImageHelper.KiCut(bitSource, rX, rY, rW, rH);

                        if (croptype == "hengping")
                        {
                            bitSource = ImageHelper.ImageCompress(bitSource, 260, 195);
                        }
                        else
                        {
                            bitSource = ImageHelper.ImageCompress(bitSource, 195, 260);
                        }

                        UploadFile up = new UploadFile();

                        byte[] imageBytes = BitmapToBytes(bitSource);
                        //StartTransfer中的AppID和CID在前端页面中上传控件定义
                        string token        = up.StartTransfer(2, 11, appInfoios.IconPicUrl.Substring(appInfoios.IconPicUrl.LastIndexOf("."), 4), 1, imageBytes.Length, string.Empty);
                        string resultString = up.Transfer(token, imageBytes, 1);

                        appInfoios.IconPicUrl = resultString.Split(',')[1];

                        //up.GenerateThumb(appInfo.ThumbPicUrl, 0);
                        up.GenerateThumb(token);

                        bitSource.Dispose();
                    }
                }
                #endregion

                if (string.IsNullOrEmpty(appInfoios.AppName))
                {
                    this.Alert("资料不完整,请完善后再试");
                    return;
                }


                //写入数据库
                bool result = new AppInfoiosBLL().Update(appInfoios);

                //判断是否修改成功
                if (result)
                {
                    OperateRecordEntity info = new OperateRecordEntity()
                    {
                        ElemId         = appInfoios.AppID,
                        reason         = "",
                        Status         = 1,
                        OperateFlag    = "2",
                        OperateType    = "2",
                        OperateExplain = "修改IOS游戏信息",
                        SourcePage     = 1,
                        OperateContent = appInfoios.ShowName,
                        UserName       = GetUserName(),
                    };
                    new OperateRecordBLL().Insert(info);
                    this.Response.Redirect(string.Format("IosAppInfoList.aspx?AppID={0}&ShowName={1}", this.AppID, appInfoios.ShowName));
                    this.Alert("操作成功", string.Format("IosAppInfoEdit.aspx"));
                }
                else
                {
                    this.Alert("操作失败");
                }
            }
            catch (Exception ex)
            {
                nwbase_utils.TextLog.Default.Error(ex.Message);
                throw ex;
            }
        }
Ejemplo n.º 15
0
 /// <summary>
 /// 新增信息
 /// </summary>
 /// <param name="entity"></param>
 /// <returns></returns>
 public int Insert(OperateRecordEntity entity)
 {
     return(new OperateRecordDAL().Insert(entity));
 }
Ejemplo n.º 16
0
        //public string AppInfo { get { return this.Request<string>("AppInfo"); } }

        //http://localhost:16436/API/InsertAppInfo.aspx
        //{"AppId":"10003","AppName":"游戏名","PackName":"包名","ChannelAdaptation":"渠道","DevName":"开发者","userName":"******"}
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string      rult    = "";
                HttpRequest request = HttpContext.Current.Request;
                if (request != null && request.InputStream != null && request.InputStream.Length > 0)
                {
                    byte[] buffer = new byte[request.InputStream.Length];
                    request.InputStream.Read(buffer, 0, (int)request.InputStream.Length);
                    string str = System.Text.Encoding.UTF8.GetString(buffer);
                    JavaScriptSerializer js   = new JavaScriptSerializer();     //实例化一个能够序列化数据的类
                    ToJsonMy             list = js.Deserialize <ToJsonMy>(str); //将json数据转化为对象类型并赋值给list
                    //nwbase_utils.TextLog.Default.Info(str);
                    if (list.AppId > 10000 && list.AppId < 100000)
                    {
                        int count = new AppInfoBLL().GetCountById(list.AppId);
                        if (count == 0)
                        {
                            AppInfoEntity appInfo = new AppInfoEntity();

                            appInfo.AppID = list.AppId;
                            //主安装包ID
                            appInfo.MainPackID = 0;
                            //应用名称
                            appInfo.AppName = list.AppName;
                            //显示名称
                            appInfo.ShowName = list.AppName;
                            //适用设备类型,定义:1=手机,2=平板,4=...位运算
                            appInfo.ForDeviceType = 1;
                            //包名
                            appInfo.PackName = list.PackName;
                            //包签名
                            appInfo.PackSign = string.Empty;
                            //开发者ID
                            appInfo.CPID = 0;
                            //分发类型:1=不分渠道,2=分渠道分发
                            appInfo.IssueType = 0;
                            //多个渠道号,只有当IssueType=2时生效。逗号分隔,首尾要加上逗号
                            appInfo.ChannelNos        = string.Empty;
                            appInfo.ChannelAdaptation = "," + list.ChannelAdaptation.ToString() + ",";
                            //开发者名
                            appInfo.DevName = list.DevName;
                            //应用分类
                            appInfo.AppClass = 1;
                            //是否网游,定义:1=网游,2=单机
                            appInfo.IsNetGame = 1;
                            //邪恶等级,1~5表示从纯洁到邪恶
                            appInfo.EvilLevel = 0;
                            //推荐值,0~10代表从不推荐到推荐
                            appInfo.RecommLevel = 0;
                            //推荐语
                            appInfo.RecommWord = string.Empty;
                            //缩略图URL
                            appInfo.ThumbPicUrl = string.Empty;
                            //应用描述
                            appInfo.AppDesc = string.Empty;
                            //搜索关键字
                            appInfo.SearchKeys = string.Empty;
                            //下载量,定期更新(不影响更新时间)
                            appInfo.DownTimes = 0;
                            //备注
                            appInfo.Remarks = string.Empty;
                            //状态:状态,定义:1=正常,2=禁用,3=删除,4=接入中 ,5=测试中,6=待审核,12=数据异常,22=控制禁用  ,99=自动获取待上传的, 98=自动获取后删除的
                            appInfo.Status = 4;
                            //主版本号
                            appInfo.MainVerName = string.Empty;
                            //主版本代码
                            appInfo.MainVerCode = 0;
                            //签名特征码
                            appInfo.MainSignCode = string.Empty;
                            //主ICON图URL地址
                            appInfo.MainIconUrl = string.Empty;
                            //推荐标签,编辑指定,1=推荐,2=热门,4=官方...位运算
                            appInfo.RecommTag = 0;
                            //分发类型:1=不分渠道,2=分渠道分发
                            //appInfo.IssueType = this.IssueType.SelectedValue.Convert<int>(1);
                            //联运游戏ID
                            appInfo.UAppID = 0;
                            //应用类型
                            appInfo.AppType = 1204;
                            //数据状态,定义:1=正常,2=异常

                            appInfo.DataStatus = 2;

                            appInfo.CoopType = 1;
                            new AppInfoBLL().Insert(appInfo);
                            if (new AppInfoBLL().GetCountById(list.AppId) > 0)
                            {
                                OperateRecordEntity info = new OperateRecordEntity()
                                {
                                    ElemId         = list.AppId,
                                    reason         = "",
                                    Status         = 1,
                                    OperateFlag    = "1",
                                    OperateExplain = "接入游戏",
                                    UserName       = list.userName
                                };
                                new OperateRecordBLL().Insert(info);
                                rult = "{\"result\":\"0\",\"msg\":\"添加成功\"}";
                            }
                            else
                            {
                                rult = "{\"result\":\"1\",\"msg\":\"添加失败\"}";
                            }
                        }
                        else
                        {
                            rult = "{\"result\":\"2\",\"msg\":\"游戏已存在\"}";
                        }
                    }
                    else
                    {
                        rult = "{\"result\":\"3\",\"msg\":\"游戏Id范围不正确\"}";
                    }
                }

                Response.Write(rult);
                Response.End();
            }
        }
Ejemplo n.º 17
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();
     }
 }
Ejemplo n.º 18
0
        protected void OnSave_Click(object sender, EventArgs e)
        {
            var currentEntity = new GroupElemsEntity();

            currentEntity.GroupID      = GroupID;
            currentEntity.GroupElemID  = GroupElementID;
            currentEntity.ElemID       = nwbase_sdk.Tools.GetInt(hfAppID.Value, 0);
            currentEntity.ElemType     = 1;
            currentEntity.RecommPicUrl = hfIconUrl.Value;
            currentEntity.RecommTitle  = txtShowName.Text;
            currentEntity.RecommWord   = txtRecommWord.Text;
            currentEntity.StartTime    = DateTime.ParseExact(txtStartTime.Text, "yyyy-MM-dd HH:mm", System.Globalization.CultureInfo.CurrentCulture);
            currentEntity.EndTime      = DateTime.ParseExact(txtEndTime.Text, "yyyy-MM-dd HH:mm", System.Globalization.CultureInfo.CurrentCulture);
            currentEntity.Status       = nwbase_sdk.Tools.GetInt(ddlStatus.SelectedValue, 1);

            currentEntity.Remarks = string.Empty;

            currentEntity.PosID = txtPosID.Text.Trim().Convert <int>(0);

            //判断同一分组,位置编号是否重复
            bool answer = new GroupBLL().IsExistPosID(currentEntity);

            if (answer)
            {
                this.Alert("位置编号不能重复");
                return;
            }
            if (txtPosID.Text.Trim().Convert <int>(0) < 1)
            {
                this.Alert("位置编号不能小于1");
                return;
            }
            if (txtPosID.Text.Trim().Convert <int>(0) > 500)
            {
                this.Alert("位置编号不能大于500");
                return;
            }

            bool result = false;

            if (GroupElementID <= 0)
            {
                //新增
                // 如果同一分组内存在相同元素
                if (new GroupElemsBLL().ExistSameElementIDInGroup(currentEntity.GroupID, currentEntity.ElemID))
                {
                    this.Alert("此分组存在相同元素...");
                    return;
                }
                result = new GroupElemsBLL().InsertGroupElement(currentEntity);
                if (SchemeID == 104)
                {
                    OperateRecordEntity info = new OperateRecordEntity()
                    {
                        ElemId         = 0,
                        reason         = "",
                        Status         = 1,
                        OperateFlag    = "1",
                        OperateContent = GroupName + "(" + new AppInfoBLL().GetSingle(currentEntity.ElemID).ShowName + ")",
                        UserName       = GetUserName(),
                    };
                    if (GroupID != 93 && GroupID != 94)
                    {
                        info.SourcePage     = 62;
                        info.OperateType    = "6";
                        info.OperateExplain = "分类列表:新增游戏";
                    }
                    else
                    {
                        if (GroupID == 93)
                        {
                            info.SourcePage     = 63;
                            info.OperateType    = "7";
                            info.OperateExplain = "游戏排行: 新增游戏";
                        }
                        else if (GroupID == 94)
                        {
                            info.SourcePage     = 64;
                            info.OperateType    = "8";
                            info.OperateExplain = "最新游戏: 新增游戏";
                        }
                    }
                    new OperateRecordBLL().Insert(info);
                }
            }
            else
            {
                // 修改
                result = new GroupBLL().BeginnerRecommendUpdate(currentEntity);
                if (SchemeID == 104)
                {
                    OperateRecordEntity info = new OperateRecordEntity()
                    {
                        ElemId         = GroupElementID,
                        reason         = "",
                        Status         = 1,
                        OperateFlag    = "2",
                        OperateContent = GroupName + "(" + new AppInfoBLL().GetSingle(currentEntity.ElemID).ShowName + ")",
                        UserName       = GetUserName(),
                    };
                    if (GroupID != 93 && GroupID != 94)
                    {
                        info.SourcePage     = 62;
                        info.OperateType    = "6";
                        info.OperateExplain = "分类列表:编辑游戏";
                    }
                    else
                    {
                        if (GroupID == 93)
                        {
                            info.SourcePage     = 63;
                            info.OperateType    = "7";
                            info.OperateExplain = "游戏排行: 编辑游戏";
                        }
                        else if (GroupID == 94)
                        {
                            info.SourcePage     = 64;
                            info.OperateType    = "8";
                            info.OperateExplain = "最新游戏: 编辑游戏";
                        }
                    }
                    new OperateRecordBLL().Insert(info);
                }
            }

            if (result)
            {
                this.Alert("保存成功", string.Format("GroupElement.aspx?GroupID=" + GroupID + "&GroupName=" + GroupName + "&SchemeID=" + SchemeID + "&page=" + PageType));
            }
            else
            {
                this.Alert("保存失败!");
            }
        }
        private void Edit()
        {
            this.CurrentEntity        = new GroupElemsEntity();
            CurrentEntity.GroupElemID = this.Id.Convert <int>(0);
            CurrentEntity.GroupID     = new GroupBLL().HomePageRecommendGetGroupId(this.GroupTypeID, this.SchemeID);
            CurrentEntity.PosID       = this.PosID;
            CurrentEntity.ElemType    = this.ElemType.SelectedValue.Convert <int>(1);
            CurrentEntity.GroupType   = this.GroupType.Value.Convert <int>(0);
            CurrentEntity.OrderNo     = this.OrderNo;
            CurrentEntity.ShowType    = this.ShowType.SelectedValue.Convert <int>(0);

            //跳转至单机或网游时元素ID为0
            if (this.ElemType.SelectedValue == "4")
            {
                CurrentEntity.ElemID    = 0;
                CurrentEntity.GroupType = this.Request <int>("gameType", 0);
            }
            else
            {
                CurrentEntity.ElemID = this.ElemID.Value.Convert <int>(0);
            }

            //if (CurrentEntity.ShowType == 0)
            //{
            //    CurrentEntity.RecommPicUrl = this.MainIconPicUrl.Value;
            //}
            //else if (CurrentEntity.ShowType == 1)
            //{
            //    CurrentEntity.RecommPicUrl = this.RecommPicUrl.Value;
            //}
            //else
            //{
            //    CurrentEntity.RecommPicUrl = string.Empty;
            //}
            CurrentEntity.RecommPicUrl = this.RecommPicUrl.Value;
            if (this.RecommPicUrl.Value.Trim() == "")
            {
                CurrentEntity.RecommPicUrl = this.MainIconPicUrl.Value;
            }
            CurrentEntity.StartTime   = this.StartTime.Text.Trim().Convert <DateTime>(DateTime.Now);
            CurrentEntity.EndTime     = this.EndTime.Text.Trim().Convert <DateTime>(DateTime.Now.AddDays(7));
            CurrentEntity.RecommTitle = this.RecommTitle.Text.Trim();
            CurrentEntity.RecommTag   = GetRecommTag();
            CurrentEntity.RecommWord  = this.RecommWord.Text.Trim();
            CurrentEntity.RecommTag   = GetRecommTag();
            CurrentEntity.Status      = this.Status.SelectedValue.Convert <int>(0);
            CurrentEntity.Remarks     = this.Remarks.Text.Trim();



            bool result = new GroupElemsBLL().Update(CurrentEntity);

            if (result)
            {
                if (SchemeID == 104)
                {
                    OperateRecordEntity info = new OperateRecordEntity()
                    {
                        ElemId         = CurrentEntity.GroupElemID,
                        reason         = "",
                        Status         = 1,
                        OperateFlag    = "2",
                        OperateType    = "1",
                        OperateExplain = "首页推荐位修改",
                        SourcePage     = 60,
                        UserName       = GetUserName(),
                    }; if (CurrentEntity.PosID == 1)
                    {
                        info.OperateContent = CurrentEntity.RecommTitle + "(Bnaner)";
                    }
                    else
                    {
                        if (CurrentEntity.ShowType == 1)
                        {
                            info.OperateContent = CurrentEntity.RecommTitle + "(广告位)";
                        }
                        else
                        {
                            info.OperateContent = CurrentEntity.RecommTitle + "(推荐位)";
                        }
                    }
                    new OperateRecordBLL().Insert(info);
                }

                this.Alert("修改成功", string.Format("HomePageRecommendByAppCenterList.aspx?acttype={0},{1}&page={2}", this.GroupTypeID, this.SchemeID, this.PageType));
            }
            else
            {
                this.Alert("修改失败");
            }
        }
Ejemplo n.º 20
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         string ac = Request.QueryString["ac"];
         if (ac == "getrecord")
         {
             int id = Int32.Parse(Request.QueryString["id"]);
             if (id > 0)
             {
                 List <OperateRecordEntity> list = new OperateRecordBLL().GetListByAppId(id);
                 var list2 = list.Select(a => new { UserName = a.UserName, OperateExplain = a.OperateExplain, OperateTime = a.OperateTime.ToString("yyyy-MM-dd HH:mm:ss"), reason = a.reason }).ToList();
                 //javascript序列化器
                 JavaScriptSerializer jss = new JavaScriptSerializer();
                 //序列化学生集合对象得到json字符
                 string strJson = jss.Serialize(list2);
                 Response.Write(strJson);
                 Response.End();
             }
         }
         else if (ac == "isexist")
         {
             int id = Int32.Parse(Request.QueryString["id"]);
             if (id > 0)
             {
                 if (new AppInfoBLL().IsExistGroupElems(id))
                 {
                     Response.Write("1");
                     Response.End();
                 }
                 else
                 {
                     Response.Write("0");
                     Response.End();
                 }
             }
         }
         else if (ac == "update")
         {
             int           actype2 = int.Parse(Request.QueryString["actype"]);
             int           status  = int.Parse(Request.QueryString["status"]);
             int           id      = int.Parse(Request.QueryString["id"]);
             AppInfoEntity entity  = new AppInfoBLL().GetSingle(id);
             if (entity == null)
             {
                 entity.ShowName = "";
                 entity.PackName = "";
             }
             if (status == 1)
             {
                 string th = Request.QueryString["type"];
                 if (new AppInfoBLL().UpdateStatus(id, status))
                 {
                     OperateRecordEntity info = new OperateRecordEntity();
                     if (th == "th")
                     {
                         info.OperateType    = "3";
                         info.OperateFlag    = "1";
                         info.OperateExplain = "游戏审核通过";
                         info.OperateContent = entity.ShowName + "(" + entity.PackName + ")";
                         info.reason         = "";
                         info.ElemId         = id;
                         info.SourcePage     = actype2;
                         info.Status         = 1;
                         info.UserName       = GetUserName();
                     }
                     else
                     {
                         info.OperateType    = "2";
                         info.OperateFlag    = "6";
                         info.OperateExplain = "重新上架架游戏";
                         info.OperateContent = entity.ShowName + "(" + entity.PackName + ")";
                         info.reason         = "";
                         info.ElemId         = id;
                         info.SourcePage     = actype2;
                         info.Status         = 1;
                         info.UserName       = GetUserName();
                     }
                     new OperateRecordBLL().Insert(info);
                 }
             }
             else if (status == 2)
             {
                 string reason = Request.QueryString["reason"];
                 string th     = Request.QueryString["type"];
                 if (th == "th")
                 {
                     status = 7;
                     if (new AppInfoBLL().UpdateStatus(id, status))
                     {
                         OperateRecordEntity info = new OperateRecordEntity();
                         info.OperateType    = "3";
                         info.OperateFlag    = "2";
                         info.OperateExplain = "游戏审核不通过";
                         info.OperateContent = entity.ShowName + "(" + entity.PackName + ")";
                         info.reason         = reason;
                         info.ElemId         = id;
                         info.SourcePage     = actype2;
                         info.Status         = 1;
                         info.UserName       = GetUserName();
                         new OperateRecordBLL().Insert(info);
                     }
                 }
                 else
                 {
                     status = 2;
                     if (new AppInfoBLL().IsExistGroupElems(id))
                     {
                         new AppInfoBLL().DelGroupElems(id);
                     }
                     if (new AppInfoBLL().UpdateStatus(id, status))
                     {
                         OperateRecordEntity info = new OperateRecordEntity();
                         info.OperateType    = "2";
                         info.OperateFlag    = "5";
                         info.OperateExplain = "下架游戏";
                         info.OperateContent = entity.ShowName + "(" + entity.PackName + ")";
                         info.reason         = reason;
                         info.ElemId         = id;
                         info.SourcePage     = actype2;
                         info.Status         = 1;
                         info.UserName       = GetUserName();
                         new OperateRecordBLL().Insert(info);
                     }
                 }
             }
             else if (status == 4)
             {
                 if (new AppInfoBLL().UpdateStatus(id, status))
                 {
                     OperateRecordEntity info = new OperateRecordEntity()
                     {
                         ElemId         = id,
                         reason         = "",
                         Status         = 1,
                         OperateType    = "4",
                         OperateFlag    = "1",
                         SourcePage     = actype2,
                         OperateExplain = "修改游戏状态为接入中",
                         OperateContent = entity.ShowName + "(" + entity.PackName + ")",
                         UserName       = GetUserName(),
                     };
                     new OperateRecordBLL().Insert(info);
                 }
             }
             else if (status == 5)
             {
                 if (new AppInfoBLL().UpdateStatus(id, status))
                 {
                     OperateRecordEntity info = new OperateRecordEntity()
                     {
                         ElemId         = id,
                         reason         = "",
                         Status         = 1,
                         OperateFlag    = "2",
                         SourcePage     = actype2,
                         OperateType    = "4",
                         OperateExplain = "修改游戏状态为测试中",
                         OperateContent = entity.ShowName + "(" + entity.PackName + ")",
                         UserName       = GetUserName(),
                     };
                     new OperateRecordBLL().Insert(info);
                 }
             }
             else if (status == 6)
             {
                 if (new AppInfoBLL().UpdateStatus(id, status))
                 {
                     OperateRecordEntity info = new OperateRecordEntity()
                     {
                         ElemId         = id,
                         reason         = "",
                         Status         = 1,
                         SourcePage     = actype2,
                         OperateFlag    = "3",
                         OperateType    = "4",
                         OperateExplain = "提交游戏审核",
                         OperateContent = entity.ShowName + "(" + entity.PackName + ")",
                         UserName       = GetUserName(),
                     };
                     new OperateRecordBLL().Insert(info);
                 }
                 //Response.Redirect("http://localhost:16436/AppInfoListNew.aspx?Action=3");
                 Response.Write("1");
                 Response.End();
             }
         }
         else if (ac == "updateappinfo")
         {
             int           status  = int.Parse(Request.QueryString["status"]);
             int           id      = int.Parse(Request.QueryString["id"]);
             int           arch    = int.Parse(Request.QueryString["arch"]);
             string        reason  = Request.QueryString["reason"].ToString();
             int           actype2 = int.Parse(Request.QueryString["actype"]);
             AppInfoEntity entity  = new AppInfoBLL().GetSingle(id);
             if (entity == null)
             {
                 entity.ShowName = "";
                 entity.PackName = "";
             }
             if (new AppInfoBLL().UpdateStatus(id, status) && new AppInfoBLL().UpdateArch(id, arch))
             {
                 OperateRecordEntity info = new OperateRecordEntity()
                 {
                     ElemId      = id,
                     reason      = reason,
                     Status      = 1,
                     SourcePage  = actype2,
                     OperateType = "2",
                     UserName    = GetUserName(),
                 };
                 if (status == 1)
                 {
                     info.OperateFlag    = "6";
                     info.OperateContent = entity.ShowName + "(" + entity.PackName + "),机型适配:" + BindArch(arch);
                     info.OperateExplain = "上架游戏";
                 }
                 else if (status == 2)
                 {
                     info.OperateFlag    = "5";
                     info.OperateContent = entity.ShowName + "(" + entity.PackName + ")";
                     info.OperateExplain = "下架游戏";
                 }
                 new OperateRecordBLL().Insert(info);
                 Response.Write("修改成功");
                 Response.End();
             }
             else
             {
                 Response.Write("修改失败");
                 Response.End();
             }
             Response.Write("修改失败");
             Response.End();
         }
         else
         {
             BindData2(actype);
             BindDataLog();
         }
     }
 }
Ejemplo n.º 21
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                AppInfoiosEntity appInfoios = new AppInfoiosEntity()
                {
                    //应用ID
                    AppID = this.AppID,
                    //应用名称
                    AppName = this.AppName.Text.Trim(),
                    //显示名称
                    ShowName = this.ShowName.Text.Trim(),
                    //开发商名称
                    DevName = this.DevName.Text.Trim(),
                    //应用类型
                    AppType = this.AppType.Text.Trim(),
                    //应用大小
                    AppSize = this.AppSize.Text.Trim(),
                    //应用价格
                    AppPrice = this.AppPrice.Text.Trim(),
                    //应用版本
                    AppVersion = this.AppVersion.Text.Trim(),
                    //应用标示语
                    RecommFlagWord = this.RecommFlagWord.Text.Trim(),
                    //缩略图
                    ThumbPicUrl = this.ThumbPicUrl.Value,

                    //应用连接Url地址
                    AppUrl = this.AppUrl.Text.Trim(),
                    //应用推荐语
                    RecommWord = this.RecommWord.Text.Trim(),
                    //描述语言
                    AppDesc = this.AppDesc.Text.Trim(),

                    //Icon Url地址
                    IconPicUrl = this.Request <string>("IconPicUrl", string.Empty),
                    //IconUrl = this.IconUrl.Value,
                    //广告Urls
                    //AdsPicUrl = this.AdsUrl.Text.Trim(),
                    AdsPicUrl = this.AdsPicUrl.Value,

                    //推荐语
                    Remarks = this.Remarks.Text.Trim(),

                    //应用状态
                    Status = this.Status.SelectedValue.Convert <int>()
                };
                #region 判断数据有效性

                if (string.IsNullOrEmpty(appInfoios.ShowName))
                {
                    this.Alert("显示名称不能为空");
                    return;
                }
                else if (string.IsNullOrEmpty(appInfoios.AppName))
                {
                    this.Alert("安装包包名不能为空");
                    return;
                }
                else if (string.IsNullOrEmpty(appInfoios.IconPicUrl))
                {
                    this.Alert("Icon不能为空");
                    return;
                }

                bool result1 = false;
                //判断些应用信息是否已经存在
                result1 = new AppInfoiosBLL().IsExistAppInfo(this.AppName.Text.Trim());
                if (result1)
                {
                    this.Alert("应用已经存在");
                    return;
                }

                //iosApp信息cms后台管理
                string[] appPicUrl  = this.Request.Params["AppPicUrl"].Split(',');
                string   str_PicUrl = "";

                //添加应用截图,URL之间用英文逗号分隔
                for (int i = 0; i < appPicUrl.Length; i++)
                {
                    str_PicUrl = str_PicUrl == "" ? appPicUrl[i] : (str_PicUrl + ',' + appPicUrl[i]);
                }

                appInfoios.AppPicUrl = str_PicUrl;

                this.X1     = Math.Round(this.Request.Params["x1"].Convert <double>(0));
                this.X2     = Math.Round(this.Request.Params["x2"].Convert <double>(0));
                this.Y1     = Math.Round(this.Request.Params["y1"].Convert <double>(0));
                this.Y2     = Math.Round(this.Request.Params["y2"].Convert <double>(0));
                this.Width  = Math.Round(this.Request.Params["w"].Convert <double>(0));
                this.Height = Math.Round(this.Request.Params["h"].Convert <double>(0));

                #endregion


                #region 处理缩略图
                if (!string.IsNullOrEmpty(appInfoios.IconPicUrl))
                {
                    if (this.Width != 0 && this.Height != 0)
                    {
                        //裁剪方式
                        string croptype = this.Request <string>("cropType", string.Empty);

                        Bitmap bitSource = ImageHelper.GetBitmapFromUrl(appInfoios.IconPicUrl);

                        if (bitSource == null)
                        {
                            this.Alert("远程图片解析失败,请刷新后再试");
                            return;
                        }


                        int rX = Convert.ToInt32(Math.Round(this.X1, MidpointRounding.AwayFromZero));
                        int rY = Convert.ToInt32(Math.Round(this.Y1, MidpointRounding.AwayFromZero));
                        int rW = Convert.ToInt32(Math.Round(this.Width, MidpointRounding.AwayFromZero));
                        int rH = Convert.ToInt32(Math.Round(this.Height, MidpointRounding.AwayFromZero));

                        bitSource = ImageHelper.KiCut(bitSource, rX, rY, rW, rH);

                        if (croptype == "hengping")
                        {
                            bitSource = ImageHelper.ImageCompress(bitSource, 260, 195);
                        }
                        else
                        {
                            bitSource = ImageHelper.ImageCompress(bitSource, 195, 260);
                        }

                        UploadFile up = new UploadFile();

                        byte[] imageBytes = BitmapToBytes(bitSource);
                        //StartTransfer中的AppID在前端页面中上传控件定义
                        string token        = up.StartTransfer(2, 11, appInfoios.IconPicUrl.Substring(appInfoios.IconPicUrl.LastIndexOf("."), 4), 1, imageBytes.Length, string.Empty);
                        string resultString = up.Transfer(token, imageBytes, 1);

                        appInfoios.IconPicUrl = resultString.Split(',')[1];

                        //up.GenerateThumb(appInfo.ThumbPicUrl, 0);
                        up.GenerateThumb(token);

                        bitSource.Dispose();
                    }
                }
                #endregion

                if (string.IsNullOrEmpty(appInfoios.AppName))
                {
                    this.Alert("资料不完整,请完善后再试");
                    return;
                }



                //写入数据库
                int result2 = new AppInfoiosBLL().Insert(appInfoios);

                if (result2 != 0)
                {
                    if (this.AppClass == "23")
                    {
                        OperateRecordEntity info = new OperateRecordEntity()
                        {
                            ElemId         = result2,
                            reason         = "",
                            Status         = 1,
                            OperateFlag    = "1",
                            OperateType    = "2",
                            OperateExplain = "新增IOS游戏",
                            SourcePage     = 1,
                            OperateContent = appInfoios.ShowName,
                            UserName       = GetUserName(),
                        };
                        new OperateRecordBLL().Insert(info);
                    }
                    this.Response.Redirect(string.Format("IosAppInfoList.aspx?AppID={0}&ShowName={1}", this.AppID, appInfoios.ShowName));
                }
                else
                {
                    this.Alert("新增失败");
                }
            }
            catch (Exception ex)
            {
                nwbase_utils.TextLog.Default.Error(ex.Message);
                throw ex;
            }
        }
Ejemplo n.º 22
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            AppInfoEntity appInfo = new AppInfoEntity();

            appInfo.AppID = this.AppID;
            //appInfo.UAppID = this.hidUAppID.Value.Convert<int>(0);
            appInfo.MainPackID        = 0;
            appInfo.AppName           = this.AppName.Text.Trim();
            appInfo.ShowName          = this.ShowName.Text.Trim();
            appInfo.Architecture      = GetArchitecture();
            appInfo.ForDeviceType     = this.ForDeviceTypeList.SelectedValue.Convert <int>(0);
            appInfo.PackName          = this.MainPackName.Value;
            appInfo.PackSign          = string.Empty;
            appInfo.CPID              = this.DevID.Value.Convert <int>(0);
            appInfo.IssueType         = Convert.ToInt32(drpIssueType.SelectedItem.Value);
            appInfo.ChannelNos        = GetChannel();
            appInfo.ChannelAdaptation = GetChannel2();
            appInfo.DevName           = this.CPName.Text.Trim();
            appInfo.AppClass          = this.AppClass.Convert <int>(11);
            appInfo.IsNetGame         = this.IsNetGame.SelectedValue.Convert <int>(0);
            appInfo.EvilLevel         = this.EvilLevel.SelectedValue.Convert <int>(0);
            appInfo.RecommLevel       = this.RecommLevel.SelectedValue.Convert <int>(0);
            appInfo.RecommWord        = this.RecommWord.Text.Trim();
            appInfo.ThumbPicUrl       = this.ThumbPicUrl.Value;
            appInfo.AppDesc           = this.AppDesc.Text.Trim();
            appInfo.SearchKeys        = this.SearchKeys.Text.Trim();
            appInfo.DownTimes         = this.DownTimes.Text.Trim().Convert <int>();
            appInfo.Remarks           = this.Remarks.Text.Trim();
            appInfo.Status            = this.Status.SelectedValue.Convert <int>();
            appInfo.MainVerName       = string.Empty;
            appInfo.MainVerCode       = 0;
            appInfo.MainSignCode      = string.Empty;
            appInfo.MainIconUrl       = string.Empty;
            appInfo.RecommTag         = GetRecommFlag();
            appInfo.AppTag            = GetTag();

            this.X1     = Math.Round(this.Request.Params["x1"].Convert <double>(0));
            this.X2     = Math.Round(this.Request.Params["x2"].Convert <double>(0));
            this.Y1     = Math.Round(this.Request.Params["y1"].Convert <double>(0));
            this.Y2     = Math.Round(this.Request.Params["y2"].Convert <double>(0));
            this.Width  = Math.Round(this.Request.Params["w"].Convert <double>(0));
            this.Height = Math.Round(this.Request.Params["h"].Convert <double>(0));


            if (string.IsNullOrEmpty(this.AppType.SelectedValue))
            {
                this.Alert("请选择分类信息");
                return;
            }

            //应用类型
            appInfo.AppType = this.AppType.SelectedValue.Convert <int>(0);

            #region 处理缩略图
            if (this.OldThumbPicUrl.Value != this.ThumbPicUrl.Value)
            {
                if (!string.IsNullOrEmpty(appInfo.ThumbPicUrl))
                {
                    if (this.Width != 0 && this.Height != 0)
                    {
                        //裁剪方式
                        string croptype = this.Request <string>("cropType", string.Empty);

                        Bitmap bitSource = ImageHelper.GetBitmapFromUrl(appInfo.ThumbPicUrl);

                        if (bitSource == null)
                        {
                            this.Alert("远程图片解析失败,请刷新后再试");
                            return;
                        }

                        int rX = Convert.ToInt32(Math.Round(this.X1, MidpointRounding.AwayFromZero));
                        int rY = Convert.ToInt32(Math.Round(this.Y1, MidpointRounding.AwayFromZero));
                        int rW = Convert.ToInt32(Math.Round(this.Width, MidpointRounding.AwayFromZero));
                        int rH = Convert.ToInt32(Math.Round(this.Height, MidpointRounding.AwayFromZero));

                        bitSource = ImageHelper.KiCut(bitSource, rX, rY, rW, rH);

                        if (croptype == "hengping")
                        {
                            bitSource = ImageHelper.ImageCompress(bitSource, 260, 195);
                        }
                        else
                        {
                            bitSource = ImageHelper.ImageCompress(bitSource, 195, 260);
                        }

                        UploadFile up = new UploadFile();

                        byte[] imageBytes = BitmapToBytes(bitSource);
                        //StartTransfer中的AppID和CID在前端页面中上传控件定义
                        string token        = up.StartTransfer(2, 11, appInfo.ThumbPicUrl.Substring(appInfo.ThumbPicUrl.LastIndexOf("."), 4), 1, imageBytes.Length, string.Empty);
                        string resultString = up.Transfer(token, imageBytes, 1);
                        appInfo.ThumbPicUrl = resultString.Split(',')[1];

                        //up.GenerateThumb(appInfo.ThumbPicUrl, 0);
                        up.GenerateThumb(token);

                        bitSource.Dispose();
                    }
                }
            }
            #endregion

            if (string.IsNullOrEmpty(appInfo.AppName))
            {
                this.Alert("资料不完整,请完善后再试");
                return;
            }


            //写入数据库
            bool result = new AppInfoBLL().Update(appInfo);

            //判断是否修改成功
            if (result)
            {
                if (this.CheckBox1.Checked == true)
                {
                    new AppCommentSummaryBLL().UpdateSummary(appInfo.AppID, appInfo.DownTimes, appInfo.RecommLevel);
                }
                if (this.AppClass == "12")
                {
                    OperateRecordEntity info = new OperateRecordEntity()
                    {
                        ElemId         = appInfo.AppID,
                        reason         = "",
                        Status         = 1,
                        OperateFlag    = "2",
                        OperateType    = "2",
                        OperateExplain = "修改游戏信息",
                        SourcePage     = 1,
                        OperateContent = appInfo.ShowName,
                        UserName       = GetUserName(),
                    };
                    new OperateRecordBLL().Insert(info);
                    this.Alert("操作成功", string.Format("GameInfoList.aspx"));
                }
                else
                {
                    this.Alert("操作成功", string.Format("AppInfoList.aspx"));
                }
            }
            else
            {
                this.Alert("操作失败");
            }
        }
Ejemplo n.º 23
0
        protected void btnNext_Click(object sender, EventArgs e)
        {
            AppInfoEntity appInfo = new AppInfoEntity();

            //主安装包ID
            appInfo.MainPackID = 0;
            //应用名称
            appInfo.AppName = this.AppName.Text.Trim();
            //显示名称
            appInfo.ShowName = this.ShowName.Text.Trim();

            //架构适配,1=arm,2=x86,...位运算
            appInfo.Architecture = GetArchitecture();

            //适用设备类型,定义:1=手机,2=平板,4=...位运算
            appInfo.ForDeviceType = this.ForDeviceTypeList.SelectedValue.Convert <int>(0);
            //包名
            appInfo.PackName = string.Empty;
            //包签名
            appInfo.PackSign = string.Empty;
            //开发者ID
            appInfo.CPID = this.DevID.Value.Convert <int>(0);
            //分发类型:1=不分渠道,2=分渠道分发
            appInfo.IssueType = Convert.ToInt32(drpIssueType.SelectedValue);
            //多个渠道号,只有当IssueType=2时生效。逗号分隔,首尾要加上逗号
            appInfo.ChannelNos        = GetChannel();
            appInfo.ChannelAdaptation = GetChannel2();
            //开发者名
            appInfo.DevName = this.CPName.Text.Trim();
            //应用分类
            appInfo.AppClass = this.AppClass.Convert <int>(0);
            //是否网游,定义:1=网游,2=单机
            appInfo.IsNetGame = this.IsNetGame.SelectedValue.Convert <int>(0);
            //邪恶等级,1~5表示从纯洁到邪恶
            appInfo.EvilLevel = this.EvilLevel.SelectedValue.Convert <int>(0);
            //推荐值,0~10代表从不推荐到推荐
            appInfo.RecommLevel = this.RecommLevel.SelectedValue.Convert <int>(0);
            //推荐语
            appInfo.RecommWord = this.RecommWord.Text.Trim();
            //缩略图URL
            appInfo.ThumbPicUrl = this.ThumbPicUrl.Value;
            //应用描述
            appInfo.AppDesc = this.AppDesc.Text.Trim();
            //搜索关键字
            appInfo.SearchKeys = this.SearchKeys.Text.Trim();
            //下载量,定期更新(不影响更新时间)
            appInfo.DownTimes = this.DownTimes.Text.Trim().Convert <int>(0);
            //备注
            appInfo.Remarks = this.Remarks.Text.Trim();
            //状态:1=正常,2=禁用,12=数据异常,22=控制禁用
            appInfo.Status = this.Status.SelectedValue.Convert <int>();
            //主版本号
            appInfo.MainVerName = string.Empty;
            //主版本代码
            appInfo.MainVerCode = 0;
            //签名特征码
            appInfo.MainSignCode = string.Empty;
            //主ICON图URL地址

            appInfo.AppTag      = GetTag();
            appInfo.MainIconUrl = string.Empty;
            //推荐标签,编辑指定,1=官方 2=推荐 4=首发 8=免费 16=礼包 32=活动 64=内测 128=热门...位运算
            appInfo.RecommTag = GetRecommFlag();
            //分发类型:1=不分渠道,2=分渠道分发
            //appInfo.IssueType = this.IssueType.SelectedValue.Convert<int>(1);
            //联运游戏ID
            appInfo.UAppID = this.hidUAppID.Value.Convert <int>(0);

            this.X1     = Math.Round(this.Request.Params["x1"].Convert <double>(0));
            this.X2     = Math.Round(this.Request.Params["x2"].Convert <double>(0));
            this.Y1     = Math.Round(this.Request.Params["y1"].Convert <double>(0));
            this.Y2     = Math.Round(this.Request.Params["y2"].Convert <double>(0));
            this.Width  = Math.Round(this.Request.Params["w"].Convert <double>(0));
            this.Height = Math.Round(this.Request.Params["h"].Convert <double>(0));


            if (string.IsNullOrEmpty(this.AppType.SelectedValue))
            {
                this.Alert("请选择分类信息");
                return;
            }

            //应用类型
            appInfo.AppType = this.AppType.SelectedValue.Convert <int>(0);
            //数据状态,定义:1=正常,2=异常
            appInfo.DataStatus = 2;

            if (new AppInfoBLL().IsExistAppInfo(appInfo.ShowName))
            {
                this.Alert("当前应用已经存在,请修改后重试");
                return;
            }

            #region 处理缩略图
            if (!string.IsNullOrEmpty(appInfo.ThumbPicUrl))
            {
                if (this.Width != 0 && this.Height != 0)
                {
                    //裁剪方式
                    string croptype = this.Request <string>("cropType", string.Empty);

                    Bitmap bitSource = ImageHelper.GetBitmapFromUrl(appInfo.ThumbPicUrl);

                    if (bitSource == null)
                    {
                        this.Alert("远程图片解析失败,请刷新后再试");
                        return;
                    }


                    int rX = Convert.ToInt32(Math.Round(this.X1, MidpointRounding.AwayFromZero));
                    int rY = Convert.ToInt32(Math.Round(this.Y1, MidpointRounding.AwayFromZero));
                    int rW = Convert.ToInt32(Math.Round(this.Width, MidpointRounding.AwayFromZero));
                    int rH = Convert.ToInt32(Math.Round(this.Height, MidpointRounding.AwayFromZero));

                    bitSource = ImageHelper.KiCut(bitSource, rX, rY, rW, rH);

                    if (croptype == "hengping")
                    {
                        bitSource = ImageHelper.ImageCompress(bitSource, 260, 195);
                    }
                    else
                    {
                        bitSource = ImageHelper.ImageCompress(bitSource, 195, 260);
                    }

                    UploadFile up = new UploadFile();

                    byte[] imageBytes = BitmapToBytes(bitSource);
                    //StartTransfer中的AppID和CID在前端页面中上传控件定义
                    string token        = up.StartTransfer(2, 11, appInfo.ThumbPicUrl.Substring(appInfo.ThumbPicUrl.LastIndexOf("."), 4), 1, imageBytes.Length, string.Empty);
                    string resultString = up.Transfer(token, imageBytes, 1);

                    appInfo.ThumbPicUrl = resultString.Split(',')[1];

                    //up.GenerateThumb(appInfo.ThumbPicUrl, 0);
                    up.GenerateThumb(token);

                    bitSource.Dispose();
                }
            }
            #endregion

            if (string.IsNullOrEmpty(appInfo.AppName))
            {
                this.Alert("资料不完整,请完善后再试");
                return;
            }

            //写入数据库
            int result = new AppInfoBLL().Insert(appInfo);

            #region 由于数据结构变更,不存在此操作   2014-10-23 momo
            //if (result != 0)
            //{
            //    RAppTypeEntity rAppTypeEntity = new RAppTypeEntity()
            //    {
            //        AppID = result,
            //        TypeID = this.AppType.SelectedValue.Convert<int>(0)
            //    };

            //    if (new R_AppTypeBLL().Insert(rAppTypeEntity))
            //    {
            //        //游戏需要处理R_AppType表数据
            //        if (this.AppClass == "12")
            //        {
            //            rAppTypeEntity = new RAppTypeEntity()
            //            {
            //                AppID = result,
            //                TypeID = this.IsNetGame.SelectedValue.Convert<int>(0) == 0 ? 2102 : 2101
            //            };

            //            new R_AppTypeBLL().Insert(rAppTypeEntity);
            //        }

            //        Response.Redirect(string.Format("PackInfoAdd.aspx?AppID={0}&ShowName={1}&type=app", result, appInfo.ShowName));
            //    }
            //    else
            //    {
            //        this.Alert("操作失败");
            //    }
            //}
            //else
            //{
            //    this.Alert("操作失败");
            //}

            #endregion

            if (result != 0)
            {
                if (this.CheckBox1.Checked == true)
                {
                    new AppCommentSummaryBLL().UpdateSummary(result, appInfo.DownTimes, appInfo.RecommLevel);
                }
                if (this.AppClass == "12")
                {
                    OperateRecordEntity info = new OperateRecordEntity()
                    {
                        ElemId         = result,
                        reason         = "",
                        Status         = 1,
                        OperateFlag    = "1",
                        OperateType    = "2",
                        OperateExplain = "新增游戏",
                        SourcePage     = 1,
                        OperateContent = appInfo.ShowName,
                        UserName       = GetUserName(),
                    };
                    new OperateRecordBLL().Insert(info);
                }
                //页面跳转至添加包页面
                Response.Redirect(string.Format("PackInfoAdd.aspx?AppID={0}&ShowName={1}&type=app", result, appInfo.ShowName));
            }
            else
            {
                this.Alert("新增失败");
            }
        }
        private void Add()
        {
            GroupElemsEntity entity = new GroupElemsEntity();

            entity.GroupID   = new GroupBLL().HomePageRecommendGetGroupId(this.GroupTypeID, this.SchemeID);
            entity.PosID     = this.PosID;
            entity.ElemType  = this.ElemType.SelectedValue.Convert <int>(1);
            entity.GroupType = this.GroupType.Value.Convert <int>(0);
            entity.OrderNo   = this.OrderNo;
            entity.ShowType  = this.ShowType.SelectedValue.Convert <int>(0);

            // Banner位,OrderNo处理
            // 取最大的OrderNo+1
            if (this.PosID == 1)
            {
                string strWhere = string.Format(" GroupID={0} and PosID={1}", entity.GroupID, PosID);
                List <GroupElemsEntity> groupElemsList = new GroupBLL().GetList(1, strWhere, " orderNo desc");
                if (groupElemsList != null && groupElemsList.Count > 0)
                {
                    entity.OrderNo = groupElemsList[0].OrderNo + 1;
                }
            }

            //跳转至单机或网游时元素ID为0
            if (this.ElemType.SelectedValue == "4")
            {
                entity.ElemID    = 0;
                entity.GroupType = this.Request <int>("gameType", 0);
            }
            else
            {
                entity.ElemID = this.ElemID.Value.Convert <int>(0);
            }

            //if (entity.ShowType == 0)
            //{
            //    entity.RecommPicUrl = this.MainIconPicUrl.Value;
            //    if (this.MainIconPicUrl.Value.Trim() == "")
            //    {
            //        CurrentEntity.RecommPicUrl = this.RecommPicUrl.Value;
            //    }
            //}
            //else if (entity.ShowType == 1)
            //{
            //    entity.RecommPicUrl = this.RecommPicUrl.Value;
            //}
            //else
            //{
            //    entity.RecommPicUrl = string.Empty;
            //}
            entity.RecommPicUrl = this.RecommPicUrl.Value;
            if (this.RecommPicUrl.Value.Trim() == "")
            {
                entity.RecommPicUrl = this.MainIconPicUrl.Value;
            }
            entity.StartTime   = this.StartTime.Text.Trim().Convert <DateTime>(DateTime.Now);
            entity.EndTime     = this.EndTime.Text.Trim().Convert <DateTime>(DateTime.Now.AddDays(7));
            entity.RecommTitle = this.RecommTitle.Text.Trim();
            entity.RecommWord  = this.RecommWord.Text.Trim();
            entity.RecommTag   = GetRecommTag();
            entity.Status      = this.Status.SelectedValue.Convert <int>(0);
            entity.Remarks     = this.Remarks.Text.Trim();


            if (new GroupElemsBLL().IsExist(entity))
            {
                this.Alert("当前应用已存在,添加失败");
            }
            else
            {
                bool result = new GroupElemsBLL().Insert(entity);
                if (result)
                {
                    if (SchemeID == 104)
                    {
                        OperateRecordEntity info = new OperateRecordEntity()
                        {
                            ElemId         = entity.GroupElemID,
                            reason         = "",
                            Status         = 1,
                            OperateFlag    = "1",
                            OperateType    = "1",
                            SourcePage     = 60,
                            OperateExplain = "首页推荐位增加",
                            UserName       = GetUserName(),
                        };
                        if (entity.PosID == 1)
                        {
                            info.OperateContent = entity.RecommTitle + "(Bnaner)";
                        }
                        else
                        {
                            if (entity.ShowType == 1)
                            {
                                info.OperateContent = entity.RecommTitle + "(广告位)";
                            }
                            else
                            {
                                info.OperateContent = entity.RecommTitle + "(推荐位)";
                            }
                        }
                        new OperateRecordBLL().Insert(info);
                    }

                    this.Alert("添加成功", string.Format("HomePageRecommendByAppCenterList.aspx?acttype={0},{1}&page={2}", this.GroupTypeID, this.SchemeID, this.PageType));
                }
                else
                {
                    this.Alert("添加失败");
                }
            }
        }
Ejemplo n.º 25
0
        protected void OnSave(object sender, EventArgs e)
        {
            var currentEntity = new GroupInfoEntity();

            currentEntity.GroupID     = _Id;
            currentEntity.GroupTypeID = this.GroupTypeID;
            currentEntity.OrderType   = 0;
            currentEntity.OrderNo     = 0;
            currentEntity.GroupName   = txtGroupName.Text;
            currentEntity.GroupDesc   = txtGroupDesc.Text;
            currentEntity.GroupTips   = "";
            currentEntity.GroupPicUrl = ThumbPicUrl.Value;
            currentEntity.Remarks     = "";
            currentEntity.StartTime   = this.txtStartTime.Text.Trim().Convert <DateTime>(DateTime.Now);
            currentEntity.EndTime     = this.txtEndTime.Text.Trim().Convert <DateTime>(new DateTime(2048, 1, 1));
            currentEntity.CreateTime  = DateTime.Now;
            currentEntity.UpdateTime  = DateTime.Now;
            currentEntity.Status      = 1; // 开启
            currentEntity.UpdateTime  = DateTime.Now;
            currentEntity.Remarks     = string.Empty;
            currentEntity.SchemeID    = this.SchemeID;

            bool result = false;

            if (_Id <= 0)
            {
                //新增
                currentEntity.CreateTime = DateTime.Now;
                int newId = new GroupBLL().InsertInfoForId(currentEntity);
                if (SchemeID == 104)
                {
                    OperateRecordEntity info = new OperateRecordEntity()
                    {
                        ElemId         = newId,
                        reason         = "",
                        Status         = 1,
                        OperateFlag    = "1",
                        SourcePage     = 61,
                        OperateType    = "5",
                        OperateExplain = "新增专题",
                        OperateContent = currentEntity.GroupName,
                        UserName       = GetUserName(),
                    };
                    new OperateRecordBLL().Insert(info);
                }
                this.Alert("新增成功", "SpecialTopicEdit.aspx?id=" + newId.ToString() + "&page=" + PageType + "&SchemeID=" + SchemeID.ToString() + "&GroupTypeID=" + GroupTypeID.ToString());
            }
            else
            {
                result = new GroupBLL().SpecialTopicUpdate(currentEntity);
                if (SchemeID == 104)
                {
                    OperateRecordEntity info = new OperateRecordEntity()
                    {
                        ElemId         = _Id,
                        reason         = "",
                        Status         = 1,
                        OperateFlag    = "2",
                        SourcePage     = 61,
                        OperateType    = "5",
                        OperateExplain = "编辑专题",
                        OperateContent = currentEntity.GroupName,
                        UserName       = GetUserName(),
                    };
                    new OperateRecordBLL().Insert(info);
                }
            }
            if (result)
            {
                this.Alert("保存成功");
                Bind();
            }
            else
            {
                this.Alert("保存失败!");
            }
        }