Ejemplo n.º 1
0
        private void FillFormForUpdate()
        {
            Role role = applicationFacade.GetRoleById(this.RoleId);

            if (role != null)
            {
                txtRoleName.Text       = role.RoleName;
                cbxStatus.SelectedItem = role.Status ? Enums.Status.Active : Enums.Status.Inactive;

                if (role.PrivledgeList != null)
                {
                    for (int i = 0; i < chkPrivledgeList.Items.Count; i++)
                    {
                        Privledge priv = (Privledge)chkPrivledgeList.Items[i];

                        if (role.PrivledgeList.Any(x => x.PrivledgeId == priv.PrivledgeId))
                        {
                            this.chkPrivledgeList.SetItemChecked(i, true);
                        }
                    }
                }
            }
        }