public void RemoveClient(client Client) { myclient.RemoveClient(Client.customerCellphone); }
public void updateClient(client Client) { myclient.UpdateClient(Client); }
public void Addclient(client Client) { myclient.AddClient(Client); }
public void AddClient(client c) { dal_func.Addclient(c); }
public void removeClient(client c) { dal_func.RemoveClient(c); }
public void UpdateClient(client Client)//update client { if (RemoveClient(Client.customerCellphone)) AddClient(Client); else throw new NullReferenceException("Client not found!"); }
public void AddClient(client Client)//add client { if (SearchClientByPhone(Client.customerCellphone) == null) { XElement Phone = new XElement("Phone", Client.customerCellphone); XElement Name = new XElement("Name", Client.CustomerName); XElement Address = new XElement("Address", Client.CustomerAddress); XElement Age = new XElement("Age", Client.customerAge); XElement clien = new XElement("Client_Details", Phone, Address, Age); ClientRoot.Add(new XElement("Branch", Name, clien)); ClientRoot.Save(ClientPath); } else throw new alreadyExists("DAL error: Id " + Client.customerCellphone + " already exists in data source"); }
public void updateClient(client Client) { for (int i = 0; i < DataSource.clientsList.Count(); i++) { if (DataSource.clientsList[i].customerCellphone == Client.customerCellphone) { DataSource.clientsList[i].CustomerAddress = Client.CustomerAddress; DataSource.clientsList[i].customerAge = Client.customerAge; DataSource.clientsList[i].CustomerName = Client.CustomerName; break; } } }
public void RemoveClient(client Client) { DataSource.clientsList.Remove(Client); }
public void Addclient(client Client) { if (searchClientByPhone(Client.customerCellphone) == null) { DataSource.clientsList.Add(Client); } else throw new alreadyExists("DAL error: client Phone " + Client.customerCellphone + " already exists in data source"); }