Пример #1
0
 public IHttpActionResult addClerck(USERS_DTO user)
 {
     try
     {
         UserCRUD.Create(user);
         return(Ok());
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message));
     }
 }
Пример #2
0
        public void WhenAddingAUsers_UsersTableCountIsIncrementedByOne()
        {
            int beforeCount = 0;
            int afterCount  = 0;

            using (var db = new PosContext())
            {
                beforeCount = db.Users.Count();

                userCRUD.Create("Manager", TestUser.UserName, TestUser.UserPassword, TestUser.StartDate);

                afterCount = db.Users.Count();
            }
            Assert.AreEqual(beforeCount + 1, afterCount);
        }
Пример #3
0
        public ActionResult <Usuario> Create(Usuario usuario)
        {
            userCRUD.Create(usuario);

            return(CreatedAtRoute("GetBook", new { id = usuario.ID.ToString() }, usuario));
        }