Ejemplo n.º 1
0
    protected void SubmitButton_Click(object sender, EventArgs e)
    {
        bool   flag = false;
        string msg  = string.Empty;

        if (this.IsValid)
        {
            WMUsers user = WMUsers.Get(UserId);
            user.RoleId   = UserRole.SelectedValue.ToInt32();
            user.NickName = NickName.Text;
            user.Mobile   = UserMobile.Text;
            user.BankCard = UserBankCard.Text;
            user.StatusId = UserState.SelectedValue.ToInt32();

            if (UserImageUpload.HasFile)
            {
                string fileName = string.Format("~/share/upload/user/{0}/face.jpg", user.Id);
                Jumpcity.IO.FileUpload upload = new Jumpcity.IO.FileUpload(fileName, 0, 0);
                if (upload.Upload(UserImageUpload.PostedFile.InputStream))
                {
                    user.Image = fileName;
                }
                else
                {
                    msg = upload.ErrorMessage;
                    Helper.MessageBox(flag, msg);
                    return;
                }
            }

            flag = user.Update();
        }

        Helper.MessageBox(flag);
    }
Ejemplo n.º 2
0
    protected void UserBind()
    {
        //用户编辑 -- 用户类型项绑定
        RoleBind();

        //用户编辑 -- 用户状态项绑定
        StateBind();

        //积分明细 -- 积分来源项绑定
        SourceBind();

        WMUsers user = WMUsers.Get(UserId);

        if (user != null)
        {
            UserRoleId = user.RoleId;

            //用户基本信息编辑
            UserImage.ImageUrl      = user.Image;
            NickName.Text           = user.NickName;
            UserMobile.Text         = user.Mobile;
            UserBankCard.Text       = user.BankCard;
            UserRole.SelectedValue  = user.RoleId.ToString();
            UserState.SelectedValue = user.StatusId.ToString();
            UserAddDate.Text        = user.AddDate.ToString("yyyy-MM-dd HH:mm");

            //积分明细
            Integarl.Text = string.Format("当前积分:{0}", user.Integral);
            IntegralBind();

            //配送信息
            ReceiptBind();

            //用户收藏
            SaveBind();

            if (UserRoleId == 102)
            {
                //用户分享
                ShareBind();

                //用户分红
                BonusBind();

                //浏览点击
                ClickBind();
            }
        }
    }