public IActionResult EditMerk(int id, MerkVM merkVM) { var edit = _iMerk.Update(merkVM, id); if (edit > 0) { return(Ok(edit)); } return(BadRequest("Not Successfully")); }
public int Create(MerkVM merkVM) { using (SqlConnection connection = new SqlConnection(_configuration.GetConnectionString("myConn"))) { var procName = "SPInsertMerk"; parameters.Add("merk", merkVM.Merk); var insert = connection.Execute(procName, parameters, commandType: CommandType.StoredProcedure); return(insert); } }
public IActionResult CreateMerk(MerkVM merkVM) { var create = _iMerk.Create(merkVM); if (create > 0) { return(Ok(create)); } return(BadRequest("Not Successfully")); }
public int Update(MerkVM merkVM, int id) { using (SqlConnection connection = new SqlConnection(_configuration.GetConnectionString("myConn"))) { var procName = "SPEditMerk"; parameters.Add("id", id); parameters.Add("merk", merkVM.Merk); var Edit = connection.Execute(procName, parameters, commandType: CommandType.StoredProcedure); return(Edit); } }