Beispiel #1
0
        public bool GetAgreementDocuments(int?creditDataId, string agreementId)
        {
            var request = new RestRequest($"{_apiEndpointVer}/agreements/{agreementId}/documents", Method.GET);

            request.AddHeader("Content-Type", "application/json");
            request.AddHeader("Authorization", $"Bearer {AccessToken}");
            var result = _restClient.Execute(request);
            AgreementResponse agreementResponse = JsonConvert.DeserializeObject <AgreementResponse>(result.Content);

            return(true);
        }
Beispiel #2
0
        public async Task <ActionResult> Index(PriceHedgePage currentPage, PriceHedgeFormModel formModel, string purchaseAgreementUrl)
        {
            var supplier = UserManager.GetActiveCustomer(HttpContext);

            if (SiteUser == null || supplier == null)
            {
                return(HttpNotFound());
            }

            var customer = await _agreementRepository.GetCustomerAsync(supplier.CustomerNo);

            var model = new PriceHedgeViewModel(currentPage)
            {
                Customer             = customer,
                PurchaseAgreementUrl = purchaseAgreementUrl,
                PriceHedgeForm       = formModel,
                ConfiramtionText     = GetConfirmationText(currentPage, formModel.AgreementType)
            };

            AgreementResponse result = null;

            if (formModel.AgreementType.Equals(AgreementType.SportAndForwardAvtal))
            {
                result = await SaveSpotAndForwardAgreement(formModel, customer);
            }
            else if (formModel.AgreementType.Equals(AgreementType.Depaavtal))
            {
                result = await SaveStorageAgreementAgreement(formModel, customer);
            }
            else if (formModel.AgreementType.Equals(AgreementType.Poolavtal))
            {
                result = await SavePoolAgreement(formModel, customer);
            }
            else if (formModel.AgreementType.Equals(AgreementType.PrissakringDepaavtal))
            {
                result = await SavePriceProtectedStorageAgreement(formModel, customer);
            }

            if (result?.Id != null)
            {
                return(View("~/Views/AppPages/PriceHedgePage/PriceWatchStep3.cshtml", model));
            }

            TempData["Error"] = true;
            return(View("~/Views/AppPages/PriceHedgePage/PriceWatchStep3.cshtml", model));
        }
