예제 #1
0
 protected void SaveClick(object sender, EventArgs e)
 {
     UserFlow uFlow = new UserFlow();
     if (txtGroupID.Text == "")
     {
         if (uFlow.InsertGroup(Authz.CurrentUserInfo.UserID, txtGroupName.Text))
         {
             Response.Redirect("GroupDetail.aspx?id=" + uFlow.GetLastRoleID());
         }
         else
             Appz.ClientAlert(this, uFlow.ErrorMessage);
     }
     else
     {
         if (!uFlow.UpdateGroup(Authz.CurrentUserInfo.UserID, txtGroupID.Text, txtGroupName.Text))
             Appz.ClientAlert(this, uFlow.ErrorMessage);
         else
         {
             // Save Role
             if (!uFlow.SaveRoleMenu(Authz.CurrentUserInfo.UserID, txtGroupID.Text, z2Menu.SelectedData))
                 Appz.ClientAlert(this, uFlow.ErrorMessage);
             else
                 Appz.ClientAlert(this, "ºÑ¹·Ö¡¢éÍÁÙÅàÃÕºÃéÍÂ");
         }
     }
 }
예제 #2
0
    protected void SaveClick(object sender, EventArgs e)
    {
        UserFlow uFlow = new UserFlow();
        if (txtRoleID.Text == "")
        {
            if (uFlow.CreateRoleForUser(Authz.CurrentUserInfo.UserID, Request["id"], cmbLevel.SelectedItem.Value))
            {
                Response.Redirect("UserDetail.aspx?id=" + Request["id"]);
            }
            else
                Appz.ClientAlert(this, uFlow.ErrorMessage);
        }
        else
        {
            // Update Role Level
            if (!uFlow.UpdateRoleLevel(Authz.CurrentUserInfo.UserID, txtRoleID.Text, cmbLevel.SelectedItem.Value, chkHHT.Checked, chkPOS.Checked))
                Appz.ClientAlert(this, uFlow.ErrorMessage);
            else
            {

                // Save Group
                if (!uFlow.SaveUserGroup(Authz.CurrentUserInfo.UserID, txtRoleID.Text, (cmbLevel.SelectedItem.Value == "A" ? new ArrayList() : z2Group.SelectedData)))
                    Appz.ClientAlert(this, uFlow.ErrorMessage);
                else
                {

                    // Save Role
                    if (!uFlow.SaveRoleMenu(Authz.CurrentUserInfo.UserID, txtRoleID.Text, (cmbLevel.SelectedItem.Value == "A" ? new ArrayList() : z2Menu.SelectedData)))
                        Appz.ClientAlert(this, uFlow.ErrorMessage);
                    else
                        Appz.ClientAlert(this, "ºÑ¹·Ö¡¢éÍÁÙÅàÃÕºÃéÍÂ");
                }
            }
        }
    }