コード例 #1
0
        public int Usp_User_Register(UserEntity user)
        {
            try
            {
                using (AppBLL bll = new AppBLL())
                {
                    DataTable table = bll.FillDataTable("Usp_User_GetByMobile", new { C_Mobile = user.C_Mobile });
                    /// 手机号码已经注册
                    if (table.Rows.Count > 0)
                    {
                        return(-2);
                    }

                    user.I_Flag     = 1;
                    user.D_Create   = DateTime.Now;
                    user.C_Login    = user.C_Mobile;
                    user.C_Password = SHA256(user.C_Password);
                    WriteLog("用户注册", user);
                    return(bll.ExecuteNonQuery("Usp_User_Insert", user));
                }
            }
            catch (Exception ex)
            {
                return(-1);
            }
        }
コード例 #2
0
 public static int ChangePwd(string teacherID, string oldPwd, string newPwd, int status)
 {
     using (AppBLL bll = new AppBLL())
     {
         ChangePwdEntity entity = new ChangePwdEntity()
         {
             TeacherID = teacherID, OldPwd = oldPwd, NewPwd = newPwd, Status = status, Result = 0
         };
         bll.ExecuteNonQuery("USP_System_ChangePwd", entity);
         return(entity.Result);
     }
 }
コード例 #3
0
 public static int SaveUserGroup(UserGroupInfo userGroup)
 {
     using (AppBLL bll = new AppBLL())
     {
         if (userGroup.TeacherID.Trim().Equals("-1"))
         {
             //新增查重
             var       sql   = "Select * from tbUserGroupInfo Where Name=@UserName";
             DataTable table = bll.FillDataTableByText(sql, new { UserName = userGroup.Name });
             if (table.Rows.Count > 0)
             {
                 return(-1);                      //数据库中已经存在名称为{0}的用户或组
             }
         }
         return(bll.ExecuteNonQuery("USP_System_InsertUserGroup", userGroup));
     }
 }
コード例 #4
0
        public int Usp_User_Register(UserEntity user)
        {
            try
            {
                using (AppBLL bll = new AppBLL())
                {
                    DataTable table = bll.FillDataTable("Usp_User_GetByMobile", new { C_Mobile = user.C_Mobile });
                    /// 手机号码已经注册
                    if (table.Rows.Count > 0) return -2;

                    user.I_Flag = 1;
                    user.D_Create = DateTime.Now;
                    user.C_Login = user.C_Mobile;
                    user.C_Password = SHA256(user.C_Password);
                    WriteLog("用户注册", user);
                    return bll.ExecuteNonQuery("Usp_User_Insert", user);
                }
            }
            catch (Exception ex)
            {
                return -1;
            }
        }