Beispiel #3
0
        public async Task <ActionResult> SaveAgreement(PurchasingAgreementPage currentPage,
                                                       PurchasingAgreementFormModel formModel)
        {
            if (formModel == null ||
                (formModel.AgreementId == 0 && currentPage.AgreementType == AgreementType.PrissakringDepaavtal))
            {
                return(RedirectToAction("Index"));
            }

            var activeCustomer = UserManager.GetActiveCustomer(HttpContext);

            if (SiteUser == null || activeCustomer == null)
            {
                return(HttpNotFound());
            }

            AgreementResponse savedAgreement = null;

            if (currentPage.AgreementType == AgreementType.PrissakringDepaavtal)
            {
                savedAgreement = await SavePriceProtectedStorageAgreement(formModel, activeCustomer.CustomerName);
            }
            else if (currentPage.AgreementType == AgreementType.Poolavtal)
            {
                savedAgreement = await SavePoolAgreement(formModel, activeCustomer);
            }
            else if (currentPage.AgreementType == AgreementType.Depaavtal)
            {
                savedAgreement = await SaveDepaAgreement(formModel, activeCustomer);
            }
            else
            {
                savedAgreement = await SaveSpotAndForwardAgreement(formModel, activeCustomer.CustomerNo);
            }

            if (savedAgreement?.Id == null)
            {
                TempData["Saved"] = false;
            }
            else
            {
                TempData["Saved"] = true;
            }
            return(RedirectToAction("Index"));
        }
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            var view = inflater.Inflate(Resource.Layout.activity_legal_entity_registration, container, false);

            #region Объявление переменных

            s_login                = view.FindViewById <EditText>(Resource.Id.s_login_entity);
            s_password             = view.FindViewById <EditText>(Resource.Id.s_pass_entity);
            s_pass_confirmation    = view.FindViewById <EditText>(Resource.Id.s_pass_confirmation_entity);
            s_email                = view.FindViewById <EditText>(Resource.Id.s_email_entity);
            s_orgPostalAddress     = view.FindViewById <EditText>(Resource.Id.s_mailing_address_entity);
            s_clientLastName       = view.FindViewById <EditText>(Resource.Id.s_lastname_entity);
            s_clientName           = view.FindViewById <EditText>(Resource.Id.s_name_entity);
            s_clientPatronymic     = view.FindViewById <EditText>(Resource.Id.s_patronymic_entity);
            s_orgPhone             = view.FindViewById <EditText>(Resource.Id.s_phone_individual);
            s_orgName              = view.FindViewById <EditText>(Resource.Id.s_nomination_entity);
            s_orgKpp               = view.FindViewById <EditText>(Resource.Id.s_KPP_entity);
            s_orgInn               = view.FindViewById <EditText>(Resource.Id.s_INN_entity);
            s_orgOgrn              = view.FindViewById <EditText>(Resource.Id.s_OGRN_entity);
            s_orgBank              = view.FindViewById <EditText>(Resource.Id.s_bank_entity);
            s_orgBankpayment       = view.FindViewById <EditText>(Resource.Id.s_payment_account_entity);
            s_orgBankCorrespondent = view.FindViewById <EditText>(Resource.Id.s_correspondent_account_entity);
            s_orgBankBik           = view.FindViewById <EditText>(Resource.Id.s_BIK_entity);
            s_orgLegalAddress      = view.FindViewById <EditText>(Resource.Id.s_legal_address_entity);
            btn_make_request       = view.FindViewById <Button>(Resource.Id.btn_make_request);
            check_personal_data_processing_entity = view.FindViewById <CheckBox>(Resource.Id.check_personal_data_processing_entity);
            check_contract_oferta_entity          = view.FindViewById <CheckBox>(Resource.Id.check_contract_oferta_entity);
            preloader = view.FindViewById <ProgressBar>(Resource.Id.preloader);
            s_orgPhone.SetMaxLines(11);
            s_orgInn.SetMaxLines(9);
            s_orgKpp.SetMaxLines(9);
            s_orgOgrn.SetMaxLines(15);
            s_orgBank.SetMaxLines(15);
            s_orgBankpayment.SetMaxLines(20);
            s_orgBankCorrespondent.SetMaxLines(20);
            s_orgBankBik.SetMaxLines(9);

            #endregion

            check_personal_data_processing_entity.Click += async delegate
            {
                if (check_personal_data_processing_entity.Checked == true)
                {
                    using (var client = ClientHelper.GetClient())
                    {
                        WebService.Home.HomeService.InitializeClient(client);
                        var o_data = await WebService.Home.HomeService.Privacy();


                        if (o_data.Status == HttpStatusCode.OK)
                        {
                            AgreementResponse o_user_data = new AgreementResponse();
                            o_user_data = o_data.ResponseData;

                            Android.App.FragmentTransaction transaction1 = this.FragmentManager.BeginTransaction();
                            AlertDialog.Builder             alert        = new AlertDialog.Builder(Activity);
                            alert.SetTitle("Согласие на обработку персональных данных");
                            alert.SetMessage(o_user_data.Agreement);

                            alert.SetPositiveButton("Принимаю", (senderAlert, args) =>
                            {
                            });
                            alert.SetNegativeButton("Не принимаю", (senderAlert, args) =>
                            {
                                check_personal_data_processing_entity.Checked = false;
                            });
                            Dialog dialog = alert.Create();
                            dialog.Show();
                        }
                        else
                        {
                            Toast.MakeText(Activity, o_data.Message, ToastLength.Long).Show();
                        }
                    };
                }
            };

            check_contract_oferta_entity.Click += async delegate
            {
                if (check_contract_oferta_entity.Checked == true)
                {
                    using (var client = ClientHelper.GetClient())
                    {
                        WebService.Home.HomeService.InitializeClient(client);
                        var o_data = await WebService.Home.HomeService.Offer();

                        if (o_data.Status == HttpStatusCode.OK)
                        {
                            AgreementResponse o_user_data = new AgreementResponse();
                            o_user_data = o_data.ResponseData;

                            Android.App.FragmentTransaction transaction1 = this.FragmentManager.BeginTransaction();
                            AlertDialog.Builder             alert        = new AlertDialog.Builder(Activity);
                            alert.SetTitle("Согласие с договором офертой");
                            alert.SetMessage(o_user_data.Agreement);

                            alert.SetPositiveButton("Принимаю", (senderAlert, args) =>
                            {
                            });
                            alert.SetNegativeButton("Не принимаю", (senderAlert, args) =>
                            {
                                check_contract_oferta_entity.Checked = false;
                            });
                            Dialog dialog = alert.Create();
                            dialog.Show();
                        }
                        else
                        {
                            Toast.MakeText(Activity, o_data.Message, ToastLength.Long).Show();
                        }
                    };
                }
            };


            btn_make_request.Click += async delegate
            {
                if (CheckingOnNullOrEmptyOfStrings())
                {
                    Toast.MakeText(Activity, "Пожалуйста, заполните все поля. ", ToastLength.Long).Show();
                }
                else
                {
                    if (s_password.Text == s_pass_confirmation.Text)
                    {
                        if (check_contract_oferta_entity.Checked == true && check_personal_data_processing_entity.Checked == true)
                        {
                            try
                            {
                                RegisterLegalModel register = new RegisterLegalModel
                                {
                                    Login                = s_login.Text,
                                    Password             = s_password.Text,
                                    Email                = s_email.Text,
                                    OrgPhone             = s_orgPhone.Text,
                                    ClientType           = "organization",
                                    ClientLastName       = s_clientLastName.Text,
                                    ClientName           = s_clientName.Text,
                                    ClientPatronymic     = s_clientPatronymic.Text,
                                    OrgPostalAddress     = s_orgPostalAddress.Text,
                                    OrgName              = s_orgName.Text,
                                    OrgKpp               = s_orgKpp.Text,
                                    OrgInn               = s_orgInn.Text,
                                    OrgOgrn              = s_orgOgrn.Text,
                                    OrgBank              = s_orgBank.Text,
                                    OrgBankpayment       = s_orgBankpayment.Text,
                                    OrgBankCorrespondent = s_orgBankCorrespondent.Text,
                                    OrgBankBik           = s_orgBankBik.Text,
                                    OrgLegalAddress      = s_orgLegalAddress.Text
                                };

                                using (var client = ClientHelper.GetClient())
                                {
                                    AuthService.InitializeClient(client);
                                    var o_data = await AuthService.RegisterLegal(register);

                                    if (o_data.Status == HttpStatusCode.OK)
                                    {
                                        Toast.MakeText(Activity, o_data.Message, ToastLength.Long).Show();
                                        RegisterResponse o_user_data = new RegisterResponse();
                                        o_user_data = o_data.ResponseData;

                                        preloader.Visibility = Android.Views.ViewStates.Invisible;

                                        //CrossSettings.Current.GetValueOrDefault("PresenceOnPage", "true");
                                        CrossSettings.Current.AddOrUpdateValue("role", "client");

                                        CrossSettings.Current.AddOrUpdateValue("login", s_login.Text);
                                        CrossSettings.Current.AddOrUpdateValue("password", s_password.Text);
                                        CrossSettings.Current.AddOrUpdateValue("token", o_user_data.user.token);
                                        CrossSettings.Current.AddOrUpdateValue("check", "0");
                                        StaticUser.NeedToCreateOrder = true;
                                        StaticUser.PresenceOnPage    = true;

                                        Android.App.FragmentTransaction transaction1 = this.FragmentManager.BeginTransaction();
                                        Intent main = new Intent(Activity, typeof(MainActivity));
                                        StartActivity(main);
                                    }

                                    else
                                    {
                                        Toast.MakeText(Activity, o_data.Message, ToastLength.Long).Show();
                                    }
                                };
                            }
                            catch (Exception ex)
                            {
                                Toast.MakeText(Activity, ex.Message, ToastLength.Long).Show();
                            }
                        }
                        else
                        {
                            Toast.MakeText(Activity, "Необходимо дать согласие на обработку " +
                                           "персональных данных и согласиться с договором офертой", ToastLength.Long).Show();
                        }
                    }
                    else
                    {
                        Toast.MakeText(Activity, "Пароли не совпадают ", ToastLength.Long).Show();
                    }
                }
            };

            return(view);
        }
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            try
            {
                var view = inflater.Inflate(Resource.Layout.activity_application_processing, container, false);

                List <Place.Field> fields = new List <Place.Field>();

                fields.Add(Place.Field.Id);
                fields.Add(Place.Field.Name);
                fields.Add(Place.Field.LatLng);
                fields.Add(Place.Field.Address);

                #region Инициализаия переменных

                SizeInputLayout      = view.FindViewById <TextInputLayout>(Resource.Id.SizeInputLayout);
                LInputCargoInsurance = view.FindViewById <TextInputLayout>(Resource.Id.ApplicationInputLayoutCargoInsurance);
                LInputTime           = view.FindViewById <TextInputLayout>(Resource.Id.ApplicationInputLayoutTime);
                LInputDate           = view.FindViewById <TextInputLayout>(Resource.Id.ApplicationInputLayoutDate);
                LInputContactPerson  = view.FindViewById <TextInputLayout>(Resource.Id.ApplicationInputLayoutContactPerson);

                btn_make_request = view.FindViewById <Button>(Resource.Id.btn_make_request);

                s_edit_from      = view.FindViewById <EditText>(Resource.Id.s_edit_from);
                s_edit_where     = view.FindViewById <EditText>(Resource.Id.s_edit_where);
                s_shipment_time  = view.FindViewById <EditText>(Resource.Id.s_shipment_time);
                s_shipping_date  = view.FindViewById <EditText>(Resource.Id.s_shipping_date);
                s_length         = view.FindViewById <EditText>(Resource.Id.s_length);
                s_width          = view.FindViewById <EditText>(Resource.Id.s_width);
                s_weight         = view.FindViewById <EditText>(Resource.Id.s_weight);
                s_height         = view.FindViewById <EditText>(Resource.Id.s_height);
                s_size           = view.FindViewById <EditText>(Resource.Id.s_size);
                s_sum_seats      = view.FindViewById <EditText>(Resource.Id.s_sum_seats);
                s_contact_person = view.FindViewById <EditText>(Resource.Id.s_contact_person);
                s_value          = view.FindViewById <EditText>(Resource.Id.s_value);

                s_cargo_characteristic = view.FindViewById <Spinner>(Resource.Id.s_cargo_characteristic);
                s_hazard_class         = view.FindViewById <Spinner>(Resource.Id.s_hazard_class);
                s_loading_methods      = view.FindViewById <Spinner>(Resource.Id.s_loading_methods);

                check_argue = view.FindViewById <CheckBox>(Resource.Id.check_argue);

                SwitchDateTime       = view.FindViewById <SwitchCompat>(Resource.Id.ApplicationSwitchDateTime);
                SwitchCargoInsurance = view.FindViewById <SwitchCompat>(Resource.Id.ApplicationSwitchCargoInsurance);
                SwitchContactPerson  = view.FindViewById <SwitchCompat>(Resource.Id.ApplicationSwitchContactPerson);
                preloader            = view.FindViewById <ProgressBar>(Resource.Id.preloader);

                s_length.SetMaxLines(8);
                s_width.SetMaxLines(8);
                s_height.SetMaxLines(8);
                s_size.Text = "1";

                #region Focusable Enabled Clickable

                SwitchDateTime.Focusable       = true;
                SwitchCargoInsurance.Focusable = true;
                SwitchContactPerson.Focusable  = true;

                //s_size.Focusable = false;
                //s_size.Enabled = false;
                s_size.Visibility = ViewStates.Visible;
                s_size.Enabled    = false;

                s_shipment_time.Focusable = false;
                s_shipment_time.Enabled   = false;

                s_shipping_date.Focusable = false;
                s_shipping_date.Enabled   = false;

                //s_value.Focusable = false;
                //s_value.LongClickable = true;
                s_value.Visibility          = ViewStates.Invisible;
                s_contact_person.Visibility = ViewStates.Invisible;
                //s_contact_person.Focusable = false;
                //s_contact_person.LongClickable = false;

                s_edit_from.Focusable  = false;
                s_edit_where.Focusable = false;
                #endregion
                #endregion


                if (Arguments != null)
                {
                    string mParam = Arguments.GetString("isDestination");
                    if (mParam == "true")
                    {
                        s_edit_where.Text = StaticOrder.Destination_address;
                    }
                    else
                    {
                        s_edit_from.Text = StaticOrder.Inception_address;
                    }
                }

                s_cargo_characteristic.ItemSelected += new EventHandler <AdapterView.ItemSelectedEventArgs>(Spinner_ItemSelected);
                //var adapter1 = new ArrayAdapter<String>(Activity, Resource.Array.array_cargo_characteristic, Android.Resource.Layout.SimpleSpinnerItem);
                var adapter1 = ArrayAdapter.CreateFromResource(Activity, Resource.Array.array_cargo_characteristic, Android.Resource.Layout.SimpleSpinnerItem);
                adapter1.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem);
                s_cargo_characteristic.Adapter = adapter1;

                s_hazard_class.ItemSelected += new EventHandler <AdapterView.ItemSelectedEventArgs>(SpinnerClass_ItemSelected);
                var adapter2 = ArrayAdapter.CreateFromResource(Activity, Resource.Array.array_hazard_class, Android.Resource.Layout.SimpleSpinnerItem);
                adapter2.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem);
                s_hazard_class.Adapter = adapter2;

                s_loading_methods.ItemSelected += new EventHandler <AdapterView.ItemSelectedEventArgs>(SpinnerLoad_ItemSelected);
                var adapter3 = ArrayAdapter.CreateFromResource(Activity, Resource.Array.array_loading_methodsc, Android.Resource.Layout.SimpleSpinnerItem);
                adapter3.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem);
                s_loading_methods.Adapter = adapter3;

                FragmentTransaction transaction2 = this.FragmentManager.BeginTransaction();

                #region Обработка нажатий на кнопки
                //s_size.Click += async delegate
                //{
                //    if (string.IsNullOrEmpty(s_length.Text) == false &&
                //    string.IsNullOrEmpty(s_width.Text) == false &&
                //    string.IsNullOrEmpty(s_height.Text) == false &&
                //    string.IsNullOrEmpty(s_sum_seats.Text) == false)
                //    {
                //        CultureInfo ci = (CultureInfo)CultureInfo.CurrentCulture.Clone();
                //        ci.NumberFormat.CurrencyDecimalSeparator = ".";
                //        float size_calculation = float.Parse(s_length.Text, NumberStyles.Any, ci)
                //            * float.Parse(s_width.Text, NumberStyles.Any, ci)
                //            * float.Parse(s_height.Text, NumberStyles.Any, ci)
                //            * float.Parse(s_sum_seats.Text, NumberStyles.Any, ci);
                //        s_size.Text = size_calculation.ToString();
                //    }
                //    else
                //    {
                //        AlertDialog.Builder alert = new AlertDialog.Builder(Activity);
                //        alert.SetTitle("Внимание!");
                //        alert.SetMessage("Необходимо заполнить данные о длине, ширине и высоте груза !");
                //        alert.SetPositiveButton("Закрыть", (senderAlert, args) =>
                //        {
                //        });
                //        Dialog dialog = alert.Create();
                //        dialog.Show();
                //    }

                //};

                SwitchDateTime.Click       += SwitchDateTimeClick;
                SwitchCargoInsurance.Click += SwitchCargoInsuranceClick;
                SwitchContactPerson.Click  += SwitchContactPersonClick;

                s_width.TextChanged     += ValueSizeCalculation;
                s_height.TextChanged    += ValueSizeCalculation;
                s_length.TextChanged    += ValueSizeCalculation;
                s_sum_seats.TextChanged += ValueSizeCalculation;
                s_weight.TextChanged    += OnWieghtChanged;
                s_shipping_date.Click   += S_shipping_date_Click;

                //s_shipping_date.TextChanged += delegate
                //{
                //    DateTime NowDate = new DateTime();
                //    string[] NumberMonthYear = s_shipping_date.Text.Split('.');
                //    int year = Convert.ToInt32(NumberMonthYear[2]);
                //    int month = Convert.ToInt32(NumberMonthYear[1]);
                //    int number = Convert.ToInt32(NumberMonthYear[0]);
                //    DateTime ValueEntered = new DateTime(year, month, number);
                //    if (NowDate.CompareTo(ValueEntered) > 0)
                //    {
                //        Toast.MakeText(Activity, "Указанная дата позже текущей.", ToastLength.Long).Show();
                //        s_shipping_date.Text = NowDate.ToShortDateString();
                //    }
                //};

                s_shipment_time.Click += delegate
                {
                    LayoutInflater      layoutInflater = LayoutInflater.From(Activity);
                    View                view           = layoutInflater.Inflate(Resource.Layout.modal_user_time, null);
                    AlertDialog.Builder alert          = new AlertDialog.Builder(Activity);
                    alert.SetView(view);

                    #region Объявление переменных в диалоговом окне
                    var rb_first  = view.FindViewById <RadioButton>(Resource.Id.rb_first);
                    var rb_second = view.FindViewById <RadioButton>(Resource.Id.rb_second);
                    var rb_third  = view.FindViewById <RadioButton>(Resource.Id.rb_third);
                    var rb_vierth = view.FindViewById <RadioButton>(Resource.Id.rb_vierth);
                    var rb_fifth  = view.FindViewById <RadioButton>(Resource.Id.rb_fifth);
                    var rb_sixth  = view.FindViewById <RadioButton>(Resource.Id.rb_sixth);
                    #endregion

                    #region Обработка событий кнопок

                    rb_first.Click += delegate
                    {
                        s_shipment_time.Text = rb_first.Text;
                    };

                    rb_second.Click += delegate
                    {
                        s_shipment_time.Text = rb_second.Text;
                    };

                    rb_third.Click += delegate
                    {
                        s_shipment_time.Text = rb_third.Text;
                    };

                    rb_vierth.Click += delegate
                    {
                        s_shipment_time.Text = rb_vierth.Text;
                    };

                    rb_fifth.Click += delegate
                    {
                        s_shipment_time.Text = rb_fifth.Text;
                    };

                    rb_sixth.Click += delegate
                    {
                        s_shipment_time.Text = rb_sixth.Text;
                    };

                    #endregion

                    alert.SetCancelable(false)
                    .SetPositiveButton("Выбрать", delegate
                    {
                    })
                    .SetNegativeButton("Отмена", delegate
                    {
                        alert.Dispose();
                    });
                    Dialog dialog = alert.Create();
                    dialog.Show();
                };

                check_argue.Click += async delegate
                {
                    if (check_argue.Checked == true)
                    {
                        using (var client = ClientHelper.GetClient())
                        {
                            WebService.Home.HomeService.InitializeClient(client);
                            var o_data = await WebService.Home.HomeService.Offer();

                            if (o_data.Status == HttpStatusCode.OK)
                            {
                                AgreementResponse o_user_data = new AgreementResponse();
                                o_user_data = o_data.ResponseData;

                                Android.App.FragmentTransaction transaction1 = this.FragmentManager.BeginTransaction();
                                AlertDialog.Builder             alert        = new AlertDialog.Builder(Activity);
                                alert.SetTitle("Согласие с договором офертой");
                                alert.SetMessage(o_user_data.Agreement);
                                check_argue.Checked = false;
                                alert.SetPositiveButton("Принимаю", (senderAlert, args) =>
                                {
                                    check_argue.Checked = true;
                                });
                                alert.SetNegativeButton("Не принимаю", (senderAlert, args) =>
                                {
                                    check_argue.Checked = false;
                                });
                                Dialog dialog = alert.Create();
                                dialog.Show();
                            }
                            else
                            {
                                Toast.MakeText(Activity, o_data.Message, ToastLength.Long).Show();
                            }
                        };
                    }
                };

                s_edit_from.Click += async delegate
                {
                    //GooglePlacesResult fragment = new GooglePlacesResult();
                    //Bundle args = new Bundle();
                    //args.PutString("isDestination", "false");
                    //fragment.Arguments = args;

                    //transaction2.Replace(Resource.Id.framelayout, fragment).AddToBackStack(null).Commit();

                    Intent intent = new Autocomplete.IntentBuilder(AutocompleteActivityMode.Overlay, fields)
                                    .SetCountry("RUS")
                                    .Build(Activity);

                    myCity = "false";

                    StartActivityForResult(intent, 0);
                };

                s_edit_where.Click += async delegate
                {
                    Intent intent = new Autocomplete.IntentBuilder(AutocompleteActivityMode.Overlay, fields)
                                    .SetCountry("RUS")
                                    .Build(Activity);
                    myCity = "true";
                    StartActivityForResult(intent, 0);
                    //GooglePlacesResult fragment = new GooglePlacesResult();
                    //Bundle args = new Bundle();
                    //args.PutString("isDestination", "true");
                    //fragment.Arguments = args;
                    //transaction2.Replace(Resource.Id.framelayout, fragment).AddToBackStack(null).Commit();
                };

                btn_make_request.Click += async delegate
                {
                    try
                    {
                        string InputErrorMessage = "";
                        if (ValidationValues(ref InputErrorMessage))
                        {
                            AlertDialogCall(InputErrorMessage);
                        }
                        else
                        {
                            preloader.Visibility = Android.Views.ViewStates.Visible;
                            MakeOrderModel model = new MakeOrderModel()
                            {
                                destination_address = s_edit_where.Text,
                                for_date            = s_shipping_date.Text,
                                for_time            = s_shipment_time.Text,
                                height            = s_height.Text,
                                inception_address = s_edit_from.Text,
                                cargo_class       = a_hazard_class,
                                cargo_loading     = a_loading_methodsc,
                                cargo_type        = a_cargo_characteristic,
                                destination_lat   = StaticOrder.Destination_lat, /*"47.232032",*/
                                destination_lng   = StaticOrder.Destination_lng, /*"39.731523",*/
                                inception_lat     = StaticOrder.Inception_lat,   /*"47.243221",*/
                                inception_lng     = StaticOrder.Inception_lng,   /*"39.668781",*/
                                insurance         = s_value.Text,
                                receiver          = s_contact_person.Text,
                                length            = s_length.Text,
                                qty    = s_sum_seats.Text,
                                weight = s_weight.Text,
                                width  = s_width.Text,
                                volume = s_size.Text
                            };

                            using (var client = ClientHelper.GetClient())
                            {
                                OrderService.InitializeClient(client);
                                var o_data = await OrderService.GetOrderPrice(model);

                                if (o_data.Status == HttpStatusCode.OK)
                                {
                                    //o_data.Message = "Успешно авторизован!";
                                    Toast.MakeText(Activity, o_data.Message, ToastLength.Long).Show();

                                    AmountResponse order_data = new AmountResponse();
                                    order_data = o_data.ResponseData;
                                    if (IsFieldsEmptyOrNull(o_data.ResponseData))
                                    {
                                        string ErrorMessage = "Не удалось оформить заказ. Скорее всего " +
                                                              "Вы ввели неверные пункт отправления и/или пункт назначения ";
                                        AlertDialogCall(ErrorMessage);
                                        preloader.Visibility = Android.Views.ViewStates.Invisible;
                                    }
                                    else
                                    {
                                        StaticOrder.AddInfoOrder(model);
                                        StaticOrder.AddInfoAmount(order_data);

                                        preloader.Visibility = Android.Views.ViewStates.Invisible;

                                        StaticUser.OrderInStageOfBid = true;

                                        try
                                        {
                                            Android.App.FragmentTransaction transaction1 = this.FragmentManager.BeginTransaction();
                                            ActivityOrderPreis content = new ActivityOrderPreis();
                                            transaction1.Replace(Resource.Id.framelayout, content);
                                            transaction1.Commit();
                                        }
                                        catch (Exception ex)
                                        {
                                            Toast.MakeText(Activity, ex.Message, ToastLength.Long);
                                        }
                                    }
                                }
                                else
                                {
                                    Toast.MakeText(Activity, o_data.Message, ToastLength.Long).Show();
                                }
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        Toast.MakeText(Activity, ex.Message, ToastLength.Long).Show();
                    }
                };

                #endregion

                return(view);
            }
            catch (Exception ex)
            {
                var view = inflater.Inflate(Resource.Layout.activity_errors_handling, container, false);
                Toast.MakeText(Activity, ex.Message, ToastLength.Long).Show();
                return(view);
            }
        }