Beispiel #1
0
        /// <summary>
        /// Purpose: 获取用户Authorization信息
        //                              <Authorization>
        //                                    <Action>ReturnAuthorizationList</Action>
        //                                    <User>EM01</User>
        //                                    <Application url='http://hrms' name='HRMS'>
        //                                        <Roles>
        //                                            <Role>F01</Role>
        //                                            <Role>F05</Role>
        //                                            <Role>F03</Role>
        //                                            <Role>F04</Role>
        //                                        </Roles>
        //                                        <Modules>
        //                                            <Module name='BasicInfo'>
        //                                                <Functions>
        //                                                    <Function id='F0101' name='' url=''>Allowed</Function>
        //                                                    <Function id='F0102' name='' url=''>Allowed</Function>
        //                                                </Functions>
        //                                            </Module>
        //                                            <Module name='Interface'>
        //                                                <Functions>
        //                                                    <Function id='F0201' name='' url=''>Allowed</Function>
        //                                                    <Function id='F04' name='' url=''>Denied</Function>
        //                                                    <Function id='F05' name='' url=''>Allowed</Function>
        //                                                </Functions>
        //                                            </Module>
        //                                        </Modules>
        //                                    </Application>
        //                                </Authorization>";
        /// </summary>
        /// <param name="_userId"></param>
        /// <param name="_application"></param>
        /// <returns></returns>
        public AuthorizationMdl GetAuthorization(string _userId, string _application)
        {
            try
            {
                GotWell.HRMS.HRMSBusiness.AuthorizationService.AuthorizationServiceClient client = new GotWell.HRMS.HRMSBusiness.AuthorizationService.AuthorizationServiceClient();
                //AuthorizationService service = new AuthorizationService();
                string _ResultXmlText = client.GetAuthorizationXml(CreateParamter_GetAuthorization(_userId, _application));

                return(ParseAuthorizationXml(_ResultXmlText));
            }catch (UtilException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw new UtilException(ex.Message, ex);
            }
        }
Beispiel #2
0
        //<Authorization>
        //     <Action>ReturnUserValidation</Action>
        //     <UserId></UserId>
        //      <Application></Application>
        //      <Message></Message>
        //</Authorization>";
        public Hashtable GetUserValidation(string _userId, string _passwd, string _application)
        {
            try
            {
                GotWell.HRMS.HRMSBusiness.AuthorizationService.AuthorizationServiceClient client = new GotWell.HRMS.HRMSBusiness.AuthorizationService.AuthorizationServiceClient();
                string _ResultXmlText = client.GetUserValidationXML(CreateParamter_GetUserValidation(_userId, _passwd, _application));

                //Parse
                XmlDocument doc    = new XmlDocument();
                Hashtable   result = new Hashtable();

                doc.LoadXml(_ResultXmlText);
                result["Action"]      = doc.SelectSingleNode("/Authorization/Action").InnerText.ToString();
                result["UserId"]      = doc.SelectSingleNode("/Authorization/UserId").InnerText.ToString();
                result["Application"] = doc.SelectSingleNode("/Authorization/Application").InnerText.ToString();
                result["Message"]     = doc.SelectSingleNode("/Authorization/Message").InnerText.ToString();

                return(result);
            }
            catch (UtilException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw new UtilException(ex.Message, ex);
            }
        }