コード例 #1
0
 private void EmployeeDetailForm_Load(object sender, EventArgs e)
 {
     securedObjectSpace = objectSpaceProvider.CreateObjectSpace();
     if (employee == null)
     {
         employee = securedObjectSpace.CreateObject <Employee>();
     }
     else
     {
         employee = securedObjectSpace.GetObject(employee);
         deleteBarButtonItem.Enabled = security.CanDelete(employee);
     }
     AddControls();
 }
コード例 #2
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);
     }
 }
コード例 #3
0
 private void EmployeeDetailForm_Load(object sender, EventArgs e)
 {
     security            = ((MainForm)MdiParent).Security;
     objectSpaceProvider = ((MainForm)MdiParent).ObjectSpaceProvider;
     securedObjectSpace  = objectSpaceProvider.CreateObjectSpace();
     if (employee == null)
     {
         employee = securedObjectSpace.CreateObject <Employee>();
     }
     else
     {
         employee = securedObjectSpace.GetObject(employee);
         deleteBarButtonItem.Enabled = security.CanDelete(employee);
     }
     employeeBindingSource.DataSource = employee;
     AddControls();
 }
コード例 #4
0
 private void EmployeeGridView_FocusedRowObjectChanged(object sender, FocusedRowObjectChangedEventArgs e)
 {
     deleteBarButtonItem.Enabled = security.CanDelete(e.Row);
 }