public static DAL.users GetUser(user userdto) { if (userdto == null) { return(null); } DAL.users user = new DAL.users() { UserId = userdto.UserId, UserName = userdto.UserName, Tel = userdto.Tel, Email = userdto.Email, Password = userdto.Password, TypeUser = userdto.TypeUser, IsDeleted = false, //TypeUser1 = DTO.NewFolder1.TypeUser.GetTypeUser(userdto.TypeUser), Dairy = NewFolder1.Dairy.GetListDairyDAL(userdto.Dairy as List <Dairy>), Reference = NewFolder1.Reference.GetListReferenceDAL(userdto.Reference as List <Reference>), }; return(user); }
public static user GetUser(DAL.users u) { if (u == null) { return(null); } user dto = new user() { UserId = u.UserId, UserName = u.UserName, Tel = u.Tel, Email = u.Email, Password = u.Password, TypeUser = u.TypeUser, IsDeleted = false, TypeUser1 = DTO.NewFolder1.TypeUser.GetTypeUser(u.TypeUser1), Dairy = NewFolder1.Dairy.GetListDairyDTO(u.Dairy as List <DAL.Dairy>), Reference = NewFolder1.Reference.GetListReferenceDTO(u.Reference as List <DAL.Reference>), }; return(dto); }
public int Login(users s) { string sql = string.Format(@"select count(*) from [user] where [user_name]='{0}' and user_password='******'", s.user_name, s.user_password); return((int)SqlDBHelper.DGZ(sql)); }