示例#1
0
 async void OnHelpButtonClicked(object sender, EventArgs args)
 {
     await PopupNavigation.PushAsync(new HelpPopup());
 }
 public void OnListItemSelected(object sender, SelectedItemChangedEventArgs e)
 {
     PopupNavigation.RemovePageAsync(this);
     mSetCharacterCallback.Invoke(e.SelectedItem as Character);
 }
示例#3
0
 async void Loadingalertcall()
 {
     await PopupNavigation.PopAllAsync();
 }
示例#4
0
 private async void AplyGestureRecognizer_Tapped(object sender, EventArgs e)
 {
     await PopupNavigation.PopAsync();
 }
示例#5
0
 private async void discardClickedAsync(object sender, EventArgs ea)
 {
     await PopupNavigation.PopAllAsync();
 }
示例#6
0
        // Checks a lot of things to see if they are okay, if everything passes it pops the page
        private void OnSubmit(object sender, EventArgs e)
        {
            int flag = 0;

            // Cleans out past warnings
            Warn_Layout.Children.Clear();

            // Checks if any of the fields are empty; if they are warns the user
            if (String.IsNullOrEmpty(Event_Title.Text) || String.IsNullOrEmpty(Event_Place.Text))
            {
                if (String.IsNullOrEmpty(Event_Title.Text))
                {
                    Label Warn_Label = new Label {
                        Text = "Please enter a Title for the event", HorizontalOptions = LayoutOptions.CenterAndExpand
                    };
                    Warn_Layout.Children.Add(Warn_Label);
                }
                if (String.IsNullOrEmpty(Event_Place.Text))
                {
                    Label Warn_Label = new Label {
                        Text = "Please enter an Place for the event", HorizontalOptions = LayoutOptions.CenterAndExpand
                    };
                    Warn_Layout.Children.Add(Warn_Label);
                }
                flag = 1;
            }

            // Checks to make sure the date and time picked are in the future
            if (DateTime.Now.Day.CompareTo(datepickle.Date.Day) == 0)
            {
                if (timepickle.Time.Hours < DateTime.Now.Hour)
                {
                    Label Warn_Label = new Label {
                        Text = "Please enter a time in the future", HorizontalOptions = LayoutOptions.CenterAndExpand
                    };
                    Warn_Layout.Children.Add(Warn_Label);
                    flag = 1;
                }
                else if ((timepickle.Time.Hours == DateTime.Now.Hour) && (timepickle.Time.Minutes < DateTime.Now.Minute))
                {
                    Label Warn_Label = new Label {
                        Text = "Please enter a time in the future", HorizontalOptions = LayoutOptions.CenterAndExpand
                    };
                    Warn_Layout.Children.Add(Warn_Label);
                    flag = 1;
                }
            }

            // Checks to see if any tags are dupes, if any found it gets rid of em
            if (pickle0.SelectedIndex == pickle1.SelectedIndex || pickle0.SelectedIndex == pickle2.SelectedIndex ||
                pickle1.SelectedIndex == pickle2.SelectedIndex)
            {
                if (pickle0.SelectedIndex == pickle1.SelectedIndex && pickle0.SelectedIndex == pickle2.SelectedIndex)
                {
                    pickle1.SelectedIndex = -1;
                    pickle2.SelectedIndex = -1;
                    pickle2.IsVisible     = false;
                }
                else if (pickle0.SelectedIndex == pickle1.SelectedIndex && pickle2.SelectedIndex == -1)
                {
                    pickle1.SelectedIndex = -1;
                    pickle2.IsVisible     = false;
                }
                else if (pickle0.SelectedIndex == pickle1.SelectedIndex && pickle2.SelectedIndex != -1)
                {
                    pickle1.SelectedIndex = pickle2.SelectedIndex;
                    pickle2.SelectedIndex = -1;
                }
                else if (pickle0.SelectedIndex == pickle2.SelectedIndex)
                {
                    pickle2.SelectedIndex = -1;
                }
                else if (pickle1.SelectedIndex == pickle2.SelectedIndex)
                {
                    pickle2.SelectedIndex = -1;
                }
            }

            if (flag == 1)
            {
                Warn_Layout.IsVisible = true;
            }
            else
            {
                //var Event = new EventsDataModel.Event { Title = Event_Title.Text, Location = Event_Place.Text };
                PopupNavigation.PopAsync();
            }
        }
