public async Task <IActionResult> PutmodifyInterventionStatuswithdateStart(long id) { var intervention = await _context.Interventions.FindAsync(id); intervention.Status = "InProgress"; DateTime myvalue = DateTime.Now; string mytime = myvalue.ToString(); intervention.StartInterv = mytime; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!interventionsExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutmodifyCustomer(Customers cust) { if (cust == null) { return(BadRequest()); } var cus = await _context.Customers.FindAsync(cust.Id); cus.CpyContactFullName = cust.CpyContactFullName; cus.CpyContactPhone = cust.CpyContactPhone; cus.CpyContactEmail = cust.CpyContactEmail; cus.TechManagerServiceEmail = cust.TechManagerServiceEmail; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CustomersExists(cust.Id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutmodifyElevatorStatus(long id, string status) { if (status == null) { return(BadRequest()); } var elevator = await _context.Elevators.FindAsync(id); elevator.Status = status; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!elevatorsExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutmodifyColumnStatus(long id, string Status) { if (Status == null) { return(BadRequest()); } var column = await _context.Columns.FindAsync(id); column.Status = Status; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!columnsExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutmodifBatterySatus(long Id, string Status) { if (Status == null) { return(BadRequest()); } var battery = await _context.Batteries.FindAsync(Id); battery.Status = Status; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BatteriesExists(Id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutmodifyAddresses(long id, string Status, string City, string Country, string PostalCode, string SuiteApt, string TypeAddress, string NumberStreet) { var adr = await _context.Addresses.FindAsync(id); if (adr == null) { return(BadRequest()); } adr.Status = Status; adr.City = City; adr.Country = Country; adr.PostalCode = PostalCode; adr.SuiteApt = SuiteApt; adr.TypeAddress = TypeAddress; adr.NumberStreet = NumberStreet; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AddressesExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }