Exemplo n.º 1
0
    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>");
                }
            }
        }
    }
Exemplo n.º 2
0
    /// <summary>
    /// 保存操作
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnSave_Click(object sender, EventArgs e)
    {
        if (this.id != "")
        {
            if (ViewState["OldUserName"].ToString() != this.txtUserName.Text.Trim())
            {
                if (CheckHasUserName(this.txtUserName.Text.Trim()) == true)
                {
                    ClientScript.RegisterStartupScript(this.GetType(), "ok", "<script>alert('该帐号已经存在,请使用其他账号!');</script>");
                    return;
                }
            }


            user           = userbll.GetModel(this.id);
            user.ShopMoney = DataConvert.DecimalC(txtBZJ.Value);
            user.isOpen    = DataConvert.IntC(rbOpen.SelectedValue);
            user.orderby   = DataConvert.IntC(txtOrder.Text);

            user.UserName = txtUserName.Text.Trim();
            user.Email    = this.email.Text.Trim();
            user.QQ       = this.qq.Text.Trim();

            user.AccoutsState = rbAccountsState.SelectedValue;
            if (userbll.Update(user) > 0)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "ok", "<script>alert('保存成功!');layer_close_flesh();</script>");
            }

            else
            {
                ClientScript.RegisterStartupScript(this.GetType(), "ok", "<script>alert('保存失败!');</script>");
            }
        }

        else
        {
            ClientScript.RegisterStartupScript(this.GetType(), "ok", "<script>alert('未传递参数!');</script>");
        }
    }
Exemplo n.º 3
0
    /// <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;
            }
        }
    }