示例#1
0
        public void Add(DeanDTO dean)
        {
            if (dean == null)
            {
                throw new ValidationException("Декан не найден.", "");
            }
            Dean addingDean = AutoMap <DeanDTO, Dean> .Map(dean);

            Database.Deans.Add(addingDean);
            Database.Commit();
        }
示例#2
0
        public void Edit(DeanDTO dean)
        {
            try
            {
                if (dean == null)
                {
                    throw new ValidationException("Декан не найден.", "");
                }
                var findingDean = ValidateModule.ValidateDean(dean.Id);
                findingDean = AutoMap <DeanDTO, Dean> .Map(dean, findingDean);

                Database.Deans.Edit(findingDean);
                Database.Commit();
            }
            catch (ValidationException)
            {
                throw;
            }
        }