예제 #1
0
    protected void dgUsers_SelectedIndexChanged(object sender, EventArgs e)
    {
        string userId = Convert.ToString(dgUsers.DataKeys[dgUsers.SelectedIndex].ToString());

        hfId.Value = userId.ToString();
        //SessionHandler"UserID"] = iUserID;
        UserMaster oUserMaster = new UserMaster();
        UserDTO    oUserData   = oUserMaster.GetUser(userId);

        if (oUserData != null)
        {
            txtUserId.Text   = oUserData.UserId;
            txtUserName.Text = oUserData.UserName;
            txtPassword.Attributes.Add("value", oUserData.Password);
            chkActive.Checked             = oUserData.Active;
            ddlUserRoleList.SelectedIndex = ddlUserRoleList.Items.IndexOf(ddlUserRoleList.Items.FindByValue(oUserData.UserRoleData.UserRoleId.ToString()));
            txtUserEmailId.Text           = oUserData.EmailId;
        }
        oUserMaster = null;
        oUserData   = null;

        //btnAddNew.Enabled = false;
        //btnCancel.Enabled = true;
        btnCancel.Visible = true;
        btnDelete.Enabled = true;
        btnEdit.Text      = "Update";
        //btnSave.Enabled = false;
        lblStatus.Text = "";
    }
예제 #2
0
        private void SaveUserInfoToSession(string userId)
        {
            LoggedInUser LoggedInUser = new LoggedInUser();
            UserMaster   userMaster   = new UserMaster();
            UserDTO      user;

            user = userMaster.GetUser(userId);

            LoggedInUser.User = user;
            if (user != null)
            {
                RoleRightsMaster     roleRightsMaster = new RoleRightsMaster();
                List <RoleRightsDTO> roleRightsList   = null;
                if (user.UserRoleData != null && user.UserRoleData.UserRoleId != 0)
                {
                    roleRightsList = roleRightsMaster.GetRoleRights(user.UserRoleData.UserRoleId);
                }
                LoggedInUser.RoleRigthsList = roleRightsList;
            }
            SessionHelper.LoggedInUser = LoggedInUser;
        }