Ejemplo n.º 1
0
        internal static MBProxi.PBCustomerInfo AuthWithoutWindow(long id)
        {
            MBProxi.PBCustomerInfo result = null;

            try
            {
                if (id > 0)
                {
                    using (CardServiceClient client = GetWCFClient())
                    {
                        if (client != null && client.Online())
                        {
                            var response = client.PBCustomerAuth(id);

                            if (response != null && response.Result != null)
                            {
                                if (response.Result.Auth)
                                {
                                    result = response.Result;
                                }
                            }
                        }
                    }
                }
            }
            catch { }

            return(result);
        }
Ejemplo n.º 2
0
 void digitKeyboardCancelClc(object sender, double Value)
 {
     if (ProcUser != null)
     {
         ProcUser = null;
     }
     Out();
 }
Ejemplo n.º 3
0
        void digitKeyboardOkClc(object sender, double Value)
        {
            if (digitKeyboard.CurentDouble > 0)
            {
                long validationCode = (long)digitKeyboard.CurentDouble;

                if (_lastId != validationCode)
                {
                    try
                    {
                        _lastId = validationCode;

                        using (CardServiceClient client = GetWCFClient())
                        {
                            if (client != null && client.Online())
                            {
                                var response = client.PBCustomerAuth(validationCode);

                                if (response != null && response.Result != null)
                                {
                                    if (response.Result.Auth)
                                    {
                                        ProcUser = response.Result;
                                        Out();
                                    }
                                    else
                                    {
                                        this.footerText.Foreground = Brushes.Black;
                                        this.footerText.Text       = "  Гость не найден";
                                    }
                                }
                                else
                                {
                                    this.footerText.Foreground = Brushes.Red;
                                    this.footerText.Text       = "  Ошибка ответа сервиса";
                                }
                            }
                            else
                            {
                                this.footerText.Foreground = Brushes.Red;
                                this.footerText.Text       = "  CardService offline";
                            }
                        }
                    }
                    catch { }
                }
            }
        }
        private void Fill(MBProxi.PBCustomerInfo customer)
        {
            FullName    = customer.FullName ?? "не указано";
            BlockedFlag = customer.BlockedFlag;
            PhoneStr    = customer.PhoneStr ?? "не указано";

            /// <summary>
            /// "yyyy-MM-dd"
            /// </summary>

            if (string.IsNullOrWhiteSpace(customer.BirthDate))
            {
                BirthDateStr = "не указано";
            }
            else
            {
                BirthDateStr = DateTime.TryParseExact(customer.BirthDate, "yyyy-MM-dd", System.Globalization.CultureInfo.InvariantCulture, System.Globalization.DateTimeStyles.None, out DateTime bDate) ? bDate.ToString("dd/MM/yyyy") : "не указано";
            }

            Gender = string.IsNullOrWhiteSpace(customer.Gender)? "не указано":GetGender(customer.Gender);

            /// <summary>
            /// НЕ УНИКАЛЕН!!!
            /// </summary>
            Email = customer.Email ?? "не указано";

            /// <summary>
            /// UUID
            /// </summary>
            GroupId   = customer.GroupId ?? string.Empty;
            GroupName = customer.GroupName ?? string.Empty;

            Balance            = customer.Balance;
            BalanceAccumulated = customer.BalanceAccumulated;
            BalancePresent     = customer.BalancePresent;
            BalanceAction      = customer.BalanceAction;
            LastCardNumStr     = GetFriendlyCardNum(customer.LastCardNumber);
        }
 public PBUserInfoViewModel(MBProxi.PBCustomerInfo customer)
 {
     Fill(customer);
 }