Ejemplo n.º 1
0
        public string UpdateSysUserPwd(string userid, string oldPassword, string newPassword)
        {
            #region
            JsonHelper jsonhlp = new JsonHelper();

            if (oldPassword == newPassword)
            {
                jsonhlp.AddObjectToJson("success", "false");
                jsonhlp.AddObjectToJson("msg", "新旧密码相同!");
                return(jsonhlp.ToString());
            }
            else
            {
                string       encodemd5           = Password.ToMD5(oldPassword);
                DBConditions querybusinessparams = new DBConditions();
                querybusinessparams.Add(ApplicationUserData.userid, EnumSqlType.sqlint, EnumCondition.Equal, userid);
                querybusinessparams.Add(ApplicationUserData.passWord, EnumSqlType.nvarchar, EnumCondition.Equal, encodemd5);
                ApplicationUserData applicationuserdata = new ApplicationUserData();
                this._applicationuserclass.GetSingleTAll(applicationuserdata, querybusinessparams);
                if (applicationuserdata.Tables[0].Rows.Count > 0)
                {
                    DataRow dr = applicationuserdata.Tables[0].Rows[0];
                    applicationuserdata.Assign(dr, ApplicationUserData.passWord, Password.ToMD5(newPassword));
                    //applicationuserclass.Save(applicationuserdata);
                    return(this.SaveApplicationUser(applicationuserdata));
                }
                else
                {
                    jsonhlp.AddObjectToJson("success", "false");
                    jsonhlp.AddObjectToJson("msg", "用户名密码不正确,请重新输入!");
                    return(jsonhlp.ToString());
                }
            }

            #endregion
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 添加ApplicationUser表行数据(如主键为非自增型字段,则自行修改代码)
 /// </summary>
 /// <param name="applicationuserdata">数据集对象</param>
 /// <param name="applicationuser">实体对象</param>
 public void AddRow(ref ApplicationUserData applicationuserdata, EntityApplicationUser applicationuser)
 {
     #region
     applicationuser.userid = _applicationuserclass.GetMaxAddOne(applicationuserdata).ToString();
     DataRow dr = applicationuserdata.Tables[0].NewRow();
     applicationuserdata.Assign(dr, ApplicationUserData.userid, applicationuser.userid);
     applicationuserdata.Assign(dr, ApplicationUserData.Username, applicationuser.Username);
     applicationuserdata.Assign(dr, ApplicationUserData.roleId, applicationuser.roleId);
     applicationuserdata.Assign(dr, ApplicationUserData.organizationId, applicationuser.organizationId);
     applicationuserdata.Assign(dr, ApplicationUserData.fullName, applicationuser.fullName);
     applicationuserdata.Assign(dr, ApplicationUserData.passWord, Password.ToMD5(applicationuser.passWord));
     applicationuserdata.Assign(dr, ApplicationUserData.telephone, applicationuser.telephone);
     applicationuserdata.Assign(dr, ApplicationUserData.isTotal, applicationuser.isTotal);
     applicationuserdata.Assign(dr, ApplicationUserData.email, applicationuser.email);
     applicationuserdata.Assign(dr, ApplicationUserData.usable, applicationuser.usable);
     applicationuserdata.Assign(dr, ApplicationUserData.loginTimes, applicationuser.loginTimes);
     applicationuserdata.Assign(dr, ApplicationUserData.lastLoginTime, applicationuser.lastLoginTime);
     applicationuserdata.Assign(dr, ApplicationUserData.writeTime, applicationuser.writeTime);
     applicationuserdata.Assign(dr, ApplicationUserData.writeUser, applicationuser.writeUser);
     applicationuserdata.Assign(dr, ApplicationUserData.writeIp, applicationuser.writeIp);
     applicationuserdata.Assign(dr, ApplicationUserData.isMarry, applicationuser.isMarry);
     applicationuserdata.Assign(dr, ApplicationUserData.birthday, applicationuser.birthday);
     applicationuserdata.Assign(dr, ApplicationUserData.household, applicationuser.household);
     applicationuserdata.Assign(dr, ApplicationUserData.oldHome, applicationuser.oldHome);
     applicationuserdata.Assign(dr, ApplicationUserData.nowLiveHome, applicationuser.nowLiveHome);
     applicationuserdata.Assign(dr, ApplicationUserData.intoCompanyDate, applicationuser.intoCompanyDate);
     applicationuserdata.Assign(dr, ApplicationUserData.workTotalYear, applicationuser.workTotalYear);
     applicationuserdata.Assign(dr, ApplicationUserData.still, applicationuser.still);
     applicationuserdata.Assign(dr, ApplicationUserData.maxEducation, applicationuser.maxEducation);
     applicationuserdata.Assign(dr, ApplicationUserData.maxEduCollege, applicationuser.maxEduCollege);
     applicationuserdata.Assign(dr, ApplicationUserData.maxEduLeaveTime, applicationuser.maxEduLeaveTime);
     applicationuserdata.Assign(dr, ApplicationUserData.workExperiences, applicationuser.workExperiences);
     applicationuserdata.Assign(dr, ApplicationUserData.studyExperiences, applicationuser.studyExperiences);
     applicationuserdata.Assign(dr, ApplicationUserData.photoUrl, applicationuser.photoUrl);
     applicationuserdata.Tables[0].Rows.Add(dr);
     #endregion
 }
Ejemplo n.º 3
0
 /// <summary>
 /// 编辑applicationuserdata数据集中指定的行数据
 /// </summary>
 /// <param name="applicationuserdata">数据集对象</param>
 /// <param name="applicationuser">实体对象</param>
 public void EditRow(ref ApplicationUserData applicationuserdata, EntityApplicationUser applicationuser)
 {
     #region
     if (applicationuserdata.Tables[0].Rows.Count <= 0)
     {
         applicationuserdata = this.getData(applicationuser.userid);
     }
     DataRow dr = applicationuserdata.Tables[0].Rows.Find(new object[1] {
         applicationuser.userid
     });
     applicationuserdata.Assign(dr, ApplicationUserData.userid, applicationuser.userid);
     applicationuserdata.Assign(dr, ApplicationUserData.Username, applicationuser.Username);
     applicationuserdata.Assign(dr, ApplicationUserData.roleId, applicationuser.roleId);
     applicationuserdata.Assign(dr, ApplicationUserData.organizationId, applicationuser.organizationId);
     applicationuserdata.Assign(dr, ApplicationUserData.fullName, applicationuser.fullName);
     //编辑的时候不动人家密码
     //applicationuserdata.Assign(dr, ApplicationUserData.passWord, Password.ToMD5(applicationuser.passWord));
     applicationuserdata.Assign(dr, ApplicationUserData.telephone, applicationuser.telephone);
     applicationuserdata.Assign(dr, ApplicationUserData.isTotal, applicationuser.isTotal);
     applicationuserdata.Assign(dr, ApplicationUserData.email, applicationuser.email);
     applicationuserdata.Assign(dr, ApplicationUserData.usable, applicationuser.usable);
     applicationuserdata.Assign(dr, ApplicationUserData.loginTimes, applicationuser.loginTimes);
     applicationuserdata.Assign(dr, ApplicationUserData.lastLoginTime, applicationuser.lastLoginTime);
     applicationuserdata.Assign(dr, ApplicationUserData.writeTime, applicationuser.writeTime);
     applicationuserdata.Assign(dr, ApplicationUserData.writeUser, applicationuser.writeUser);
     applicationuserdata.Assign(dr, ApplicationUserData.writeIp, applicationuser.writeIp);
     applicationuserdata.Assign(dr, ApplicationUserData.isMarry, applicationuser.isMarry);
     applicationuserdata.Assign(dr, ApplicationUserData.birthday, applicationuser.birthday);
     applicationuserdata.Assign(dr, ApplicationUserData.household, applicationuser.household);
     applicationuserdata.Assign(dr, ApplicationUserData.oldHome, applicationuser.oldHome);
     applicationuserdata.Assign(dr, ApplicationUserData.nowLiveHome, applicationuser.nowLiveHome);
     applicationuserdata.Assign(dr, ApplicationUserData.intoCompanyDate, applicationuser.intoCompanyDate);
     applicationuserdata.Assign(dr, ApplicationUserData.workTotalYear, applicationuser.workTotalYear);
     applicationuserdata.Assign(dr, ApplicationUserData.still, applicationuser.still);
     applicationuserdata.Assign(dr, ApplicationUserData.maxEducation, applicationuser.maxEducation);
     applicationuserdata.Assign(dr, ApplicationUserData.maxEduCollege, applicationuser.maxEduCollege);
     applicationuserdata.Assign(dr, ApplicationUserData.maxEduLeaveTime, applicationuser.maxEduLeaveTime);
     applicationuserdata.Assign(dr, ApplicationUserData.workExperiences, applicationuser.workExperiences);
     applicationuserdata.Assign(dr, ApplicationUserData.studyExperiences, applicationuser.studyExperiences);
     applicationuserdata.Assign(dr, ApplicationUserData.photoUrl, applicationuser.photoUrl);
     #endregion
 }