Пример #1
0
        /// <summary>
        /// Check whether user exist in db with username
        /// Note: Currently this function is not using to check one
        /// </summary>
        /// <param name="userName"></param>
        /// <returns></returns>
        public static WSInteger IsUserExist(string userName)
        {
            WSInteger IsExist = new WSInteger();
            IsExist.IntegerValue = 0;

            try
            {
                using (PMUServiceClient client = new PMUServiceClient("WSHttpBinding_IPMUService"))
                {
                    PMUServiceResult result = new PMUServiceResult();
                    result = client.IsUserNameExist(userName);
                    IsExist = (WSInteger)result.Data;
                    if (result.Data == null && result.ErrorMessage.Length > 0)
                    {
                        IsExist.IntegerValue = 0;
                    }
                }
            }
            catch (FaultException<PMUServiceResult> Fex)
            {
                ErrorLogging.LogError(Fex.Detail.ErrorMessage, Fex.Detail.ErrorDetails, CommonFunction.GetCurrentRequestUrl());
            }
            return IsExist;
        }
Пример #2
0
        public static User InsertSignUpData(string userName, string emailAdd, string password)
        {
            string userId = string.Empty;
            string encryptedPassword  = string.Empty;

            User userInfo = new User();

            try
            {
                //Encrypt the password
                encryptedPassword = CommonFunction.Encrypt(password);

                userInfo.UserName = userName;
                userInfo.Email = emailAdd;
                userInfo.Password = encryptedPassword;

                using (PMUServiceClient client = new PMUServiceClient("WSHttpBinding_IPMUService"))
                {
                    PMUServiceResult result = new PMUServiceResult();
                    result = client.InsertUserSignUpDetails(userInfo);

                    if (result.Data == null && result.ErrorMessage.Length > 0)
                    {
                        userInfo.UserId = 0;
                    }
                }
            }
            catch (FaultException<PMUServiceResult> Fex)
            {
                ErrorLogging.LogError(Fex.Detail.ErrorMessage, Fex.Detail.ErrorDetails, "www.google.com");
                userInfo.UserId = 0;
                return userInfo;
            }

            return userInfo;
        }