Beispiel #1
0
        public bool Update(ModelViewHaspKey entity)
        {
            if (entity == null)
            {
                throw new ArgumentNullException(nameof(entity));
            }

            return(keyLogic.Update(entity.HaspKey));
        }
Beispiel #2
0
        public bool CheckKey(ModelViewHaspKey item)
        {
            if (item == null)
            {
                throw new ArgumentNullException(nameof(item));
            }

            return(keyFeatures
                   .LastOrDefault(x => x.IdHaspKey == item.Id &&
                                  x.EndDate >= DateTime.Now.Date) == null);
        }
Beispiel #3
0
        public void FillModel(ModelViewHaspKey item)
        {
            Entities = item ?? throw new ArgumentNullException(nameof(item));
            if (!CheckInputData())
            {
                return;
            }

            if (Entities.Id < 1)
            {
                Add(Entities);
            }
            else
            {
                Update(Entities);
            }
        }
Beispiel #4
0
        public void Update(ModelViewHaspKey entity)
        {
            if (entity == null)
            {
                entitiesView.MessageError(errorUpdate);
                return;
            }

            if (haspKeyModel.Update(entity))
            {
                entitiesView.DataChange();
                Display();
            }
            else
            {
                entitiesView.MessageError(errorUpdate);
            }
        }
Beispiel #5
0
 public void FillInputItem(ModelViewHaspKey item)
 {
     Entities = item ?? throw new ArgumentNullException(nameof(item));
     entitiesView.BindItem(item);
 }