protected void Button1_Click(object sender, EventArgs e) { if (id != "") { string list = string.Empty; foreach (ListItem item in catelist.Items) { if (item.Selected) { list += item.Value + ","; } } if (list == "") { ClientScript.RegisterStartupScript(this.GetType(), "alert", "<script>alert('请选择任务分类!');</script>"); } else { BllShopUser bUer = new BllShopUser(); ModShopUser mUser = bUer.GetModel(id); mUser.CategoryId = list.TrimEnd(','); int i = bUer.Update(mUser); if (i > 0) { ClientScript.RegisterStartupScript(this.GetType(), "alert", "<script>alert('修改成功!');layer_close();</script>"); } else { ClientScript.RegisterStartupScript(this.GetType(), "alert", "<script>alert('修改失败!');</script>"); } } } }
/// <summary> /// 初始化数据 /// </summary> protected void InitData() { if (this.id != "") { user = userbll.GetModel(this.id); if (user.isOwnSeller == 1 && user.AccoutsState == "Normal" && user.isOpen == 1) { trOwn.Visible = true; } else { trOwn.Visible = false; } string sql2 = "select * from T_Shop_ApplyImage where shopid='" + id + "' order by addtime desc"; DataSet ds2 = adoHelper.ExecuteSqlDataset(sql2); if (ds2.Tables[0].Rows.Count > 0) { //营业执照是否为空 if (ds2.Tables[0].Rows[0]["Charter"].ToString() != "") { SmallPic.Visible = true; SmallPic.ImageUrl = ds2.Tables[0].Rows[0]["Charter"].ToString(); //BigPic.HRef = ds2.Tables[0].Rows[0]["Charter"].ToString(); } } //开通帐号下显示的数据 if (user != null) { //未开通帐号下显示的数据 this.CompanyName.Text = user.CompanyName; this.ShopName.Text = user.ShopName; this.Contact.Text = user.LinkMan; this.Phone.Text = user.Phone; this.Mark.Text = user.Mark; this.address.Text = user.Address; rbAccountsState.SelectedValue = "Normal"; this.area.Text = GetMarketInfo(user.MarketId); this.email.Text = user.Email; this.qq.Text = user.QQ; this.txtBZJ.Value = user.ShopMoney.ToString(); this.txtOrder.Text = user.orderby != null?user.orderby.ToString() : "0"; DataSet ds = adoHelper.ExecuteSqlDataset("select * from T_Info_Category where categoryid='" + user.CategoryId + "' "); if (ds.Tables[0].Rows.Count > 0) { categroytype.Text = ds.Tables[0].Rows[0]["CategoryName"].ToString(); } this.rbAccountsState.SelectedValue = (user.AccoutsState == null || user.AccoutsState.ToString() == "") ? "Unchecked" : user.AccoutsState; this.rbOpen.SelectedValue = user.isOpen.ToString(); if (user.Passwrod == null && user.UserName == null) { this.txtUserName.Text = null; } else { this.txtUserName.Text = user.UserName; } this.categroytype.Text = GetCategoryName(id); ViewState["OldUserName"] = user.UserName == null ? "" : user.UserName; } } }