Exemplo n.º 1
0
 public static int UpdateUser(Dto.user u)
 {
     try
     {
         return(Dal.UserDal.UpdateUsers(converterEF.UsersConverters.ToDalUsers(u)));
     }
     catch (Exception e)
     {
         throw;
     }
 }
Exemplo n.º 2
0
 public static int adduser(Dto.user u)
 {
     try
     {
         return(Dal.UserDal.AddUser(converterEF.UsersConverters.ToDalUsers(u)));
     }
     catch
     {
         throw;
     }
 }
 public static Dto.user ToDtoUsers(Dal.Users e)
 {
     Dto.user en = new Dto.user();
     en.UserId     = e.UserId;
     en.RoleId     = e.RoleId;
     en.FirstName  = e.FirstName;
     en.LastName   = e.LastName;
     en.Password   = e.Password;
     en.Email      = e.Email;
     en.Phone      = e.Phone;
     en.Address    = e.Address;
     en.NumOfHouse = e.NumOfHouse;
     en.Locality   = e.Locality;
     en.BirthDate  = e.BirthDate;
     en.Active     = e.Active;
     return(en);
 }
Exemplo n.º 4
0
        public IHttpActionResult PostUser(Dto.user u)
        {
            try
            {
                int x = Bll.users.adduser(u);


                if (x == 0)
                {
                    return(NotFound());
                }
                else
                {
                    return(Ok(x));
                }
            }
            catch (Exception e)
            {
                return(BadRequest(e.Message));
            }
        }
Exemplo n.º 5
0
        public static int AddVolunteer(Dto.user volunteerDto)
        {
            var user = converterEF.UsersConverters.ToDalUsers(volunteerDto);

            return(Dal.VolunteerDal.AddVolunteer(user));
        }