Exemple #1
0
        public string Execute(Hashtable params_ht)
        {
            Hashtable res = params_ht;

            if (res["UID"] == null || res["UID"].ToString().Trim().Length <= 0 ||
                res["PushID"] == null || res["PushID"].ToString().Trim().Length <= 0)
            {
                return(SiteHelper.GetJsonFromHashTable(null, "faild", "参数不完整"));
            }
            else
            {
                UserInfoManager uim = new UserInfoManager();
                uid    = res["UID"].ToString().Trim();
                pushid = res["PushID"].ToString().Trim();
                Hashtable user = uim.GetUserInfoByUserID(uid);
                if (user == null || user.Keys.Count <= 0)
                {
                    return(SiteHelper.GetJsonFromHashTable(null, "faild", "用户不存在"));
                }
                else
                {
                    Hashtable modifyUser = new Hashtable();
                    modifyUser["PushID"] = pushid;
                    bool issuccess = uim.AddOrEditUserInfo(modifyUser, uid);
                    if (!issuccess)
                    {
                        return(SiteHelper.GetJsonFromHashTable(null, "faild", "保存失败"));
                    }
                }

                return(SiteHelper.GetJsonFromHashTable(null, "success", "保存成功", "SetPushInfo"));
            }
        }
Exemple #2
0
        /// <summary>
        /// 保存事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Save_Click(object sender, EventArgs e)
        {
            UserInfoManager userManager = new UserInfoManager();
            string          guid        = CommonHelper.GetGuid;
            Hashtable       ht          = new Hashtable();

            // 用户名
            ht["UserName"] = UserName.Value;
            // 密码
            ht["Password"] = Md5Helper.MD5(Password.Value, 32);
            // 用户昵称
            ht["NickName"] = NickName.Value;
            // 头像地址
            ht["HeadPortrait"] = imgphoto.ImageUrl;
            // 真实名称
            ht["RealName"] = RealName.Value;
            // 绑定手机号
            ht["BindPhone"] = BindPhone.Value;
            // 身份证号照片
            ht["IDCard"] = txtIdCard.Value;
            // 驾驶证照片
            ht["DriverLicense"] = txtDriverLicense.Value;
            // 实名认证状态
            ht["RealNameCertification"] = RealNameCertification.Value;
            // 账户余额
            ht["Balance"] = Balance.Value;
            // 众筹模块余额
            ht["RaiseBalance"] = RaiseBalance.Value;
            // 用户状态
            ht["UserState"] = UserState.Value;

            if (!string.IsNullOrEmpty(_key))
            {
                guid = _key;
                ht.Remove("Password");
            }
            else
            {
                ht["RegistrionTime"] = DateTime.Now;
            }
            bool returnValue = userManager.AddOrEditUserInfo(ht, _key);

            if (returnValue)
            {
                ShowMsgHelper.AlertMsg("操作成功!");
            }
            else
            {
                ShowMsgHelper.Alert_Error("操作失败!");
            }
        }
