Exemple #1
0
        protected string sellerimgview;   //商家背景图显示


        /// <summary>
        /// 数据绑定
        /// </summary>
        private void bind()
        {
            if (sellerid > 0)
            {
                Model.SellerInfo info = BLL.SellerBLL.GetModel(sellerid);
                if (info == null)
                {
                    return;
                }
                txbname.Text        = info.name.Trim().ToString();                                       //商家名称
                txbctype.Text       = info.ctype.Trim().ToString();                                      //商家类型
                txbbusiness.Text    = info.business.Trim().ToString();                                   //经营范围
                txbtel.Text         = info.tel.Trim().ToString();                                        //电话
                txbfax.Text         = info.fax.Trim().ToString();                                        //传真
                txbqq.Text          = info.qq.Trim().ToString();                                         //QQ
                txbwx.Text          = info.wx.Trim().ToString();                                         //微信
                txbDescription.Text = info.description.Trim().ToString();                                //描述
                wxqrcodeimgview     = "<img src=\"" + info.wxqrcode + "\" style=\"max-width:200px;\">";  //二维码
                sellerimgview       = "<img src=\"" + info.sellerimg + "\" style=\"max-width:200px;\">"; //商家背景图
                wxqrcode            = info.wxqrcode;
                sellerimg           = info.sellerimg;
                txbAddress.Text     = info.address.Trim().ToString();//地址
            }
            else
            {
                Response.Write("<script>alert(\"参数错误,信息绑定失败\");</script>");
                return;
            }
        }
Exemple #2
0
        /// <summary>
        /// 保存按钮
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnsave_Click(object sender, EventArgs e)
        {
            if (sellerid <= 0)
            {
                Response.Write("<script>alert(\"参数错误\");</script>");
                return;
            }

            Model.SellerInfo info = BLL.SellerBLL.GetModel(sellerid);
            info.name        = txbname.Text.Trim().ToString();
            info.ctype       = txbctype.Text.Trim().ToString();
            info.address     = txbAddress.Text.Trim().ToString();
            info.tel         = txbtel.Text.Trim().ToString();
            info.fax         = txbfax.Text.Trim().ToString();
            info.qq          = txbqq.Text.Trim().ToString();
            info.wx          = txbwx.Text.Trim().ToString();
            info.wxqrcode    = Request["wxqrcode"] != null ? Request["wxqrcode"].ToString() : "";
            info.sellerimg   = Request["txbsellerimg"] != null ? Request["txbsellerimg"].ToString() : "";
            info.business    = txbbusiness.Text.Trim().ToString();
            info.description = txbDescription.Text.Trim().ToString();

            int result = BLL.SellerBLL.Update(info);

            if (result <= 0)
            {
                Response.Write("<script>alert(\"保存失败\");</script>");
            }
            Response.Write("<script>alert(\"保存成功\");window.parent.location.href=\"editseller.aspx\";</script>");
        }
Exemple #3
0
        /// <summary>
        /// 保存按钮
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnsave_Click(object sender, EventArgs e)
        {
            if (sellerid <= 0)
            {
                Response.Write("<script>alert(\"参数错误\");</script>");
                return;
            }
            string oldpass = txboldpass.Text.Trim();

            if (oldpass.Trim().Length == 0)
            {
                Response.Write("<script>alert(\"请输入旧密码\");</script>");
                return;
            }
            string newpass  = txbpassword.Text.Trim();
            string newpass2 = txbpassword2.Text.Trim();

            if (newpass.Trim().Length < 6)
            {
                Response.Write("<script>alert(\"请输入6位以上的新密码\");</script>");
                return;
            }
            if (!newpass2.Equals(newpass))
            {
                Response.Write("<script>alert(\"密码不一至\");</script>");
                return;
            }
            Model.SellerInfo info = BLL.SellerBLL.GetModel(sellerid);
            if (!Common.Utility.MD5Encrypt(oldpass.Trim()).Equals(info.password))
            {
                Response.Write("<script>alert(\"旧密码不正确\");</script>");
                return;
            }
            info.password = Common.Utility.MD5Encrypt(newpass2);
            int result = BLL.SellerBLL.Update(info);

            if (result <= 0)
            {
                Response.Write("<script>alert(\"保存失败\");</script>");
            }
            Response.Write("<script>alert(\"保存成功\");window.parent.location.href=\"editseller.aspx\";</script>");
        }