Ejemplo n.º 1
0
 public PermissionsEdit(XSD.dsPermissionsList.PermissionsDescriptionsRow rw, DataView dv, bool bIsEdit)
 {
     this.rw      = rw;
     this.bIsEdit = bIsEdit;
     InitializeComponent();
     this.dvPermissionsList.Table = dv.Table.Copy();
     XSD.dsPermissionsList.PermissionsDescriptionsRow dr = (XSD.dsPermissionsList.PermissionsDescriptionsRow) this.dvPermissionsList.Table.NewRow();
     dr.Description  = "<Нет>";
     dr.InternalName = "";
     dr.SetParentPermissionIDNull();
     dr.PermissionID     = 0;
     dr.PermissionTypeID = 1;
     this.dvPermissionsList.Table.Rows.Add((DataRow)dr);
     this.dvPermissionsList.Sort  = "Description";
     this.cmbParent.DataSource    = this.dvPermissionsList;
     this.cmbParent.DisplayMember = "Description";
     this.cmbParent.ValueMember   = "PermissionID";
 }
Ejemplo n.º 2
0
 private void bnOK_Click(object sender, System.EventArgs e)
 {
     if (!this.validatePermissions())
     {
         return;
     }
     rw.Description  = this.tbDescription.Text;
     rw.InternalName = this.tbInternalName.Text;
     if ((int)this.cmbParent.SelectedValue > 0)
     {
         rw.ParentPermissionID = (int)this.cmbParent.SelectedValue;
     }
     else
     {
         rw.SetParentPermissionIDNull();
     }
     rw.PermissionTypeID = 1;
     this.DialogResult   = DialogResult.OK;
     this.Close();
 }