示例#7
0
        public MenuPopupPage()
        {
            HasSystemPadding = true;

            var label = new Label
            {
                Text      = "Recent trips",
                TextColor = Color.White,
                FontSize  = 18,
                HorizontalTextAlignment = TextAlignment.Center
            };

            var closeBtn = new Button
            {
                Text              = "Close",
                BackgroundColor   = Color.FromHex("#F2F6F8"),
                TextColor         = Color.FromHex("#5887F9"),
                CornerRadius      = 5,
                WidthRequest      = 175,
                HeightRequest     = 40,
                HorizontalOptions = LayoutOptions.Center,
                VerticalOptions   = LayoutOptions.End,
                Margin            = new Thickness(40, 0)
            };

            closeBtn.Clicked += async(sender, e) => {
                await PopupNavigation.PopAsync();
            };

            var lables = new string[] {
                "DEN - EWR 09Jun",
                "DEN - LHR 03Mar",
                "NYC 03Mar",
                "Last Week",
                "Last Month",
                "Older"
            };
            var images = new string[] {
                "flightTakeoffIcon",
                "flightTakeoffIcon",
                "hotelIcon",
                "archiveIcon",
                "archiveIcon",
                "archiveIcon"
            };

            var items = new List <View>();

            for (int i = 0; i < 6; i++)
            {
                var btn = new Button
                {
                    Text = string.Empty,

                    BackgroundColor = i == 2 ? Color.White : Color.FromHex("#805F5F5F"),
                    //Opacity = i == 2 ? 1 : 0.5,
                    BorderColor       = i == 2 ? Color.FromHex("#7BABFC") : Color.FromHex("#9B9B9B"),
                    BorderWidth       = 2,
                    CornerRadius      = 10,
                    WidthRequest      = 110,
                    HeightRequest     = 125,
                    HorizontalOptions = LayoutOptions.Center,
                    VerticalOptions   = LayoutOptions.Center,
                };

                var lbl = new Label
                {
                    Text      = lables[i],
                    TextColor = i == 2 ? Color.FromHex("#444444") : Color.White,
                    FontSize  = 14,
                    HorizontalTextAlignment = TextAlignment.Center,
                    VerticalOptions         = LayoutOptions.End,
                    Margin = 10
                };

                var img = new Image
                {
                    Source            = ImageSource.FromResource(string.Format("Fly360.images.{0}.png", images[i])),
                    WidthRequest      = 48,
                    HeightRequest     = 58,
                    HorizontalOptions = LayoutOptions.Center,
                    VerticalOptions   = LayoutOptions.Start,
                    Margin            = 25
                };

                Grid.SetRow(btn, i / 2);
                Grid.SetColumn(btn, i % 2);
                items.Add(btn);

                Grid.SetRow(lbl, i / 2);
                Grid.SetColumn(lbl, i % 2);
                items.Add(lbl);

                Grid.SetRow(img, i / 2);
                Grid.SetColumn(img, i % 2);
                items.Add(img);


                if (i == 2)
                {
                    btn.Clicked += (sender, e) => OnClicked();
                    lbl.GestureRecognizers.Add(new TapGestureRecognizer((v, a) => OnClicked()));
                    img.GestureRecognizers.Add(new TapGestureRecognizer((v, a) => OnClicked()));
                }
            }

            var grid = new Grid
            {
                RowDefinitions =
                {
                    new RowDefinition(),
                    new RowDefinition(),
                    new RowDefinition()
                },
                ColumnDefinitions =
                {
                    new ColumnDefinition(),
                    new ColumnDefinition(),
                },
                ColumnSpacing     = 55,
                RowSpacing        = 25,
                HorizontalOptions = LayoutOptions.Fill,
                VerticalOptions   = LayoutOptions.Center,
            };

            foreach (var b in items)
            {
                grid.Children.Add(b);
            }

            Content = new Grid
            {
                Children =
                {
                    new Image       {
                        Source  = ImageSource.FromResource("blur.jpg"),
                        Opacity = 0.33,
                        Aspect  = Aspect.Fill
                    },
                    new StackLayout {
                        Margin   = new Thickness(40, 60, 40, 0),
                        Spacing  = 40,
                        Children =
                        {
                            label,
                            grid,
                            closeBtn
                        },
                        HorizontalOptions = LayoutOptions.Fill,
                        VerticalOptions   = LayoutOptions.FillAndExpand,
                    }
                },
                HorizontalOptions = LayoutOptions.Fill,
                VerticalOptions   = LayoutOptions.FillAndExpand,
            };
        }
示例#8
0
        public AlertsViewModel(IAlertService alertService, IUserDialogs userDialogs,
                               IMvxMessenger mvxMessenger, AppHelper appHelper) : base(userDialogs, mvxMessenger, appHelper)
        {
            _alertService = alertService;

            ClearAlertsCommand = ReactiveCommand
                                 .CreateFromObservable <Unit, string>((param) =>
            {
                return(_appHelper.RequestConfirmation(AppResources.Alerts_Confirm_Clear)
                       .Do((_) => _userDialogs.ShowLoading(AppResources.Alerts_Deleting_Alerts))
                       .SelectMany((_) => string.IsNullOrEmpty(SonIdentity)
                                                 ? _alertService.ClearSelfAlerts() : _alertService.ClearAlertsOfSon(SonIdentity))
                       .Do((_) => _userDialogs.HideLoading()));
            });

            ClearAlertsCommand.Subscribe((alertsDeleted) =>
            {
                Debug.WriteLine("Alerts Deleted -> " + alertsDeleted);
                Alerts.Clear();
                DataFound = false;
            });

            ClearAlertsCommand.ThrownExceptions.Subscribe(HandleExceptions);

            RefreshCommand = ReactiveCommand
                             .CreateFromObservable <Unit, IList <AlertEntity> >((param) =>
            {
                if (PopupNavigation.PopupStack.Count > 0)
                {
                    PopupNavigation.PopAllAsync();
                }
                return(string.IsNullOrEmpty(SonIdentity) ?
                       alertService.GetSelfAlerts(CountAlertsOption.Value, AntiquityOfAlertsOption.Value, AlertLevelFilter) :
                       _alertService.GetAlertsBySon(SonIdentity, CountAlertsOption.Value, AntiquityOfAlertsOption.Value, AlertLevelFilter));
            });

            RefreshCommand.Subscribe((AlertsEntities) =>
            {
                Alerts.ReplaceRange(AlertsEntities);
                ResetCommonProps();
            });

            RefreshCommand.IsExecuting.Subscribe((IsLoading) => IsBusy = IsLoading);

            RefreshCommand.ThrownExceptions.Subscribe(HandleExceptions);

            DeleteAlertCommand = ReactiveCommand
                                 .CreateFromObservable <AlertEntity, string>((AlertEntity) =>
                                                                             alertService.DeleteAlertOfSon(AlertEntity.Son.Identity, AlertEntity.Identity)
                                                                             .Do((_) => Alerts.Remove(AlertEntity)));

            DeleteAlertCommand.IsExecuting.Subscribe((IsLoading) => IsBusy = IsLoading);

            DeleteAlertCommand.Subscribe((_) =>
            {
                _userDialogs.ShowSuccess(AppResources.Alerts_Deleted);

                if (Alerts.Count() == 0)
                {
                    DataFound = false;
                }
            });

            DeleteAlertCommand.ThrownExceptions.Subscribe(HandleExceptions);


            AllCategory.PropertyChanged += (sender, e) =>
            {
                if (e.PropertyName == "IsFiltered")
                {
                    foreach (var category in AlertsLevelCategories)
                    {
                        category.IsEnabled = !AllCategory.IsFiltered;
                        if (AllCategory.IsFiltered)
                        {
                            category.IsFiltered = true;
                        }
                    }
                }
            };

            foreach (AlertCategoryModel AlertCategory in AlertsLevelCategories)
            {
                AlertCategory.PropertyChanged += (sender, e) =>
                {
                    if (e.PropertyName == "IsFiltered")
                    {
                        var AlertCategoryModel = sender as AlertCategoryModel;
                        UpdateAlertFilter(AlertCategoryModel);
                    }
                };
            }
        }
