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(); }
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; }
public FormEntity(IEntityEditControl editControl, BaseEntity entity, string title) { InitializeComponent(); this.Text = title; this.entity = entity; EditControl = editControl; EditControl.Initialize(cmdMan); cmdMan.Commands.AddRange(EditControl.GetCommands()); Control c = editControl as Control; c.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; c.Location = new Point(3, 3); c.Size = new Size(663, c.Size.Height); panelControl1.Controls.Add(c); panelControl1.AutoScroll = true; cmdMan.SetCommandTriggers(); cmdMan.SetCommandControlsVisibility(); cmdMan.SetCommandControlsEnable(); }
public void ShowEntity(BaseEntity entity) { if (entity == null) return; CurrentTemplate = (Report)entity; if (CurrentTemplate.Id > 0) { DMT.Provider.UpdateEditControlValuesWithEntity(layoutEntity, CurrentTemplate); listEntityTemplateParam.BindData(); using (System.IO.Stream stream = new MemoryStream(Encoding.UTF8.GetBytes(CurrentTemplate.ReportLayout))) { report = new XtraReport(); report.LoadLayout(stream); } panelDetail.Visible = true; } else { DMT.Provider.UpdateEditControlValuesWithEntity(layoutEntity, CurrentTemplate); panelDetail.Visible = false; } }
public void ShowEntity(BaseEntity entity) { CurrentRole = (Role)entity; if (CurrentRole.Id > 0) { DMT.Provider.UpdateEditControlValuesWithEntity(layoutEntity, CurrentRole); listEntityRoleUser.BindData(); listEntityRoleRight.BindData(); panelDetail.Visible = true; } else { DMT.Provider.UpdateEditControlValuesWithEntity(layoutEntity, CurrentRole); panelDetail.Visible = false; } }
public void ShowEntity(BaseEntity entity) { CurrentMedia = (Media)entity; if (CurrentMedia.Id > 0) { DMT.Provider.UpdateEditControlValuesWithEntity(layoutEntity, CurrentMedia); listEntityAuthor.BindData(); listEntityContentDefinition.BindData(); panelDetail.Visible = true; } else { DMT.Provider.UpdateEditControlValuesWithEntity(layoutEntity, CurrentMedia); panelDetail.Visible = false; } }
public FormEntity CreateFormFor(BaseEntity entity) { Type entityType = entity.GetType(); return CreateFormFor(entityType, entity); }
public static string CompareFields(this BaseEntity obj1, BaseEntity obj2) { // InsertDate, UpdateDate, InsertUserId","UpdateUserId" alanlarındaki değişiklikleri değişiklikten saymıyoruz return System.Utility.CompareFields(obj1, obj2, pi => !new[] { "InsertDate", "UpdateDate", "InsertUserId", "UpdateUserId" }.Contains(pi.Name)); }