コード例 #1
0
ファイル: UserDAL.cs プロジェクト: esthershalti/wedding
 /// <summary> - NewUser: add new user to user tbl in db.
 public static Users__tbl NewUser(Users__tbl udal)
 {
     try
     {
         using (projectDBEntities5 db = new projectDBEntities5())
         {
             Users__tbl newUser = new Users__tbl
             {
                 UserName     = udal.UserName,
                 UserLastName = udal.UserLastName,
                 UserMail     = udal.UserMail,
                 UserPassword = udal.UserPassword,
                 UserType     = udal.UserType
             };
             db.Users__tbl.Add(newUser);
             db.SaveChanges();
             return(newUser);
         }
     }
     catch (Exception e)
     {
         Console.WriteLine(e);
         return(null);
     }
 }
コード例 #2
0
ファイル: UserDTO.cs プロジェクト: esthershalti/wedding
 public UserDTO(DAL.Users__tbl user)
 {
     this.UserCode     = user.UserCode;
     this.UserLastName = user.UserLastName;
     this.UserName     = user.UserName;
     this.UserMail     = user.UserMail;
     this.UserPassword = user.UserPassword;
     this.UserType     = user.UserType;
 }
コード例 #3
0
ファイル: UserDAL.cs プロジェクト: esthershalti/wedding
 /// <summary> - Exist: check if user is exist.
 public static Users__tbl Exist(Users__tbl u)
 {
     try
     {
         using (projectDBEntities5 db = new projectDBEntities5())
         {
             Users__tbl User = db.Users__tbl.Where(x => x.UserPassword == u.UserPassword && x.UserName == u.UserName).FirstOrDefault();
             return(User);
         }
     }
     catch (Exception e)
     {
         Console.WriteLine(e);
         return(null);
     }
 }