コード例 #1
0
 public bool Add(ModelViewClient entity)
 {
     if (entity == null)
     {
         throw new ArgumentNullException(nameof(entity));
     }
     return(clientLogic.Save(entity.Client));
 }
コード例 #2
0
 public void GetByClient(ModelViewClient client)
 {
     if (client == null)
     {
         entitiesView.MessageError(errorEmptyClient);
         return;
     }
     entitiesView.Bind(haspKeyModel.GetByClient(client));
 }
コード例 #3
0
ファイル: HaspKeyModel.cs プロジェクト: Aborvalov/Hasp
        public List <ModelViewHaspKey> GetByClient(ModelViewClient client)
        {
            if (client == null)
            {
                throw new ArgumentNullException(nameof(client));
            }

            return(Convert(keyLogic.GetByClient(client.Client)));
        }
コード例 #4
0
ファイル: PresenterClient.cs プロジェクト: Aborvalov/Hasp
        public void Add(ModelViewClient entity)
        {
            if (entity == null)
            {
                entitiesView.MessageError(errorAdd);
                return;
            }

            if (clientModel.Add(entity))
            {
                entitiesView.DataChange();
                Display();
            }
            else
            {
                entitiesView.MessageError(errorAdd);
            }
        }
コード例 #5
0
ファイル: PresenterClient.cs プロジェクト: Aborvalov/Hasp
        public void FillModel(ModelViewClient item)
        {
            Entities = item ?? throw new ArgumentNullException(nameof(item));

            if (!CheckInputData())
            {
                return;
            }

            if (Entities.Id < 1)
            {
                Add(Entities);
            }
            else
            {
                Update(Entities);
            }
        }
コード例 #6
0
 public List <ModelViewMain> GetByClient(ModelViewClient client)
 => GetAll()
 .Where(x => x.IdClient == client.Id)
 .ToList();
コード例 #7
0
ファイル: PresenterClient.cs プロジェクト: Aborvalov/Hasp
 public void FillInputItem(ModelViewClient item)
 {
     Entities = item ?? throw new ArgumentNullException(nameof(item));
     entitiesView.BindItem(item);
 }
コード例 #8
0
ファイル: PresenterMain.cs プロジェクト: Aborvalov/Hasp
 public void GetByClient(ModelViewClient client)
 => mainView.Bind(mainModel?.GetByClient(client));