public IActionResult UpdateAccCat([FromBody] DTO.AccessoryCategory accCat) { AccessoryCategoryDAO dao = new AccessoryCategoryDAO(_context); string msg; if (dao.Update(accCat)) { msg = "Update accessory category success"; } else { msg = "Update accessory category failed"; } return(new JsonResult(msg)); }
public IActionResult InsertAccCat([FromBody] DTO.AccessoryCategory accCat) { AccessoryCategoryDAO dao = new AccessoryCategoryDAO(_context); AccessoryCategory dto = new AccessoryCategory { AccCatId = accCat.AccCatId, AccCatName = accCat.AccCatName, PetCatId = accCat.PetCatId }; string msg; if (dao.Insert(dto)) { msg = "Insert accessory category success"; } else { msg = "Insert accessory category failed"; } return(new JsonResult(msg)); }