Пример #1
0
 public DialogResult ShowDialog(BaseEntity entity)
 {
     FormEntity fe = CreateFormFor(entity);
     if (fe == null)
         throw new Exception(entity.GetType().Name + " adlı entitiye ilişkin form bulunamadı!");
     return fe.ShowDialog();
 }
Пример #2
0
        public FormEntity CreateFormFor(Type entityType, BaseEntity entity)
        {
            if (entity == null)
                entity = (BaseEntity)Activator.CreateInstance(entityType);

            foreach (var item in EditForms)
                if (item.EntityType == entity.GetType())
                    return new FormEntity((IEntityEditControl)Activator.CreateInstance(item.FormType), entity, item.DisplayName.Replace("ler", "").Replace("lar", ""));

            return null;
        }
Пример #3
0
 public FormEntity CreateFormFor(BaseEntity entity)
 {
     Type entityType = entity.GetType();
     return CreateFormFor(entityType, entity);
 }