/// <summary>
        /// Tests a call to User Details Service
        /// </summary>
        static void TestUserDetailsService()
        {
            Console.WriteLine("TestUserDetailsService");
            System.ServiceModel.Channels.Binding binding = FaBindingFactory.GetUsernameTokenOverSslBinding();
            EndpointAddress          endpointAddress     = new EndpointAddress(new Uri("Url to the service"));
            UserDetailsServiceClient client = FaServiceFactory.GetUserDetailsServiceClient(binding, endpointAddress, new NetworkCredential(userName, password));

            UserDetailsResult result = client.findSelfUserDetails();

            if (null != result)
            {
                UserDetails[] userDetails = result.Value;
                if (null != userDetails)
                {
                    foreach (UserDetails userDetail in userDetails)
                    {
                        Console.WriteLine("  Person id = " + userDetail.PersonId);
                    }
                }
            }
            else
            {
                Console.WriteLine("  result null ");
            }
        }
 public UserDetailsResultHttpFormatted(UserDetailsResult msg, Func <string, string> makeAbsoluteUrl) :
     base(msg.Success, msg.Error)
 {
     if (msg.Data != null)
     {
         Data = new UserDataHttpFormated(msg.Data, makeAbsoluteUrl);
     }
 }
Exemplo n.º 3
0
        /// <summary>
        /// Fetch user details by the user name.
        /// </summary>
        /// <param name="userName">User name.</param>
        /// <returns>User details.</returns>
        public UserDetailsResult FetchUserInformation(string userName)
        {
            try
            {
                SqlParameter[] param = new SqlParameter[] {
                    new SqlParameter("@UserName", userName)
                };

                DataSet           ds          = BKICSQL.eds(UsersSP.FetchUserDetails, param);
                UserDetailsResult userdetails = new UserDetailsResult();
                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    userdetails.UserName       = Convert.ToString(dr["USERNAME"]);
                    userdetails.AgentBranch    = Convert.ToString(dr["AGENTBRANCH"]);
                    userdetails.Agency         = Convert.ToString(dr["AGENCY"]);
                    userdetails.AgentCode      = Convert.ToString(dr["AGENTCODE"]);
                    userdetails.UserID         = Convert.ToString(dr["USERID"]);
                    userdetails.ID             = Convert.ToInt32(dr["ID"]);
                    userdetails.IsShowPayments = Convert.ToBoolean(dr["IsShowPayment"]);
                    //userdetails.AgentLogo = (byte[])dr["Logo"];
                }
                string products = string.Empty;
                foreach (DataRow dr in ds.Tables[1].Rows)
                {
                    products += Convert.ToString(dr["InsuranceTypeID"]);
                    products += ";";
                }
                userdetails.IsTransactionDone = true;
                userdetails.Products          = products;
                return(userdetails);
            }
            catch (Exception ex)
            {
                return(new UserDetailsResult
                {
                    IsTransactionDone = false,
                    TransactionErrorMessage = ex.Message
                });
            }
        }
Exemplo n.º 4
0
 public UserDetailsResultHttpFormatted(UserDetailsResult msg, Func<string, string> makeAbsoluteUrl) :
     base(msg.Success, msg.Error)
 {
     if (msg.Data != null)
         Data = new UserDataHttpFormated(msg.Data, makeAbsoluteUrl);
 }