Example #1
0
 public bool Add(ModelViewClient entity)
 {
     if (entity == null)
     {
         throw new ArgumentNullException(nameof(entity));
     }
     return(clientLogic.Save(entity.Client));
 }
Example #2
0
 public void GetByClient(ModelViewClient client)
 {
     if (client == null)
     {
         entitiesView.MessageError(errorEmptyClient);
         return;
     }
     entitiesView.Bind(haspKeyModel.GetByClient(client));
 }
Example #3
0
        public List <ModelViewHaspKey> GetByClient(ModelViewClient client)
        {
            if (client == null)
            {
                throw new ArgumentNullException(nameof(client));
            }

            return(Convert(keyLogic.GetByClient(client.Client)));
        }
Example #4
0
        public void Add(ModelViewClient entity)
        {
            if (entity == null)
            {
                entitiesView.MessageError(errorAdd);
                return;
            }

            if (clientModel.Add(entity))
            {
                entitiesView.DataChange();
                Display();
            }
            else
            {
                entitiesView.MessageError(errorAdd);
            }
        }
Example #5
0
        public void FillModel(ModelViewClient item)
        {
            Entities = item ?? throw new ArgumentNullException(nameof(item));

            if (!CheckInputData())
            {
                return;
            }

            if (Entities.Id < 1)
            {
                Add(Entities);
            }
            else
            {
                Update(Entities);
            }
        }
Example #6
0
 public List <ModelViewMain> GetByClient(ModelViewClient client)
 => GetAll()
 .Where(x => x.IdClient == client.Id)
 .ToList();
Example #7
0
 public void FillInputItem(ModelViewClient item)
 {
     Entities = item ?? throw new ArgumentNullException(nameof(item));
     entitiesView.BindItem(item);
 }
Example #8
0
 public void GetByClient(ModelViewClient client)
 => mainView.Bind(mainModel?.GetByClient(client));