示例#9
0
 private async void ToolbarItem_Clicked_1(object sender, EventArgs e)
 {
     await PopupNavigation.PushAsync(new FiltreModalPage(dashbordMW), true);
 }
        private async void TapGestureRecognizer_Tapped(object sender, System.EventArgs e)
        {
            await PopupNavigation.PopAllAsync();

            fullPhotoTruckVM.BackToRootPage();
        }
示例#11
0
        public SwitchPopup(List <string> options, List <bool> isToggled, string header = "")
        {
            InitializeComponent();
            if (ActionPopup.isOpen)
            {
                PopupNavigation.PopAsync(false);
            }
            ActionPopup.isOpen = true;
            optionsCount       = options.Count;

            BackgroundColor = new Color(0, 0, 0, 0.9);

            UpdateScreenRot();
            TheStack.SizeChanged += (o, e) => {
                UpdateScreenRot();
            };

            HeaderTitle.Text      = header;
            HeaderTitle.IsEnabled = header != "";
            HeaderTitle.IsVisible = header != "";

            CancelButton.Source      = GetImageSource("netflixCancel.png");
            CancelButtonBtt.Clicked += async(o, e) => {
                result             = selectBinding.MyNameCollection.Select(t => t.IsSelected).ToList();
                ActionPopup.isOpen = false;
                await PopupNavigation.PopAsync(true);
            };
            void ForceUpdate()
            {
                var _e = selectBinding.MyNameCollection.ToList();

                Device.BeginInvokeOnMainThread(() => {
                    selectBinding.MyNameCollection.Clear();
                    for (int i = 0; i < _e.Count; i++)
                    {
                        selectBinding.MyNameCollection.Add(_e[i]);
                    }
                });
            }

            epview.ItemSelected += (o, e) => {
                if (e.SelectedItemIndex != -1)
                {
                    selectBinding.MyNameCollection[e.SelectedItemIndex].IsSelected = !selectBinding.MyNameCollection[e.SelectedItemIndex].IsSelected;

                    epview.SelectedItem = null;
                    OnSelectedChanged   = null;
                    ForceUpdate();
                }
            };

            selectBinding  = new SwitchLabelView();
            BindingContext = selectBinding;

            for (int i = 0; i < options.Count; i++)
            {
                selectBinding.MyNameCollection.Add(new SwitchName()
                {
                    IsSelected = isToggled[i], Name = options[i],
                });
            }
        }
示例#12
0
 /// <summary>
 /// Cancel the new slider value
 /// </summary>
 private async void btnCancel_Clicked(object sender, EventArgs e)
 {
     await PopupNavigation.PopAsync();
 }
示例#13
0
 async Task Close()
 {
     await PopupNavigation.PopAsync();
 }
示例#14
0
        public AttachmentPopupPage(List <Attachments> res, int id)
        {
            InitializeComponent();

            downloader.OnFileDownloaded += OnFileDownloaded;

            attachres = res;

            so_id = id;
            // attachListView.ItemsSource = App.nextActivityList;

            //next_activity nxt = new next_activity();
            //nxt.name = "akil.pdf";

            //App.nextActivityList.Add(nxt);

            attachListView.ItemsSource = attachres;

            listviewlayout.HeightRequest = attachres.Count * 45;

            mainlayout.HeightRequest = listviewlayout.HeightRequest + 35;

            if (attachres.Count == 0)
            {
                listviewlayout.IsVisible = false;
                mainlayout.WidthRequest  = 100;
                mainlayout.HeightRequest = 25;
            }

            var tapGestureRecognizer = new TapGestureRecognizer();

            tapGestureRecognizer.Tapped += async(s, e) => {
                // handle the tap
                FileData fileData = new FileData();
                FileData filedata = null;
                try
                {
                    filedata = await CrossFilePicker.Current.PickFile();

                    if (filedata.FileName.Contains(".pdf") || filedata.FileName.Contains(".doc") ||
                        filedata.FileName.Contains(".docx") || filedata.FileName.Contains(".txt") || filedata.FileName.Contains(".jpeg") || filedata.FileName.Contains(".xls") ||
                        filedata.FileName.Contains(".jpg") || filedata.FileName.Contains(".wav") || filedata.FileName.Contains(".mp3") || filedata.FileName.Contains(".png") ||
                        filedata.FileName.Contains(".mp4") || filedata.FileName.Contains(".3gp") || filedata.FileName.Contains(".avi") || filedata.FileName.Contains(".xlsx"))
                    {
                        if (!string.IsNullOrEmpty(filedata.FileName)) //Just the file name, it doesn't has the path
                        {
                            byte[] bydata = filedata.DataArray;
                            //  String UploadData = Convert.ToBase64String(bydata);
                            string file_uploadstring = Convert.ToBase64String(bydata);
                            string file_uploadname   = filedata.FileName;

                            Dictionary <string, dynamic> vals = new Dictionary <string, dynamic>();

                            var currentpage = new LoadingAlert();
                            await PopupNavigation.PushAsync(currentpage);


                            vals["res_model"]   = "sale.order";
                            vals["res_id"]      = so_id;
                            vals["name"]        = file_uploadname;
                            vals["datas"]       = file_uploadstring;
                            vals["datas_fname"] = file_uploadname;
                            vals["public"]      = true;

                            var res1 = Controller.InstanceCreation().UpdateLeadCreationData("ir.attachment", "create", vals);

                            await DisplayAlert("Alert", "Record updated successfully", "Ok");

                            attachres = Controller.InstanceCreation().getfileAtachment(so_id);

                            attachListView.ItemsSource = attachres;

                            listviewlayout.HeightRequest = attachres.Count * 45;

                            mainlayout.HeightRequest = listviewlayout.HeightRequest + 35;

                            if (attachres.Count == 0)
                            {
                                listviewlayout.IsVisible = false;
                                mainlayout.WidthRequest  = 100;
                                mainlayout.HeightRequest = 20;
                            }

                            MessagingCenter.Send <string, List <Attachments> >("MyApp", "attachUpdated", attachres);

                            // MessagingCenter.Send<List<Attachments>,>("attachUpdated", attachres);

                            await PopupNavigation.PopAsync();

                            await PopupNavigation.PopAsync();

                            //  topimg = UploadData;
                            // var stream = new MemoryStream(bydata);
                            // user_img.Source = ImageSource.FromStream(() => stream);
                        }
                    }

                    else
                    {
                        await DisplayAlert("Alert", "Please upload valid file name", "Ok");
                    }
                }
                catch (Exception ex)
                {
                    filedata = null;
                    System.Diagnostics.Debug.WriteLine("Warning Exception :  " + ex.Message);
                }
            };
            add_attach.GestureRecognizers.Add(tapGestureRecognizer);
        }
