private void BindData() { int totalCount = 0; AppInfoEntity entity = new AppInfoEntity() { SearchType = SearchType.SelectedValue, SearchKeys = this.Keyword_2.Value.Trim(), AppClass = 11, TypeID = AppType.SelectedValue, OrderType = OrderType.SelectedValue, StartIndex = pagerList.StartRecordIndex - 1, EndIndex = pagerList.PageSize, Status = 0 }; if (SearchType.SelectedValue == "1") { entity.SearchKeys = new B_DevBLL().GetDevIDByName(this.Keyword_2.Value); } dic_DevList = new B_DevBLL().GetDevListDic(); dic_DevList[0] = ""; List <AppInfoEntity> list = new AppInfoBLL().GetDataList(entity, ref totalCount, SchemeID); this.objRepeater.DataSource = list; this.objRepeater.DataBind(); pagerList.RecordCount = totalCount; pagerList.DataBind(); }
public DataTable GetGroupInfo(int GroupID) { DataTable dt = new DataTable(); DataSet dataset = new GroupElemsBLL().QueryDataSetByGroupID(GroupID); DataTable datatable = dataset.Tables[0]; int typeId = new GroupInfoBll().QueryGroupInfoByGroupID(GroupID).GroupTypeID; AppInfoEntity entity = new AppInfoEntity() { AppClass = 12, AppType = typeId, StartIndex = 0, OrderType = "DownTimes", EndIndex = 500, Status = 1, }; if (GroupID == 93) { entity.AppType = 0; } else if (GroupID == 94) { entity.AppType = 0; entity.OrderType = "CreateTime"; } string status = "1"; DataSet ds = new AppInfoBLL().GetExportDataList2(entity, status, "70"); dt = ds.Tables[0]; return(dt); }
private void BindData() { int totalCount = 0; pagerList.PageSize = 20; AppInfoEntity entity = new AppInfoEntity(); entity.SearchKeys = this.Keyword_2.Value.Trim(); entity.StartIndex = pagerList.StartRecordIndex - 1; if (pagerList.StartRecordIndex == 1) { entity.EndIndex = pagerList.PageSize; } else { entity.EndIndex = pagerList.EndRecordIndex; } List <AppInfoEntity> list = new AppInfoBLL().GetUAppInfoList(entity, ref totalCount); this.objRepeater.DataSource = list; this.objRepeater.DataBind(); pagerList.RecordCount = totalCount; pagerList.DataBind(); }
public string GetAppName(int id) { string str = ""; AppInfoEntity entity = new AppInfoBLL().GetSingle(id); if (entity != null) { str = entity.AppName; } return(str); }
protected string BindType(object id) { string str = ""; int appid = int.Parse(id.ToString()); AppInfoEntity entity = new AppInfoBLL().GetSingle2(appid); if (entity != null) { str = entity.AppTypeName; } return(str); }
private void BindData() { int totalCount = 0; AppInfoEntity entity = new AppInfoEntity() { SearchType = SearchType.SelectedValue, SearchKeys = this.Keyword_2.Value.Trim(), IsNetGame = IsNetGame.SelectedValue.Convert <int>(0), AppClass = 12, AppType = AppType.SelectedValue.Convert <int>(0), OrderType = OrderType.SelectedValue, StartIndex = pagerList.StartRecordIndex - 1, EndIndex = pagerList.PageSize, Status = 1 }; if (SearchType.SelectedValue == "1") { entity.SearchKeys = new B_DevBLL().GetDevIDByName(this.Keyword_2.Value); } dic_DevList = new B_DevBLL().GetDevListDic(); dic_DevList[0] = ""; List <AppInfoEntity> list = new AppInfoBLL().GetDataList(entity, ref totalCount); if (MaxAppID > 0) { list = list.Where(a => a.AppID < MaxAppID).ToList(); } this.objRepeater.DataSource = list; this.objRepeater.DataBind(); pagerList.RecordCount = totalCount; pagerList.DataBind(); }
public static string GetToken(long appId, string appSecret) { cleanExpired(); string key = appId + "_" + appSecret; lock (lockObject) { if (dictIdSecretWithSid.ContainsKey(key)) { return(dictIdSecretWithSid[key].ToString()); } } if (AppInfoBLL.Valid(appId, appSecret)) { long sid = LeafSnowflake.getID(); Token token = new Token(); token.UserID = appId.ToString(); token.ExpireTime = DateTime.Now.AddHours(2); AppSessionBLL.SaveToken(sid, token); lock (lockObject) { dictToken.Add(sid, token); dictIdSecretWithSid.Add(key, sid); } return(sid.ToString()); } else { return(null); } }
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(); }
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; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { this.BindAppType(); if (AppID.Equals(0)) { this.Alert("参数非法", "/AppInfoList.aspx"); } else { CurrentEntity = new AppInfoBLL().GetSingle(this.AppID); //新表结构暂不使用 2014-10-27 momo //this.hidUAppID.Value = CurrentEntity.UAppID.ToString(); //this.UAppName.Text = CurrentEntity.UAppID.ToString(); this.AppName.Text = CurrentEntity.AppName; this.ShowName.Text = CurrentEntity.ShowName; this.ForDeviceTypeList.SelectedValue = CurrentEntity.ForDeviceType.ToString(); this.DevID.Value = CurrentEntity.CPID.ToString(); this.CPID.Text = CurrentEntity.CPID.ToString(); this.CPName.Text = CurrentEntity.DevName.ToString(); this.SearchKeys.Text = CurrentEntity.SearchKeys; this.DownTimes.Text = CurrentEntity.DownTimes.ToString(); this.RecommWord.Text = CurrentEntity.RecommWord; this.AppType.SelectedValue = this.GetAppType(CurrentEntity.AppType.ToString()); this.OldAppType.Value = this.GetAppType(CurrentEntity.AppType.ToString()); this.EvilLevel.SelectedValue = CurrentEntity.EvilLevel.ToString(); this.RecommLevel.SelectedValue = CurrentEntity.RecommLevel.ToString(); this.IssueType.SelectedValue = CurrentEntity.IssueType.ToString(); this.AppDesc.Text = CurrentEntity.AppDesc; this.ShowThumbPic.ImageUrl = string.IsNullOrEmpty(CurrentEntity.ThumbPicUrl) ? @"Theme/Images/empty.png" : CurrentEntity.ThumbPicUrl; this.ThumbPicUrl.Value = CurrentEntity.ThumbPicUrl; this.OldThumbPicUrl.Value = CurrentEntity.ThumbPicUrl; this.Remarks.Text = CurrentEntity.Remarks; this.Status.SelectedValue = CurrentEntity.Status.ToString(); this.MainPackName.Value = CurrentEntity.PackName; this.IsNetGame.SelectedValue = CurrentEntity.IsNetGame.ToString(); //this.GetIsNetGame(CurrentEntity.AppType.ToString()); this.OldIsNetGame.Value = CurrentEntity.IsNetGame.ToString(); // this.GetIsNetGame(CurrentEntity.AppType.ToString()) == "0" ? "2102" : "2101"; this.drpIssueType.SelectedValue = CurrentEntity.IssueType.ToString(); if (CurrentEntity.IssueType == 1) { cbChannel.Visible = false; } else { cbChannel.Visible = true; } string channel = CurrentEntity.ChannelNos; if (channel.IndexOf(',') > -1) { string[] channels = channel.Split(','); foreach (ListItem li in cbChannel.Items) { foreach (string item in channels) { if (li.Value == item) { li.Selected = true; } } } } string channel2 = CurrentEntity.ChannelAdaptation; if (channel2.IndexOf(',') > -1) { string[] channels2 = channel2.Split(','); foreach (ListItem li in cbChannel2.Items) { foreach (string item in channels2) { if (li.Value == item) { li.Selected = true; } } } } BindTag(cbRecommFlag, CurrentEntity.RecommTag); BindTag(CurrentEntity); BindArchitecture(CurrentEntity); } } }
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("操作失败"); } }
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("新增失败"); } }
/// <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; } }
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(); } } }
private void BindData2(int Action) { try { int totalCount = 0; AppInfoEntity entity = new AppInfoEntity() { SearchType = SearchType.SelectedValue, SearchKeys = this.Keyword_2.Text.Trim(), AppClass = 12, //AppType = AppType.SelectedValue.Convert<int>(0), OrderType = OrderType.SelectedValue, StartIndex = pagerList.StartRecordIndex - 1, EndIndex = pagerList.PageSize, Status = Action, }; //if (SearchType.SelectedValue == "1") //{ // entity.SearchKeys = new B_DevBLL().GetDevIDByName(this.Keyword_2.Text); //} //dic_DevList = new B_DevBLL().GetDevListDic(); //dic_DevList[0] = ""; //Type 1=已上架游戏 2=待审核游戏 3=游戏接入情况 ,4=已下架游戏,5=审核不通过游戏 string status = ""; switch (Action) { case 1: status = "1"; break; case 2: status = "6"; break; case 3: status = "4,5,6,7"; break; case 4: status = "2"; break; case 5: status = "7"; break; default: break; } int Type = Action; List <AppInfoEntity> list = new AppInfoBLL().GetDataListNew(entity, status, ",70,", ref totalCount); this.objRepeaterData.DataSource = list; this.objRepeaterData.DataBind(); Count = totalCount; pagerList.RecordCount = totalCount; pagerList.DataBind(); } catch (Exception e) { throw; } }
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); }
//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(); } }
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(); } }