示例#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();
        }
示例#2
0
 public CountingSoftwareUsers Create(CountingSoftwareUsers user)
 {
     _context.CountingSoftwareUsers.Add(user);
     _context.SaveChanges();
     return(user);
 }