示例#15
0
 public async Task Confirmation(string titleConfirmation, string detailConfirmation, string url)
 {
     ConfirmationPage confirmation = new ConfirmationPage(titleConfirmation, detailConfirmation, url);
     await PopupNavigation.PushAsync(confirmation);
 }
示例#16
0
        public void TapLoad()
        {
            var IdCores_tap = new TapGestureRecognizer();

            IdCores_tap.Tapped += async(s, e) =>
            {
                var app = new CadCores();
                await PopupNavigation.PopAsync();

                await PopupNavigation.PushAsync(app);
            };
            IdCores.GestureRecognizers.Add(IdCores_tap);

            var IdTamanhos_tap = new TapGestureRecognizer();

            IdTamanhos_tap.Tapped += async(s, e) =>
            {
                var app = new CadTamanho();
                await PopupNavigation.PopAsync();

                await PopupNavigation.PushAsync(app);
            };
            IdTamanhos.GestureRecognizers.Add(IdTamanhos_tap);

            var IdDepartamentos_tap = new TapGestureRecognizer();

            IdDepartamentos_tap.Tapped += async(s, e) =>
            {
                var app = new CadDepartamento();
                await PopupNavigation.PopAsync();

                await PopupNavigation.PushAsync(app);
            };
            IdDepartamentos.GestureRecognizers.Add(IdDepartamentos_tap);


            var IdFornecedores_tap = new TapGestureRecognizer();

            IdFornecedores_tap.Tapped += async(s, e) =>
            {
                var app = new CadFornecedor();
                await PopupNavigation.PopAsync();

                await PopupNavigation.PushAsync(app);
            };
            IdFornecedores.GestureRecognizers.Add(IdFornecedores_tap);

            var IdSubDepartamentos_tap = new TapGestureRecognizer();

            IdSubDepartamentos_tap.Tapped += async(s, e) =>
            {
                var app = new CadSubDepartamento();
                await PopupNavigation.PopAsync();

                await PopupNavigation.PushAsync(app);
            };
            IdSubDepartamentos.GestureRecognizers.Add(IdSubDepartamentos_tap);

            var IdCNCM_tap = new TapGestureRecognizer();

            IdCNCM_tap.Tapped += async(s, e) =>
            {
                var app = new CadCNCM();
                await PopupNavigation.PopAsync();

                await PopupNavigation.PushAsync(app);
            };
            IdCNCM.GestureRecognizers.Add(IdCNCM_tap);

            var IdUnidadeDeMedida_tap = new TapGestureRecognizer();

            IdUnidadeDeMedida_tap.Tapped += async(s, e) =>
            {
                var app = new CadUnidadeMedida();
                await PopupNavigation.PopAsync();

                await PopupNavigation.PushAsync(app);
            };
            IdUnidadeDeMedida.GestureRecognizers.Add(IdUnidadeDeMedida_tap);
        }
示例#17
0
 private void OnCancel(object sender, EventArgs e)
 {
     PopupNavigation.PopAsync();
 }
示例#18
0
        async void Done_Tapped(object sender, System.EventArgs e)
        {
            await Navigation.PushModalAsync(new MainPage());

            await PopupNavigation.PopAsync(true);
        }
 private async void Close(object sender, EventArgs e)
 {
     await PopupNavigation.PopAsync();
 }
示例#20
0
 private async void On_Close(object sender, EventArgs e)
 {
     // await Navigation.PushModalAsync(new MainPage());
     await PopupNavigation.PopAsync(true);
 }
示例#21
0
        async void OnClicked()
        {
            await PopupNavigation.PopAsync();

            //await Navigation.PushAsync(new BeachOptionsPage());
        }
示例#22
0
 private async void Button_Clicked(object sender, System.EventArgs e)
 {
     await PopupNavigation.PopAsync(true);
 }
示例#23
0
        private async void updateClickedAsync(object sender, EventArgs e)
        {
            //int stateid = 0;
            //int countryid = 0;

            //vals["planned_revenue"] = ex_rev_entry.Text;
            //vals["probability"] = prob_entry.Text;
            vals["name"] = crm_name_entry.Text;

            vals["contact_name"] = contactname_entry.Text;

            vals["email_from"] = email_entry.Text;

            vals["phone"] = phone_entry.Text;

            //vals["function"] = jobPos.Text;
            //vals["street"] = street.Text;
            //vals["street2"] = street2.Text;
            //vals["zip"] = zip.Text;

            //var salespersonid = App.salespersons.FirstOrDefault(x => x.Value == salesperson_Picker.SelectedItem.ToString()).Key;
            //vals["user_id"] = salespersonid;

            var salesteamid = App.salesteam.FirstOrDefault(x => x.Value == team_picker.SelectedItem.ToString()).Key;

            vals["team_id"] = salesteamid;

            var salespersonid = App.salespersons.FirstOrDefault(x => x.Value == sales_person_picker.SelectedItem.ToString()).Key;

            vals["user_id"] = salespersonid;

            //var customerid = App.cusdict.FirstOrDefault(x => x.Value == cus_picker.SelectedItem.ToString()).Key;
            //vals["partner_id"] = customerid;

            //  vals["partner_name"] = cus_picker.SelectedItem.ToString();

            int next_activity_id = 0;

            //var nextactivityid =
            //        (
            //            from i in App.nextActivityList
            //        where i.name == nextact_picker.SelectedItem.ToString()
            //            select new
            //            {
            //                i.id,
            //            }
            //   ).ToList();

            //foreach (var comgroup in nextactivityid)
            //{
            //    next_activity_id = comgroup.id;
            //}

            //vals["next_activity_id"] = next_activity_id;

            //String date_deadline_string = String.Format("{0:MM-dd-yyyy HH:mm:ss}", expe_closing_picker.Date);

            //vals["date_deadline"] = date_deadline_string;

            //vals["planned_revenue"] = ex_rev_entry.Text;

            //vals["probability"] = prob_entry.Text;

            // vals["description"] = activty_des.Text;

            vals["type"] = "lead";

            vals["priority"] = count;

            if (CrmNameValue.Text == "")
            {
                await DisplayAlert("Alert", "Please fill title", "Ok");
            }

            //if (Convert.ToInt32(prob_entry.Text) > 100)
            //{
            //    prob_alert.IsVisible = true;
            //}

            else
            {
                var currentpage = new LoadingAlert();
                await PopupNavigation.PushAsync(currentpage);

                //  string updated = Controller.InstanceCreation().UpdateLeadCreationData("crm.lead", "create", vals_update);

                bool updated = Controller.InstanceCreation().UpdateSaleOrder("crm.lead", "write", crm_lead_id, vals);

                if (updated == true)
                {
                    App.Current.MainPage = new MasterPage(new CrmTabbedPage());
                }

                else
                {
                    //  Loadingalertcall();
                    await  DisplayAlert("Alert", "Please try again", "Ok");
                }
            }

            Loadingalertcall();
        }
