Exemplo n.º 1
0
        public void Update(CountingSoftwareUsers user)
        {
            var countingsoftwareusers = _context.CountingSoftwareUsers.Find(user.Id);

            if (countingsoftwareusers == null)
            {
                throw new AppException("User not found");
            }


            // update user properties
            countingsoftwareusers.Password    = user.Password;
            countingsoftwareusers.RoleId      = user.RoleId;
            countingsoftwareusers.Username    = user.Username;
            countingsoftwareusers.WilayatCode = user.WilayatCode;
            _context.CountingSoftwareUsers.Update(countingsoftwareusers);
            _context.SaveChanges();
        }
Exemplo n.º 2
0
 public CountingSoftwareUsers Create(CountingSoftwareUsers user)
 {
     _context.CountingSoftwareUsers.Add(user);
     _context.SaveChanges();
     return(user);
 }