private void EmployeeListForm_Load(object sender, EventArgs e)
 {
     securedObjectSpace       = objectSpaceProvider.CreateObjectSpace();
     employeeGrid.DataSource  = securedObjectSpace.GetBindingList <Employee>();
     newBarButtonItem.Enabled = security.CanCreate <Employee>();
     protectedContentTextEdit = new RepositoryItemProtectedContentTextEdit();
 }
Beispiel #2
0
 private void EmployeeListForm_Load(object sender, EventArgs e)
 {
     security            = ((MainForm)MdiParent).Security;
     objectSpaceProvider = ((MainForm)MdiParent).ObjectSpaceProvider;
     securedObjectSpace  = objectSpaceProvider.CreateObjectSpace();
     employeeBindingSource.DataSource = securedObjectSpace.GetObjects <Employee>();
     newBarButtonItem.Enabled         = security.CanCreate <Employee>();
     protectedContentTextEdit         = new RepositoryItemProtectedContentTextEdit();
 }
Beispiel #3
0
 protected void EmployeeGrid_CommandButtonInitialize(object sender, ASPxGridViewCommandButtonEventArgs e)
 {
     if (e.ButtonType == ColumnCommandButtonType.New)
     {
         if (!security.CanCreate <Employee>())
         {
             e.Text = string.Empty;
         }
     }
     if (e.ButtonType == ColumnCommandButtonType.Delete)
     {
         Employee employee = ((ASPxGridView)sender).GetRow(e.VisibleIndex) as Employee;
         e.Visible = security.CanDelete(employee);
     }
 }