예제 #1
0
    private void SetData()
    {
        if (Request["id"] != "new" && Request["id"] != "")
        {
            pnlRole.Visible = true;

            UserFlow uFlow = new UserFlow();
            txtGroupID.Text = Request["id"];

            DataTable zDt = uFlow.GetRoleData(txtGroupID.Text);

            if (zDt.Rows.Count > 0)
            {
                if (zDt.Rows[0]["ZLEVEL"].ToString() != "G")
                {
                    pnlRole.Visible = false;
                    lblRoleError.Visible = true;
                    lblRoleError.Text = "Group ID äÁè¶Ù¡µéͧ";
                    txtGroupName.Enabled = false;
                }
                else
                {
                    txtGroupName.Text = zDt.Rows[0]["DESCRIPTION"].ToString();
                }
            }
            else
            {
                pnlRole.Visible = false;
                lblRoleError.Visible = true;
                lblRoleError.Text = "Group ID äÁè¶Ù¡µéͧ";
                txtGroupName.Enabled = false;
            }


            // SET Menu Data
            z2Menu.SetSource(uFlow.GetMenuRoleNotAssign(txtGroupID.Text));
            z2Menu.SetDest(uFlow.GetMenuRoleAssign(txtGroupID.Text));


        }
        else
        {
            lblRoleError.Visible = true;
            pnlRole.Visible = false;
        }
    }
예제 #2
0
    private void SetStartUpData()
    {
        UserFlow uFlow = new UserFlow();
        DataTable zDt = uFlow.GetUserData(Request["id"]);
        if (zDt.Rows.Count > 0)
        {
            lblUID.Text = zDt.Rows[0]["USERID"].ToString();
            lblUName.Text = zDt.Rows[0]["TNAME"].ToString() + " " + zDt.Rows[0]["LASTNAME"].ToString();
        }
        txtRoleID.Text = uFlow.GetRoleID(Request["id"]);
        if (txtRoleID.Text == "")
        {
            pnlExtSystem.Visible = false;
            pnlRole.Visible = false;
            lblRoleError.Visible = true;
        }
        else
        {

            zDt = uFlow.GetRoleData(txtRoleID.Text);
            if (zDt.Rows.Count > 0)
            {
                pnlRole.Visible = true;
                lblRoleError.Visible = false ;
                pnlExtSystem.Visible = true;
                cmbLevel.SelectedIndex = cmbLevel.Items.IndexOf(cmbLevel.Items.FindByValue(zDt.Rows[0]["ZLEVEL"].ToString()));
                chkHHT.Checked = (zDt.Rows[0]["HHT"].ToString() == "Y");
                chkPOS.Checked = (zDt.Rows[0]["POS"].ToString() == "Y");

                if (cmbLevel.SelectedItem.Value == "A")
                    pnlRole.Visible = false;
                else
                {
                    SetEditGroupMode();
                }

                // SET Group Data
                z2Group.SetSource(uFlow.GetGroupRoleNotIn(txtRoleID.Text));
                z2Group.SetDest(uFlow.GetGroupRoleIn(txtRoleID.Text));

                // SET Menu Data
                z2Menu.SetSource(uFlow.GetMenuRoleNotAssign(txtRoleID.Text));
                z2Menu.SetDest(uFlow.GetMenuRoleAssign(txtRoleID.Text));
            }
        }
    }