Exemple #1
0
 public static User GetInstance(long inID, Xy.Data.DataBase DB = null)
 {
     System.Data.DataTable result = Get(inID, DB);
     if (result.Rows.Count > 0) {
         User temp = new User();
         temp.Fill(result.Rows[0]);
         return temp;
     }
     return null;
 }
Exemple #2
0
 public static Xy.Web.Security.IUser Login(string inUserName, string inPassword, bool inOrginalPassword, out string ErrorString)
 {
     ErrorString = string.Empty;
     Xy.Data.Procedure tp = User.GetProcedure(R("Login"));
     tp.SetItem("Name", inUserName);
     if (inOrginalPassword) inPassword = Encrypt.Encrypt(inPassword);
     tp.SetItem("Password", inPassword);
     System.Data.DataTable ti = tp.InvokeProcedureFill();
     if (ti.Rows.Count > 0) {
         User tu = new User();
         tu.Fill(ti.Rows[0]);
         return tu;
     } else {
         ErrorString = "该用户未注册 或 用户密码错误";
         Xy.Tools.Web.Cookie.Del("UserKey");
     }
     return null;
 }