Example #1
0
        public JsonResult DeleteData(int id)
        {
            TEST_SK dbcontext = new TEST_SK();
            Users   dbdelete  = dbcontext.Users.FirstOrDefault(r => r.ID == id);

            dbcontext.Users.Remove(dbdelete);
            dbcontext.SaveChanges();

            return(Json(new { status = "Delete success !!" }));
        }
Example #2
0
        public JsonResult InsertData(Parameteruser users)
        {
            TEST_SK dbcontext = new TEST_SK();
            var     dbinsert  = new Users();


            dbcontext.Users.Add(new Users
            {
                firstname = users.firstname,
                lastname  = users.lastname,
                email     = users.email,
                phone     = users.phone,
            });

            dbcontext.SaveChanges();



            return(Json(new { status = "Insert success !!" }));
        }