コード例 #1
0
ファイル: frmLogin3.cs プロジェクト: LOBOSMARSA122/SLLaboral
        private void AuthenticateUser()
        {
            // Autenticación de usuario
            SecurityBL objSecurityBL = new SecurityBL();

            OperationResult objOperationResult = new OperationResult();
            var             objUserDto         = objSecurityBL.ValidateSystemUser(ref objOperationResult, _intNodeId, txtUserName.Text, Common.Utils.Encrypt(txtPassword.Text));

            if (objUserDto != null)
            {
                ClientSession objClientSession = new ClientSession();
                objClientSession.i_SystemUserId             = objUserDto.i_SystemUserId;
                objClientSession.v_UserName                 = objUserDto.v_UserName;
                objClientSession.i_CurrentExecutionNodeId   = _intNodeId;
                objClientSession.v_CurrentExecutionNodeName = txtNode.Text;
                //_ClientSession.i_CurrentOrganizationId = 57;
                objClientSession.v_PersonId = objUserDto.v_PersonId;

                // Pasar el objeto de sesión al gestor de objetos globales
                Globals.ClientSession = objClientSession;

                // Abrir el formulario principal
                this.Hide();
                frmMaster frm = new frmMaster();
                frm.ShowDialog();
                this.Close();
            }
            else
            {
                MessageBox.Show(objOperationResult.AdditionalInformation, "Advertencia-->>>>>>>>>>>>>>>", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }


            // Autenticar el usuario
        }
コード例 #2
0
        private void AuthenticateUser()
        {
            // Autenticación de usuario
            SecurityBL objSecurityBL = new SecurityBL();

            OperationResult objOperationResult = new OperationResult();
            var             objUserDto         = objSecurityBL.ValidateSystemUser(ref objOperationResult, _intNodeId, txtUserName.Text, Common.Utils.Encrypt(txtPassword.Text));

            if (objUserDto != null)
            {
                ClientSession objClientSession = new ClientSession();
                objClientSession.i_SystemUserId             = objUserDto.i_SystemUserId;
                objClientSession.v_UserName                 = objUserDto.v_UserName;
                objClientSession.i_CurrentExecutionNodeId   = _intNodeId;
                objClientSession.v_CurrentExecutionNodeName = txtNode.Text;
                //_ClientSession.i_CurrentOrganizationId = 57;
                objClientSession.v_PersonId         = objUserDto.v_PersonId;
                objClientSession.i_RolVentaId       = objUserDto.i_RolVentaId;
                objClientSession.i_SystemUserCopyId = objUserDto.i_SystemUserId;
                objClientSession.i_ProfesionId      = objUserDto.i_ProfesionId;

                var dataOrganization = new ServiceBL().GetInfoMedicalCenter();

                objClientSession.b_LogoOwner         = dataOrganization.b_Image;
                objClientSession.v_TelephoneOwner    = dataOrganization.v_PhoneNumber;
                objClientSession.v_RucOwner          = dataOrganization.v_IdentificationNumber;
                objClientSession.v_AddressOwner      = dataOrganization.v_Address;
                objClientSession.v_OrganizationOwner = dataOrganization.v_Name;
                objClientSession.v_SectorName        = dataOrganization.v_SectorName;

                // Pasar el objeto de sesión al gestor de objetos globales
                Globals.ClientSession = objClientSession;

                // Abrir el formulario principal
                this.Hide();
                frmMaster frm = new frmMaster();
                frm.ShowDialog();
                this.Close();
            }
            else
            {
                MessageBox.Show(objOperationResult.AdditionalInformation, "Advertencia-->>>>>>>>>>>>>>>", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }


            // Autenticar el usuario
        }