Exemple #3
0
        /// <summary>
        /// 保存事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Save_Click(object sender, EventArgs e)
        {
            try
            {
                Hashtable ht = new Hashtable();

                // 实名认证状态
                ht["RealNameCertification"] = RealNameCertification.Value;
                // 审核描述
                ht["ReviewNote"] = ReviewNote.Value;

                //if (!string.IsNullOrEmpty(_key))
                //{
                //    ht["ID"] = _key;
                //}

                string   userIDStr = Request["key"];
                string[] userID    = new string[] { };
                if (!string.IsNullOrEmpty(userIDStr))
                {
                    userID = userIDStr.Split(',');
                }
                int sumNum  = userID.Length; // 总数量
                int succNum = 0;             // 成功数量
                int failNum = 0;             // 失败数量
                foreach (string uID in userID)
                {
                    ht["ID"] = uID;
                    if (userInfoManager.AddOrEditUserInfo(ht, uID))
                    {
                        succNum += 1;
                    }
                    else
                    {
                        failNum += 1;
                    }
                }

                ShowMsgHelper.AlertMsg("审核用户数量" + sumNum + ",成功" + succNum + ",失败" + failNum);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemple #4
0
        public string Execute(Hashtable params_ht)
        {
            Hashtable res = params_ht;

            if (res["SetType"] == null || res["Content"] == null || res["UID"] == null || res["SetType"].ToString().Trim().Length <= 0 || res["Content"].ToString().Trim().Length <= 0 || res["UID"].ToString().Trim().Length <= 0)
            {
                return(SiteHelper.GetJsonFromHashTable(null, "faild", "参数不完整"));
            }
            else
            {
                UserInfoManager uim = new UserInfoManager();
                SmsInfoManager  sim = new SmsInfoManager();
                //头像:1   姓名:2   昵称:3
                uid     = res["UID"].ToString().Trim();
                setType = res["SetType"].ToString().Trim();
                content = res["Content"].ToString().Trim();
                Hashtable user = uim.GetUserInfoByUserID(uid);
                if (user == null || user.Keys.Count <= 0)
                {
                    return(SiteHelper.GetJsonFromHashTable(null, "faild", "用户不存在"));
                }
                else
                {
                    if (setType == "1")
                    {
                        //修改头像
                        try
                        {
                            string    imgPath    = BitmapHelper.toUpload(content);
                            Hashtable modifyUser = new Hashtable();
                            modifyUser["HeadPortrait"] = imgPath;
                            bool issuccess = uim.AddOrEditUserInfo(modifyUser, uid);
                            if (!issuccess)
                            {
                                return(SiteHelper.GetJsonFromHashTable(null, "faild", "用户头像保存失败"));
                            }
                            else
                            {
                                user["HeadPortrait"] = imgPath;
                            }
                        }
                        catch (Exception e1)
                        {
                            return(SiteHelper.GetJsonFromHashTable(null, "faild", "用户头像保存失败"));
                        }
                    }
                    else if (setType == "3")
                    {
                        //修改昵称
                        Hashtable modifyUser = new Hashtable();
                        modifyUser["NickName"] = content;
                        bool issuccess = uim.AddOrEditUserInfo(modifyUser, uid);
                        if (!issuccess)
                        {
                            return(SiteHelper.GetJsonFromHashTable(null, "faild", "昵称保存失败"));
                        }
                        else
                        {
                            user["NickName"] = content;
                        }
                    }
                    else
                    {
                        return(SiteHelper.GetJsonFromHashTable(null, "faild", "修改项不合法"));
                    }
                }
                DataTable dt = uim.GetUserInfoByBindPhone(SiteHelper.GetHashTableValueByKey(user, "BindPhone"));
                if (dt == null || dt.Rows.Count <= 0)
                {
                    return(SiteHelper.GetJsonFromHashTable(null, "faild", "网络异常"));
                }
                else
                {
                    decimal balance = 0.00m;
                    decimal.TryParse(dt.Rows[0]["Balance"].ToString(), out balance);
                    decimal balance2 = 0.00m;
                    decimal.TryParse(dt.Rows[0]["Balance2"].ToString(), out balance2);
                    dt.Rows[0]["Balance"] = balance + balance2;
                    Hashtable huser = DataTableHelper.DataRowToHashTable(dt.Rows[0]);
                    return(SiteHelper.GetJsonFromHashTable(huser, "success", "操作成功", "UserInfo"));
                }
            }
        }
Exemple #5
0
        public string Execute(Hashtable params_ht)
        {
            Hashtable res = params_ht;

            if (res["Mobile"] == null ||
                res["VerificationCode"] == null ||
                res["Client"] == null ||
                res["Longitude"] == null ||
                res["Latitude"] == null ||
                res["EquipmentID"] == null ||
                res["Mobile"].ToString().Trim().Length <= 0 ||
                res["VerificationCode"].ToString().Trim().Length <= 0 ||
                res["Client"].ToString().Trim().Length <= 0 ||
                res["Longitude"].ToString().Trim().Length <= 0 ||
                res["Latitude"].ToString().Trim().Length <= 0 ||
                res["EquipmentID"].ToString().Trim().Length <= 0)
            {
                return(SiteHelper.GetJsonFromHashTable(null, "faild", "登录数据不完整"));
            }
            else
            {
                UserInfoManager     uim            = new UserInfoManager();
                SmsInfoManager      sim            = new SmsInfoManager();
                UserLoginLogManager ullm           = new UserLoginLogManager();
                SysSettingManager   settingManager = new SysSettingManager();
                bool isAllowLogin = false;
                //获取参数
                mobile           = res["Mobile"].ToString().Trim();
                verificationCode = res["VerificationCode"].ToString().Trim();
                client           = res["Client"].ToString().Trim();
                longitude        = res["Longitude"].ToString().Trim();
                latitude         = res["Latitude"].ToString().Trim();
                drviceid         = res["EquipmentID"].ToString().Trim();
                DataTable user = uim.GetUserInfoByBindPhone(mobile);
                if (user != null && user.Rows.Count > 0)
                {
                    string vcode = sim.GetVerCodeByMobile(mobile);
                    if (vcode != null && verificationCode.Trim() == vcode.Trim())
                    {
                        isAllowLogin = true;
                    }
                    else
                    {
                        return(SiteHelper.GetJsonFromHashTable(null, "faild", "验证码不正确"));
                    }
                }
                else
                {
                    Hashtable newuser = new Hashtable();
                    newuser["BindPhone"]             = mobile;
                    newuser["RealNameCertification"] = (int)UserRealNameCertification.Unauthorized;
                    newuser["UserState"]             = (int)UserState.Enable;
                    newuser["Balance"]      = 0;
                    newuser["RaiseBalance"] = 0;
                    newuser["IsRaiseUser"]  = (int)UserIsRaise.NO;
                    newuser["InviteCode"]   = mobile;
                    int num = uim.AddUserInfo(newuser);
                    if (num > -1)
                    {
                        user = uim.GetUserInfoByBindPhone(mobile);
                        string vcode = sim.GetVerCodeByMobile(mobile);
                        if (vcode != null && verificationCode.Trim() == vcode.Trim())
                        {
                            isAllowLogin = true;
                        }
                        else
                        {
                            return(SiteHelper.GetJsonFromHashTable(null, "faild", "验证码不正确"));
                        }
                    }
                    else
                    {
                        return(SiteHelper.GetJsonFromHashTable(null, "faild", "手机号错误"));
                    }

                    //新注册用户赠送优惠券
                    int couponNum = 0;
                    int.TryParse(settingManager.GetValueByKey("RegCouponNum"), out couponNum);
                    decimal couponMoney = 0.00m;
                    decimal.TryParse(settingManager.GetValueByKey("RegCouponMoney"), out couponMoney);
                    UserCouponManager couponManager = new UserCouponManager();
                    if (couponNum > 0 && couponMoney > 0)
                    {
                        couponManager.NewUserGiveCoupons(user.Rows[0]["ID"].ToString());
                    }
                }
                if (isAllowLogin)
                {
                    //记录登录日志
                    Hashtable loginlog = new Hashtable();
                    loginlog["UserID"]    = user.Rows[0]["ID"].ToString();
                    loginlog["Latitude"]  = latitude;
                    loginlog["Longitude"] = longitude;
                    loginlog["Client"]    = client;
                    ullm.AddUserLoginLog(loginlog);
                    //更新最后登录时间
                    Hashtable userh = new Hashtable();
                    userh["LastloginTime"] = SiteHelper.GetWebServerCurrentTime();
                    userh["DeviceID"]      = drviceid;
                    uim.AddOrEditUserInfo(userh, loginlog["UserID"].ToString());

                    decimal balance = 0.00m;
                    decimal.TryParse(user.Rows[0]["Balance"].ToString(), out balance);
                    decimal balance2 = 0.00m;
                    decimal.TryParse(user.Rows[0]["Balance2"].ToString(), out balance2);
                    user.Rows[0]["Balance"] = balance + balance2;
                    if (user.Rows[0]["UserType"].ToString() == UserType.OffDepositUser.GetHashCode().ToString())//免押金用户
                    {
                        string depositMoney = settingManager.GetValueByKey("GoldDepositAmount");
                        user.Rows[0]["Deposit"] = depositMoney;
                    }

                    //响应数据到客户端
                    return(SiteHelper.GetJsonFromHashTable(DataTableHelper.DataRowToHashTable(user.Rows[0]), "success", "登录成功", "UserInfo"));
                }
                else
                {
                    return(SiteHelper.GetJsonFromHashTable(null, "faild", "登录操作失败"));
                }
            }
        }