Exemplo n.º 1
0
    private void DisplayRoleData()
    {
        if (c.qsAct == ConfigFormAction.edit)
        {
            EmployeeRoleForBackend role = empAuth.GetEmployeeRoleData(c.qsRoleId);

            if (role != null)
            {
                txtSortNo.Text            = role.SortNo.ToString();
                txtRoleName.Text          = role.RoleName;
                txtRoleName.Enabled       = false;
                txtRoleDisplayName.Text   = role.RoleDisplayName;
                CopyPrivilegeArea.Visible = false;

                //modification info
                ltrPostAccount.Text = role.PostAccount;
                ltrPostDate.Text    = string.Format("{0:yyyy-MM-dd HH:mm:ss}", role.PostDate);

                if (role.MdfDate.HasValue)
                {
                    ltrMdfAccount.Text = role.MdfAccount;
                    ltrMdfDate.Text    = string.Format("{0:yyyy-MM-dd HH:mm:ss}", role.MdfDate);
                }

                btnSave.Visible = true;
            }
        }
        else if (c.qsAct == ConfigFormAction.add)
        {
            int newSortNo = empAuth.GetEmployeeRoleMaxSortNo() + 10;
            txtSortNo.Text = newSortNo.ToString();

            btnSave.Visible = true;
        }
    }