Beispiel #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (request_id != 0)//修改
         {
             btn_AddUser.Text = "确认修改";
             TUserInfo user = TUserInfo.FindById(request_id);
             if (user != null)
             {
                 tb_account.Text            = user.Account;
                 tb_password.Text           = user.Pwd;
                 tb_name.Text               = user.Name;
                 ddl_UserType.SelectedValue = user.UserTypeId.ToString();
                 tb_IDCardNum.Text          = user.IDCardNum;
                 tb_Phone.Text              = user.Phone;
             }
             else
             {
                 Page.ClientScript.RegisterStartupScript(this.GetType(), "alter", "parent.layer.msg('数据加载错误,请重新再试!', 1, -1);", true);
                 return;
             }
         }
     }
 }
Beispiel #2
0
 public static TUserInfo GetUserById(int id)
 {
     try
     {
         TUserInfo user = TUserInfo.FindById(id);
         return(user);
     }
     catch
     {
         return(null);
     }
 }
Beispiel #3
0
 public static string ResetPwdById(int infoid)
 {
     try
     {
         var info = TUserInfo.FindById(infoid);
         info.Pwd = "123456";
         info.Save();
         return("1");
     }
     catch
     {
         return("0");
     }
 }
Beispiel #4
0
 public static string DeleteUserById(int infoid, int deluserid, DateTime deltime)
 {
     try
     {
         var delinfo = TUserInfo.FindById(infoid);
         delinfo.IsDel     = true;
         delinfo.DelUserId = deluserid;
         delinfo.DelTime   = deltime;
         delinfo.Save();
         return("1");
     }
     catch
     {
         return("0");
     }
 }
Beispiel #5
0
        public static string UpdatePwdById(int userid, string pwd)
        {
            try
            {
                TUserInfo person = TUserInfo.FindById(userid);
                person.Pwd = pwd;

                person.IsDel = false;
                //person.CreateUserId = createuserid;
                //person.CreateTime = createtime;
                person.Save();
                return("1");
            }
            catch
            {
                return("0");
            }
        }
Beispiel #6
0
        public static string UpdateUser(int userId, string account, string pwd, string name, int userTypeId, string IDCardNum, string Phone, int createuserid, DateTime createtime)
        {
            try
            {
                var AsAdmin = TUserInfo.FindById(userId);
                AsAdmin.Account    = account;
                AsAdmin.Pwd        = pwd;
                AsAdmin.Name       = name;
                AsAdmin.UserTypeId = userTypeId;
                AsAdmin.IDCardNum  = IDCardNum;
                AsAdmin.Phone      = Phone;

                AsAdmin.CreateUserId = createuserid;
                AsAdmin.CreateTime   = createtime;
                AsAdmin.Save();
                return("1");
            }
            catch
            {
                return("0");
            }
        }