/// <summary> /// 绑定应用类型 /// </summary> private void BindAppType() { List <AppTypeEntity> list = new AppTypeBLL().GetAPPTypeList(this.AppClass.Convert <int>(0)); if (this.AppClass == "11") { this.IsNetGame.Enabled = false; } ListItem objItem = new ListItem("分类筛选", ""); this.AppType.Items.Add(objItem); foreach (AppTypeEntity item in list) { this.AppType.Items.Add(new ListItem(item.AppTypeName, item.AppType.ToString())); } List <ChannelEntity> chList = new ChannelBLL().BindList(); cbChannel.DataSource = chList; cbChannel.DataTextField = "ChannelName"; cbChannel.DataValueField = "ChannelNo"; cbChannel.DataBind(); cbChannel2.DataSource = chList; cbChannel2.DataTextField = "ChannelName"; cbChannel2.DataValueField = "ChannelNo"; cbChannel2.DataBind(); }
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); }