//Update Providers public int Update(Persons personProvider, Int64 id) { try { String code = db.Check_CodePersons(personProvider.Code); All_Providers providers = GetById(id); if (code == null || code == providers.Code) { db.Update_Provider(personProvider, providers.IDPerson); return(200); } else { return(400); } } catch (Exception) { return(500); } }
//Update Client public int Update(Persons personClient, Int64 id) { try { String code = db.Check_CodePersons(personClient.Code); All_Clients client = GetById(id); if (code == null || code == client.Code) { db.update_Client(personClient, client.IDPerson); return(200); } else { return(400); } } catch (Exception) { return(500); } }