Exemplo n.º 1
0
 public void RemoveClient(client Client)
 {
     myclient.RemoveClient(Client.customerCellphone);
 }
Exemplo n.º 2
0
 public void updateClient(client Client)
 {
     myclient.UpdateClient(Client);
 }
Exemplo n.º 3
0
 public void Addclient(client Client)
 {
     myclient.AddClient(Client);
 }
Exemplo n.º 4
0
 public void AddClient(client c)
 {
     dal_func.Addclient(c);
 }
Exemplo n.º 5
0
 public void removeClient(client c)
 {
     dal_func.RemoveClient(c);
 }
Exemplo n.º 6
0
 public void UpdateClient(client Client)//update client
 {
     if (RemoveClient(Client.customerCellphone))
         AddClient(Client);
     else
         throw new NullReferenceException("Client not found!");
 }
Exemplo n.º 7
0
        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");
        }
Exemplo n.º 8
0
 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;
         }
     }
 }
Exemplo n.º 9
0
 public void RemoveClient(client Client)
 {
     DataSource.clientsList.Remove(Client);
 }
Exemplo n.º 10
0
 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");
 
 }