示例#24
0
 public async Task Alert(string titleAlert, string detailAlert)
 {
     AlertPage alert = new AlertPage(titleAlert, detailAlert);
     await PopupNavigation.PushAsync(alert);
 }
示例#25
0
        private async void createClickedAsync(object sender, EventArgs ea)
        {
            var currentpage = new LoadingAlert();

            await PopupNavigation.PushAsync(currentpage);

            var cusid = App.cusList.FirstOrDefault(x => x.name == cuspicker1.SelectedItem.ToString()).id;

            vals["customer"]          = cusid;
            vals["oppurtunity_title"] = oppTitle.Text;
            vals["email"]             = eMail.Text;
            vals["phone"]             = phone.Text;

            //  String picker_date = nextActDatePicker.Date.ToString();
            DateTime startdateTime;


            try
            {
                startdateTime = DateTime.ParseExact(nextActDatePicker.Date.ToString(), "dd-MM-yyyy hh:mm:ss", CultureInfo.InvariantCulture);
            }

            catch (Exception exe)
            {
                try
                {
                    startdateTime = DateTime.ParseExact(nextActDatePicker.Date.ToString(), "MM/dd/yyyy hh:mm:ss", CultureInfo.InvariantCulture);
                }

                catch (Exception exa)
                {
                    try
                    {
                        startdateTime = DateTime.ParseExact(nextActDatePicker.Date.ToString(), "MM/dd/yyyy hh:mm:ss tt", CultureInfo.InvariantCulture);
                    }
                    catch (Exception ea1)
                    {
                        try
                        {
                            startdateTime = DateTime.ParseExact(nextActDatePicker.Date.ToString(), "dd-MM-yyyy hh:mm:ss tt", CultureInfo.InvariantCulture);
                        }
                        catch
                        {
                            try
                            {
                                startdateTime = DateTime.ParseExact(nextActDatePicker.Date.ToString(), "dd/MM/yyyy hh:mm:ss", CultureInfo.InvariantCulture);
                            }
                            catch
                            {
                                try
                                {
                                    startdateTime = DateTime.ParseExact(nextActDatePicker.Date.ToString(), "dd/MM/yyyy HH:mm:ss", CultureInfo.InvariantCulture);
                                }
                                catch
                                {
                                    try
                                    {
                                        startdateTime = DateTime.ParseExact(nextActDatePicker.Date.ToString(), "dd/MM/yyyy hh:mm:ss tt", CultureInfo.InvariantCulture);
                                    }
                                    catch
                                    {
                                        try
                                        {
                                            startdateTime = DateTime.ParseExact(nextActDatePicker.Date.ToString(), "dd-MM-yyyy hh:mm:ss", CultureInfo.InvariantCulture);
                                        }

                                        catch
                                        {
                                            startdateTime = DateTime.ParseExact(nextActDatePicker.Date.ToString(), "M/d/yyyy hh:mm:ss tt", CultureInfo.InvariantCulture);
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }

            string nextactdatepicker_date = startdateTime.ToString("yyyy-MM-dd");

            // vals["next_activity_date"] = nextActDatePicker.Date.ToString();

            vals["next_activity_date"]    = nextactdatepicker_date;
            vals["next_activity"]         = nextActPicker.SelectedItem.ToString();
            vals["next_activity_summary"] = nextActSum.Text;

            if (exRev.Text == "")
            {
                exRev.Text = "0";
            }
            vals["expected_revenue"] = Convert.ToDouble(exRev.Text);
            vals["rating"]           = count;
            vals["stage"]            = stagePicker.SelectedItem;
            vals["internal_notes"]   = comments.Text;
            vals["meetings"]         = meetingLineList;
            vals["state"]            = "new";


            var salespersonid = App.salespersons.FirstOrDefault(x => x.Value == salesperson_Picker.SelectedItem.ToString()).Key;

            vals["user_id"] = salespersonid;

            var salesteamid = App.salesteam.FirstOrDefault(x => x.Value == salesteam_Picker.SelectedItem.ToString()).Key;

            vals["team_id"] = salesteamid;

            var customerid = App.cusList.FirstOrDefault(x => x.name == cuspicker1.SelectedItem.ToString()).id;

            vals["partner_id"] = customerid;

            vals["partner_name"] = cuspicker1.SelectedItem.ToString();

            int next_activity_id = 0;

            var nextactivityid =
                (
                    from i in App.nextActivityList
                    where i.name == nextActPicker.SelectedItem.ToString()
                    select new
            {
                i.id,
            }
                ).ToList();

            foreach (var comgroup in nextactivityid)
            {
                next_activity_id = comgroup.id;
            }

            vals["next_activity_id"] = next_activity_id;


            if (cuspicker1.SelectedItem.ToString() == "")
            {
                var alert = DisplayAlert("Alert", "Please select the customer", "Ok");
            }


            String date_deadline_string = String.Format("{0:yyy-MM-dd HH:mm:ss}", expected_closing_Picker.Date);

            vals["date_deadline"] = date_deadline_string;

            //   List<CRMLead> crmLeadData = Controller.InstanceCreation().crmLeadData();

            if (App.NetAvailable == true)
            {
                if (Convert.ToInt32(prob_entry.Text) > 100)
                {
                    // leadtitle_alert.IsVisible = false;
                    prob_alert.IsVisible = true;
                }

                else

                {
                    //bool updated = Controller.InstanceCreation().UpdateCRMOpporData("sale.crm", "create_crm_quotations", vals);
                    string updated = Controller.InstanceCreation().UpdateCRMOpporData("crm.lead", "create_crm_quotations", vals);

                    if (updated == "true")
                    {
                        // App.Current.MainPage = new MasterPage(new CrmTabbedPage());
                        // Navigation.PushPopupAsync(new MasterPage(  );
                        // await DisplayAlert("Alert", "Created Successfull", "Ok");
                        //  await   Navigation.PopAllPopupAsync();
                        App.oppo_rpc         = true;
                        App.Current.MainPage = new MasterPage(new CrmTabbedPage("tab2"));
                        await Navigation.PopAllPopupAsync();
                    }
                    else
                    {
                        await DisplayAlert("Alert", "Please try again", "Ok");

                        await PopupNavigation.PopAsync();
                    }
                }
            }

            else if (App.NetAvailable == false)
            {
                //    var cusiddb = cusdict.FirstOrDefault(x => x.Value == cuspicker1.SelectedItem.ToString()).Key;

                //    var json_meetingLineList = JsonConvert.SerializeObject(meetingLineList);


                //    int next_activity_offline_id = 0;

                //    var nextactivityids =
                //        (
                //            from i in App.nextActivityList
                //            where i.name == nextActPicker.SelectedItem.ToString()
                //            select new
                //            {
                //                i.id,
                //            }
                //   ).ToList();

                //    foreach (var comgroup in nextactivityids)
                //    {
                //        next_activity_offline_id = comgroup.id;
                //    }



                //    String ex_closing_string = String.Format("{0:MM-dd-yyyy HH:mm:ss}", expected_closing_Picker.Date);

                //    var sample = new CRMOpportunitiesDB
                //    {
                //        //  id = item.id,
                //        cusid = cusiddb,
                //        customer = cuspicker1.SelectedItem.ToString(),
                //        next_activity = nextActPicker.SelectedItem.ToString(),
                //        name =oppTitle.Text,
                //        email = eMail.Text,
                //        phone = phone.Text,
                //        next_activity_date = nextactdatepicker_date.ToString(),
                //        expected_revenue = Convert.ToDouble(exRev.Text).ToString(),
                //        rating = count,
                //        stage = stagePicker.SelectedItem.ToString(),
                //        internal_notes = comments.Text,
                //        meetings = json_meetingLineList,
                //        FullState = "  New  ",
                //        state = "  New  ",
                //        state_colour = "#3498db",
                //        nextact_id = next_activity_offline_id,
                //        oppurtunity_title = oppTitle.Text,
                //        next_activity_summary = nextActSum.Text,
                //        expected_closing = date_deadline_string,
                //        yellowimg_string = "yellowcircle.png",

                //        //order_line = item.order_line[0].ToString()
                //    };
                //    App._connection.Insert(sample);

                //    App._connection.CreateTable<CRMOpportunitiesDB>();
                //    try
                //    {
                //        var details = (from y in App._connection.Table<CRMOpportunitiesDB>() select y).ToList();
                //        App.CRMOpportunitiesListDb = details;
                //    }
                //    catch (Exception ex)
                //    {
                //        int i = 0;
                //    }

                // // await  DisplayAlert("Alert", "Created Successfull", "Ok");

                //    App.Current.MainPage = new MasterPage(new CrmTabbedPage("tab2"));

                //    await Navigation.PopAllPopupAsync();

                //}
            }
        }
示例#26
0
 public async Task Success(string titleSuccess, string detailSuccess)
 {
     CorrectValidationPage correctValidation = new CorrectValidationPage(titleSuccess, detailSuccess);
     await PopupNavigation.PushAsync(correctValidation);
 }
示例#27
0
        async void Handle_Clicked(object sender, System.EventArgs e)
        {
            try
            {
                Contract.Ensures(Contract.Result <Task>() != null);
                date_alert.IsVisible    = false;
                date_box.IsVisible      = false;
                meeting_alert.IsVisible = false;
                meeting_box.IsVisible   = false;

                DateTime startdateTime;
                DateTime stopdateTime;



                // DateTime startdateTime = DateTime.ParseExact(st_date.Date.ToString(), "M/d/yyyy hh:mm:ss tt", CultureInfo.InvariantCulture);

                //  startdateTime = DateTime.ParseExact("24/01/2019 00:00:00", "dd/MM/yyyy hh:mm:ss", CultureInfo.InvariantCulture);

                //try
                //{
                //    startdateTime = DateTime.ParseExact(st_date.Date.ToString(), "dd-MM-yyyy hh:mm:ss", CultureInfo.InvariantCulture);
                //}

                //catch (Exception exe)
                //{
                //    try
                //    {
                //        startdateTime = DateTime.ParseExact(st_date.Date.ToString(), "MM/dd/yyyy hh:mm:ss", CultureInfo.InvariantCulture);
                //    }

                //    catch (Exception ea)
                //    {
                //        try
                //        {
                //            startdateTime = DateTime.ParseExact(st_date.Date.ToString(), "MM/dd/yyyy hh:mm:ss tt", CultureInfo.InvariantCulture);
                //        }
                //        catch (Exception ea1)
                //        {

                //            try
                //            {
                //                startdateTime = DateTime.ParseExact(st_date.Date.ToString(), "dd-MM-yyyy hh:mm:ss tt", CultureInfo.InvariantCulture);
                //            }
                //            catch
                //            {

                //                try
                //                {
                //                    startdateTime = DateTime.ParseExact(st_date.Date.ToString(), "dd/MM/yyyy hh:mm:ss", CultureInfo.InvariantCulture);
                //                }
                //                catch
                //                {
                //                    try
                //                    {
                //                        startdateTime = DateTime.ParseExact(st_date.Date.ToString(), "dd/MM/yyyy HH:mm:ss", CultureInfo.InvariantCulture);
                //                    }
                //                    catch
                //                    {

                //                        try
                //                        {
                //                            startdateTime = DateTime.ParseExact(st_date.Date.ToString(), "dd/MM/yyyy hh:mm:ss tt", CultureInfo.InvariantCulture);
                //                        }
                //                        catch
                //                        {
                //                            startdateTime = DateTime.ParseExact(st_date.Date.ToString(), "M/d/yyyy hh:mm:ss tt", CultureInfo.InvariantCulture);
                //                        }
                //                    }
                //                }
                //            }
                //        }
                //    }
                //}

                String convertstartdate = st_date.Date.ToString("yyyy-MM-dd");


                //   string convertstartdate = startdateTime.ToString("yyyy-MM-dd");
                var dt = st_poptime.Time.ToString();

                convertstartdate = convertstartdate + " " + dt.ToString();
                //  string convertstarttime1 = startdateTime;

                //  string convertstarttime = dt.ToUniversalTime().ToString("yyyy-MM-dd HH:mm:ss");

                string convertstarttime = convertstartdate;

                DateTime startDate = DateTime.ParseExact(convertstarttime, "yyyy-MM-dd HH:mm:ss", null);

                //    convertstarttime = startDate.ToUniversalTime().ToString("yyyy-MM-dd HH:mm:ss");

                convertstarttime = startDate.ToUniversalTime().ToString("yyyy-MM-dd HH:mm:ss");


                //try
                //{
                //    stopdateTime = DateTime.ParseExact(stop_date.Date.ToString(), "dd-MM-yyyy hh:mm:ss", CultureInfo.InvariantCulture);
                //}

                //catch (Exception exc)
                //{
                //    try
                //    {
                //        stopdateTime = DateTime.ParseExact(stop_date.Date.ToString(), "MM/dd/yyyy hh:mm:ss", CultureInfo.InvariantCulture);

                //    }
                //    catch (Exception a)
                //    {

                //        try
                //        {
                //            stopdateTime = DateTime.ParseExact(stop_date.Date.ToString(), "MM/dd/yyyy hh:mm:ss tt", CultureInfo.InvariantCulture);
                //        }

                //        catch
                //        {

                //            try
                //            {
                //                stopdateTime = DateTime.ParseExact(stop_date.Date.ToString(), "dd-MM-yyyy hh:mm:ss tt", CultureInfo.InvariantCulture);
                //            }
                //            catch
                //            {

                //                try
                //                {
                //                    stopdateTime = DateTime.ParseExact(stop_date.Date.ToString(), "dd/MM/yyyy hh:mm:ss", CultureInfo.InvariantCulture);
                //                }

                //                catch
                //                {
                //                        try
                //                        {
                //                            stopdateTime = DateTime.ParseExact(stop_date.Date.ToString(), "dd/MM/yyyy HH:mm:ss", CultureInfo.InvariantCulture);
                //                        }

                //                    catch
                //                    {
                //                        try
                //                        {
                //                            stopdateTime = DateTime.ParseExact(stop_date.Date.ToString(), "dd/MM/yyyy hh:mm:ss tt", CultureInfo.InvariantCulture);
                //                        }
                //                        catch
                //                        {
                //                            try
                //                            {
                //                                stopdateTime = DateTime.ParseExact(stop_date.Date.ToString(), "dd/MM/yyyy HH:mm:ss tt", CultureInfo.InvariantCulture);
                //                            }

                //                            catch
                //                            {
                //                                try
                //                                {
                //                                    stopdateTime = DateTime.ParseExact(stop_date.Date.ToString(), "M/d/yyyy hh:mm:ss", CultureInfo.InvariantCulture);
                //                                }
                //                                catch
                //                                {
                //                                    stopdateTime = DateTime.ParseExact(stop_date.Date.ToString(), "M/d/yyyy hh:mm:ss tt", CultureInfo.InvariantCulture);
                //                                }
                //                            }


                //                        }

                //                    }
                //                }


                //            }
                //        }
                //    }
                //}



                //string convertstopdate = stopdateTime.ToString("yyyy-MM-dd");

                string convertstopdate = stop_date.Date.ToString("yyyy-MM-dd");


                var dt1 = stop_poptime.Time.ToString();

                // string convertstoptime = dt1.ToUniversalTime().ToString("HH:mm:ss");

                string convertstoptime = convertstopdate + " " + dt1.ToString();

                DateTime stopDate = DateTime.ParseExact(convertstoptime, "yyyy-MM-dd HH:mm:ss", null);

                convertstoptime = stopDate.ToUniversalTime().ToString("yyyy-MM-dd HH:mm:ss");

                vals["location"]        = loc.Text.ToString();
                vals["attendees"]       = atnIdsList;
                vals["tags"]            = tagIdsList;
                vals["meeting_subject"] = meeting_subject.Text;

                vals["start_datetime"] = convertstarttime;
                vals["stop_datetime"]  = convertstoptime;
                vals["start"]          = convertstarttime;
                vals["stop"]           = convertstoptime;
                vals["description"]    = des.Text;

                vals["start_date"] = startDate.ToString("yyyy-MM-dd");

                if (check1.Checked == true)
                {
                    vals["all_day"]  = true;
                    vals["duration"] = 0;
                    //   vals["start_date"] = convertstarttime;
                    vals["start_date"] = startDate.ToString("yyyy-MM-dd");
                    // vals["stop_date"] = convertstoptime;
                    vals["stop_date"] = stopDate.ToString("yyyy-MM-dd");

                    vals_update["start"] = convertstarttime;
                    vals_update["stop"]  = convertstoptime;

                    if (stopDate.Date <= startDate.Date)
                    {
                        date_alert.IsVisible = true;
                        date_box.IsVisible   = true;
                        // DisplayAlert("Alert", "Please fill meeting subject", "Ok");
                    }
                }

                else
                {
                    vals["all_day"] = false;

                    try
                    {
                        vals["duration"] = Convert.ToDouble(dur.Text);

                        DateTime startDate1 = startDate.ToUniversalTime();

                        startDate1 = startDate1.AddHours(Convert.ToDouble(dur.Text));

                        string startstring1 = startDate1.ToString("yyyy-MM-dd HH:mm:ss");
                        vals["stop_date"]     = stopDate.ToString("yyyy-MM-dd");
                        vals["stop_datetime"] = startstring1;
                        vals["stop"]          = startstring1;
                    }
                    catch
                    {
                        vals["duration"] = 0;

                        //vals["stop_date"] = stopDate.ToString("yyyy-MM-dd");
                        //vals["stop_datetime"] = convertstarttime;
                        //vals["stop"] = convertstarttime;
                    }
                    //  vals["duration"] = 0;
                }



                if (meeting_subject.Text == "")
                {
                    meeting_alert.IsVisible = true;
                    meeting_box.IsVisible   = true;
                    // DisplayAlert("Alert", "Please check your stop date ", "Ok");
                }

                else if (check1.Checked == false && dur.Text == "")
                {
                    await DisplayAlert("Alert", "Please fill All day / Duration", "Ok");
                }

                else
                {
                    var updated = Controller.InstanceCreation().UpdateCRMOpporData("calendar.event", "create_event", vals);
                    if (updated == "true")
                    {
                        date_alert.IsVisible = false;
                        var currentpage = new LoadingAlert();
                        await PopupNavigation.PushAsync(currentpage);

                        App.Current.MainPage = new MasterPage(new CalendarPage());
                        await  DisplayAlert("Alert", "Created Successfull", "Ok");

                        Loadingalertcall();
                        //   Navigation.PopAllPopupAsync();
                    }
                    else
                    {
                        await DisplayAlert("Alert", "Please try again", "Ok");
                    }
                }
            }

            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine(">>>>>>>>>>>>>" + ex.Message);
            }
        }
示例#28
0
 public async Task Unsuccess(string titleUnsuccess, string detailUnsuccess)
 {
     IncorrectValidationPage incorrectValidation = new IncorrectValidationPage(titleUnsuccess, detailUnsuccess);
     await PopupNavigation.PushAsync(incorrectValidation);
 }
示例#29
0
        /// <summary>
        /// Delete folder and icons within
        /// </summary>
        /// <param name="currentIcon"></param>
        public async void ConfirmDeleteFolder(Icon currentIcon)
        {
            var response = await Acr.UserDialogs.UserDialogs.Instance.ConfirmAsync("Delete this folder and the icons within?");

            if (response && currentIcon != null)
            {
                new Xamarin.Forms.Animation((value) =>
                {
                    try
                    {
                        if (currentIcon != null)
                        {
                            currentIcon.Transformation = SKMatrix.MakeScale(1 - (float)value, 1 - (float)value);
                        }
                    }
                    catch (System.Exception e)
                    {
                        System.Diagnostics.Debug.WriteLineIf(App.OutputVerbose, e.ToString());
                    }
                }).Commit(Xamarin.Forms.Application.Current.MainPage, "Anim", length: Constants.DeviceLayout.AnimationShrinkMillis, finished: async(v2, c2) =>
                {
                    try
                    {
                        var containedIconColl = canvasRef.Icons.Where(elem => elem.IsStoredInAFolder &&
                                                                      elem.StoredFolderTag == currentIcon.Text);

                        if (containedIconColl != null && containedIconColl.Any() && containedIconColl.Count() > 0)
                        {
                            System.Collections.Generic.List <int> indicesToRemove = new System.Collections.Generic.List <int>();

                            // Build a list of items to remove
                            foreach (var storedIcon in containedIconColl)
                            {
                                indicesToRemove.Add(canvasRef.Icons.IndexOf(storedIcon));
                            }

                            indicesToRemove = indicesToRemove.Where(i => i != -1)
                                              .OrderByDescending(i => i)
                                              .ToList();

                            foreach (var index in indicesToRemove)
                            {
                                canvasRef.Icons.RemoveAt(index);
                            }
                        }

                        if (currentIcon != null)
                        {
                            canvasRef.Icons.Remove(currentIcon);
                            canvasRef.Controller.PromptResave();

#pragma warning disable CS0618 // Type or member is obsolete
                            await PopupNavigation.PopAsync();
#pragma warning restore CS0618 // Type or member is obsolete
                        }
                    }
                    catch (System.Exception e)
                    {
                        System.Diagnostics.Debug.WriteLineIf(App.OutputVerbose, e.ToString());
                    }
                });
            }
        }
示例#30
0
        public SelectPopup(List <string> options, int selected, string header = "", bool isCenter = true, bool fontTest = false)
        {
            currentOptions = options;

            if (ActionPopup.isOpen)
            {
                PopupNavigation.PopAsync(false);
            }
            ActionPopup.isOpen = true;
            //  BackgroundColor = Color.Transparent;
            //   BackgroundImageSource = null;
            BackgroundColor = new Color(0, 0, 0, 0.9);
            InitializeComponent();

            // On<Xamarin.Forms.PlatformConfiguration.Android>().Element.windo

            UpdateScreenRot();
            TheStack.SizeChanged += (o, e) => {
                UpdateScreenRot();
            };

            HeaderTitle.Text      = header;
            HeaderTitle.IsEnabled = header != "";
            HeaderTitle.IsVisible = header != "";

            CancelButton.Source      = GetImageSource("netflixCancel.png");
            CancelButtonBtt.Clicked += (o, e) => {
                OnSelectedChanged  = null;
                optionSelected     = "Cancel";
                ActionPopup.isOpen = false;
                PopupNavigation.PopAsync(true);
            };


            epview.ItemSelected += (o, e) => {
                if (e.SelectedItemIndex != -1)
                {
                    if (selected != e.SelectedItemIndex)
                    {
                        OnSelectedChanged?.Invoke(this, e.SelectedItemIndex);
                    }
                    epview.SelectedItem = null;
                    OnSelectedChanged   = null;

                    optionSelected = options[e.SelectedItemIndex];
                    PopupNavigation.PopAsync(true);
                }
            };

            selectBinding  = new SelectLabelView();
            BindingContext = selectBinding;

            for (int i = 0; i < currentOptions.Count; i++)
            {
                bool isSel = i == selected;
                selectBinding.MyNameCollection.Add(new PopupName()
                {
                    IsSelected = isSel, Name = currentOptions[i].Replace("(Mirror ", "("), LayoutCenter = isCenter ? LayoutOptions.Center : LayoutOptions.Start, FontFam = fontTest ? GetFont(currentOptions[i]) : ""
                });
            }

            if (selected != -1)
            {
                epview.ScrollTo(selectBinding.MyNameCollection[selected], ScrollToPosition.Center, false);
            }
        }