示例#1
0
 public IHttpActionResult DeleteClerck(USERS_DTO user)
 {
     try
     {
         UserCRUD.Delete(user);
         return(Ok());
     }
     catch (Exception ex)
     {
         return(InternalServerError(ex));
     }
 }
示例#2
0
        public void WhenDeletingAUser_UsersTableCountIsDecrementedByOne()
        {
            int beforeCount = 0;
            int afterCount  = 0;

            using (var db = new PosContext())
            {
                db.Users.Add(TestUser);
                db.SaveChanges();
                userCRUD.selectedUser = TestUser;
                beforeCount           = db.Users.Count();
                userCRUD.Delete(TestUser.UserID);
                afterCount = db.Users.Count();
            }
            Assert.AreEqual(beforeCount - 1, afterCount);
        }
示例#3
0
        public async void OnDeleteClicked(object sender, EventArgs args)
        {
            try
            {
                bool accepted = await DisplayAlert("Confirm", "Are you Sure ?", "Yes", "No");

                if (accepted)
                {
                    userCRUD.Delete(selusers);
                }
                await DisplayAlert("Sucess", "Data is Deleted Successfully", "OK");

                await Navigation.PushAsync(new Userlist());
            }
            catch (Exception ex)
            {
                string error = ex.ToString();
                await DisplayAlert("Sorry...", "Something went wrong. Try after sometime.", "OK");
            }
        }
示例#4
0
        public bool UserDelete(int id)
        {
            UserCRUD user = new UserCRUD();

            return(user.Delete(id));
        }