Esempio n. 1
0
        private void frmAddRoles_Load(object sender, EventArgs e)
        {
            try
            {
                if (Is_Edit == true)
                {
                    bsRoles_tbl.DataSource = db.FillRolesById(RoleID);
                }
            }
            catch (Exception)
            {
                throw;
            }

            bsRoles_tbl.DataSource = db.FillRoles();

            //if (dgvRolls.Rows.Count==0)
            //{
            //    btnDelete.Enabled = false;
            //    btnEdit.Enabled = false;
            //}
            //else
            //{
            //    btnEdit.Enabled = btnDelete.Enabled = true;
            //}
        }
Esempio n. 2
0
 private void frmShowrolles_Load(object sender, EventArgs e)
 {
     try
     {
         bsShowRolles.DataSource = db.FillRoles();
         if (dgvRolls.Rows.Count == 0)
         {
             btnDelete.Enabled = btnEdit.Enabled = false;
         }
         else
         {
             btnDelete.Enabled = btnEdit.Enabled = true;
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
Esempio n. 3
0
 private void frmAddUsers_Load(object sender, EventArgs e)
 {
     try
     {
         bsRolles.DataSource = db.FillRoles();
         if (IsEdit == true)
         {
             bsUsers.DataSource      = db.sp_FindUserByID(User_ID);
             cmbRolles.SelectedValue = Role_ID;
         }
     }
     catch (Exception)
     {
     }
 }
Esempio n. 4
0
        private void btnEdit_Click(object sender, EventArgs e)
        {
            frmAddRoles.Is_Edit = true;
            frmAddRoles.RoleID  = Convert.ToInt32(dgvRolls.CurrentRow.Cells[0].Value.ToString());
            new frmAddRoles().ShowDialog();
            db = new dcAccountancyDataContext();

            bsShowRolles.DataSource = db.FillRoles();
            if (dgvRolls.Rows.Count == 0)
            {
                btnDelete.Enabled = btnEdit.Enabled = false;
            }
            else
            {
                btnDelete.Enabled = btnEdit.Enabled = true;
            }
        }