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