Ejemplo n.º 1
0
        /// <summary>
        ///  Call to business logic for check any username exist 
        /// </summary>
        /// <param name="userName"></param>
        /// <returns></returns>
        public PMUServiceResult IsUserNameExist(string userName)
        {
            PMUServiceResult PMUServiceResultObject = new PMUServiceResult();
            WSInteger IsExist = new WSInteger();

            try
            {
                // Call to business logic layer to check user exist or not
                IsExist.IntegerValue = 1;// PMULoginManager.IsUserAllreadyExist(userName);
                PMUServiceResultObject.Data = (WSInteger)IsExist;
                return PMUServiceResultObject;
            }
            catch (Exception ex)
            {
                PMUServiceResultObject.ErrorDetails = ex.ToString();
                PMUServiceResultObject.ErrorMessage = "Some error, Unable to search username";
                PMUServiceResultObject.Data = null;

                throw new FaultException<PMUServiceResult>(PMUServiceResultObject, ex.ToString());
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Call business logic layer to check whether user exist with given
        /// username and password
        /// </summary>
        /// <param name="userName"></param>
        /// <param name="password"></param>
        /// <returns></returns>
        public PMUServiceResult IsUserAuthorized(string userName, string password)
        {
            PMUServiceResult PMUServiceResultObject = new PMUServiceResult();
            WSInteger IsAuthorized = new WSInteger();

            try
            {
                // Call to business logic layer to check user exist or not
                IsAuthorized.IntegerValue = PMULoginManager.IsUserAuthorized(userName, password);
                PMUServiceResultObject.Data = (WSInteger)IsAuthorized;
                return PMUServiceResultObject;
            }
            catch(Exception ex)
            {
                PMUServiceResultObject.ErrorDetails = ex.ToString();
                PMUServiceResultObject.ErrorMessage = "Some error, Unable to search user with given username and paswword";
                PMUServiceResultObject.Data = null;

                throw new FaultException<PMUServiceResult>(PMUServiceResultObject, ex.ToString());
            }
        }