public DataRetriver(IRepo repo, Entity entity, DataRetriverCancelActions action) { this.repo = repo; this.entity = entity; cancelAction = action; InitializeComponent(); fields = entity != null?entity.GetFields() : repo.GetFields(); int ypos = 10; foreach (Field field in fields) { Panel p = field.GetFieldView(); p.Location = new Point(0, ypos); ypos = ypos + 30; panel1.Controls.Add(p); } }
public UserDataRetriver(IRepo repo, Entity entity, DataRetriverCancelActions action, User user) : base(repo, entity, action) { fields.Last().SetValue(user.username); fields.FindAll(field => field.AdminAccsessOnly).ForEach(field => field.GetFieldView().Hide()); }