public PanelController(IRepo repo, DataLister view) { this.repo = repo; this.view = view; panel = new Panel(); buttonPanel = new Panel(); buttonsList = new List <ButtonCallback>(); panel.Size = new Size(700, 90); //esta funcion arma los paneles BuildPanel(); List <IFilter> filters = GetFilters(); int ypos = 10; int xpos = 10; for (int i = 0; i < filters.Count; i++) { Panel filterInput = filters[i].GetFilter(); filterInput.Location = new Point(xpos, ypos); panel.Controls.Add(filterInput); ypos = ypos + filterInput.Size.Height + 25; if (ypos > 70) { ypos = 10; xpos = xpos + 250; } } ButtonCallback searchButton = new ButtonCallback("Buscar", SearchCallback); ButtonCallback clearButton = new ButtonCallback("Limpiar", ClearCallback); buttonsList.Add(searchButton); buttonsList.Add(clearButton); foreach (ButtonCallback button in GetButtons()) { buttonsList.Add(button); } this.view.SetPanelController(this); SqlCommand cmd = Database.BeginTransaction(); try { view.UpdateDataList(cmd); Database.CommitTransaction(cmd); }catch (Exception e) { Database.RollbackTransaction(cmd); PopUpDialog dialog = new PopUpDialog("Error", "Hubo un error obteniendo listado."); throw e; } }
private void OnLoaded(object sender, RoutedEventArgs routedEventArgs) { Image image = Utilities.LoadGifImage($"pack://application:,,,/MeetingHubLibrary;Component/Images/Project/Launch/{Hamastar.DefaultConfig.Config.Language}/loading.gif"); image.Width = 400.0; image.Height = 300.0; PopUpDialog = new PopUpDialog(image); PopUpDialog.Left = SystemParameters.PrimaryScreenWidth / 2.0 - 200.0; PopUpDialog.Top = SystemParameters.PrimaryScreenHeight / 2.0 - 150.0; PopUpDialog.Show(); LaunchTimer = new Timer(Launch, null, 300, 300); base.Closing += OnClosing; }
public void RunStarted(object automationObject, Dictionary <string, string> replacementsDictionary, WizardRunKind runKind, object[] customParams) { try { replacementsDictionary.TryGetValue("$ExtensionName$", out string extensionName); replacementsDictionary.TryGetValue("$GeneratorName$", out string generatorName); var popUpDialog = new PopUpDialog(extensionName, generatorName, replacementsDictionary); popUpDialog.Show(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
private async void ButtonGetGPS_Clicked(object sender, EventArgs e) { PopUpDialog.IsVisible = false; PopUpDialog.ShowDialog(); try { var hasPermission = await Utils.CheckPermissions(Permission.Location); if (!hasPermission) { return; } ButtonGetGPS.IsEnabled = false; /* var locator = CrossGeolocator.Current; * locator.DesiredAccuracy = 50; * lbData.Text = "Getting gps..."; */ var position = await ContentGlobal.getLocation(); if (position == null) { lbData.Text = "null gps :("; return; } Debug.WriteLine("Position Status: Latitude ------------------------------------------" + position.Latitude); Debug.WriteLine("Position Status: Longitude ------------------------------------------" + position.Longitude); lbData.Text = string.Format("Time: {0} \nLat: {1} \nLong: {2} \nAltitude: {3} \nAltitude Accuracy: {4} \nAccuracy: {5} \nHeading: {6} \nSpeed: {7}", position.Timestamp, position.Latitude, position.Longitude, position.Altitude, position.AltitudeAccuracy, position.Accuracy, position.Heading, position.Speed); } catch (Exception ex) { await DisplayAlert("Uh oh", "Something went wrong, but don't worry we captured for analysis! Thanks.", "OK"); Debug.WriteLine("Er------------------------" + ex); } finally { ButtonGetGPS.IsEnabled = true; } }
private async Task <bool> ChackUpdate(PopUpDialog dialog) { Debug.Log("Chack Update Start."); FileUpdater = new FileUpDater(Application.persistentDataPath + "\\"); if (!await FileUpdater.ChackUpDateAvailable()) { Debug.Log("Missing."); dialog.SetAsync("接続失敗\nアップデートは中断されました。"); return(false); } Debug.Log("Connection OK."); enu = RunProgress(); StartCoroutine(enu); dialog.SetAsync("通信中...\nアップデートを取得しています"); if (!await FileUpdater.ApplyUpdate()) { Debug.Log("Missing.\n" + FileUpdater.Log); } else { Debug.Log("Chack Update OK.\n" + FileUpdater.Log); } dialog.SetAsync("OK.\nアップデートが完了しました。"); StopCoroutine(enu); // スライダー slider.value = slider.maxValue; Debug.Log("<Installed Patches List> [" + FileUpdater.InstalledPatch.Count + "]"); if (FileUpdater.InstalledPatch.Count > 0) { foreach (var p in FileUpdater.InstalledPatch) { Debug.Log("Package Name : " + p.PatchName); } } var json = FileUpDater.Serializer <FileUpDater.Patch[]> .GetJson(FileUpdater.InstalledPatch.ToArray()); PlayerPrefs.SetString("patches", json); PlayerPrefs.SetInt("isFirst", 1); return(true); }
public ContentNotificationPage() { InitializeComponent(); PopUpDialog.ShowDialog(); this.BackgroundColor = Color.FromHex("#F0EFF5"); }
private void BtnShowDialog_Clicked(object sender, EventArgs e) { PopUpDialog.ShowDialog(); }
/* Page pagePersion = new Personal.PersonalPage(); * Page pageTotalFinger = new Timekeeping.AllTimekeepingPage(); * Page pageWhoWorking = new Timekeeping.WhoWorkingPage(); * Page pageOneFinger = new Timekeeping.OneTimekeepingPage();*/ public OverviewPage() { InitializeComponent(); if ((int)Application.Current.Properties["from_noti"] == 1) { Debug.WriteLine("from_noti---------------------------------------"); DisplayAlert(Application.Current.Properties["title_noti"].ToString(), Application.Current.Properties["content_noti"].ToString(), "OK"); } this.BackgroundColor = Color.FromHex("#F0EFF5"); if (Device.RuntimePlatform == Device.iOS) { stkHeader.Margin = new Thickness(0, 20, 0, 0); } if (ContentGlobal.Userroot == false) { stkWorking.IsVisible = false; stkAccept.IsVisible = false; } else { stkWorking.IsVisible = true; stkAccept.IsVisible = true; } var tapGestureRecognizer = new TapGestureRecognizer(); tapGestureRecognizer.Tapped += (s, e) => { Navigation.PushAsync(new Timekeeping.AllTimekeepingPage()); }; toTotalFinger.GestureRecognizers.Add(tapGestureRecognizer); var tapimgWhoWorking = new TapGestureRecognizer(); tapimgWhoWorking.Tapped += (s, e) => { Navigation.PushAsync(new Timekeeping.WhoWorkingPage()); }; stkWorking.GestureRecognizers.Add(tapimgWhoWorking); var tapAccept = new TapGestureRecognizer(); tapAccept.Tapped += (s, e) => { Navigation.PushAsync(new Timekeeping.PreviewTimeKeepingPage()); }; stkAccept.GestureRecognizers.Add(tapAccept); var tapGestureRecognizer1 = new TapGestureRecognizer(); tapGestureRecognizer1.Tapped += (s, e) => { Navigation.PushAsync(new Timekeeping.OneTimekeepingPage()); }; toOneFinger.GestureRecognizers.Add(tapGestureRecognizer1); var tapPersion = new TapGestureRecognizer(); tapPersion.Tapped += (s, e) => { stkHeader.IsVisible = false; Navigation.PushAsync(new Personal.PersonalPage()); }; imgtoPersion.GestureRecognizers.Add(tapPersion); var tapimgtoNotification = new TapGestureRecognizer(); tapimgtoNotification.Tapped += (s, e) => { Navigation.PushAsync(new NotificationPage()); }; //imgtoNotification.GestureRecognizers.Add(tapimgtoNotification); grdNoti.GestureRecognizers.Add(tapimgtoNotification); var tapImgCircle = new TapGestureRecognizer(); tapImgCircle.Tapped += async(s, e) => { if (boolAnimation == false) { // await DisplayAlert("Info", await takeImageAsync(), "OK"); // if (await takeImageAsync() == "1") // { var answer = await DisplayAlert("Checkin", "Bạn có muốn bắt đầu ca làm việc ngay lúc này!", "Yes", "No"); if (answer == true) { PopUpDialog.ShowDialog(); PopUpDialog.IsVisible = true; try { var hasPermission = await Utils.CheckPermissions(Permission.Location); if (!hasPermission) { Debug.WriteLine("hasPermission---------------------------------------------"); PopUpDialog.HideDialog(); PopUpDialog.IsVisible = false; return; } var position = await ContentGlobal.getLocation(); if (position == null) { PopUpDialog.HideDialog(); PopUpDialog.IsVisible = false; await DisplayAlert("Thông báo", "Không thể xác định vị trí lúc này, thử lại sau!", "OK"); return; } Debug.WriteLine("Position Status: Latitude ------------------------------------------" + position.Latitude); Debug.WriteLine("Position Status: Longitude ------------------------------------------" + position.Longitude); //await DisplayAlert("Location", string.Format("Latitude :{0} \nLongitude:{1}", position.Latitude, position.Longitude), "OK"); var strLatitude = position.Latitude.ToString().Replace(",", "."); var strLongitude = position.Longitude.ToString().Replace(",", "."); var device_id = CrossDeviceInfo.Current.Id; string strSubFirebase = "CheckOdooByApp"; string strParam = @"{""uid"":""" + Application.Current.Properties["uId"].ToString() + @""",""location"":""" + strLatitude + @"," + strLongitude + @""",""device_id"":""" + device_id + @"""}"; Debug.WriteLine("strParam CheckOdooByApp-------------------------------------------------- " + strParam); var data = await ContentGlobal.FirebasePOSTFunctions(strSubFirebase, strParam); if ((string)data["return"] == "OK") { ContentGlobal.allldata = await ContentGlobal.GetAllOfPersonal(); OnAppearing(); PopUpDialog.HideDialog(); PopUpDialog.IsVisible = false; await DisplayAlert("Thông báo", "Bạn đã bắt đầu ca làm việc", "OK"); /*boolAnimation = true; * int totalminute = 12 * 60; * await imgRound.RotateTo(360 * totalminute, (uint)totalminute * 36000);*/ } else { PopUpDialog.HideDialog(); PopUpDialog.IsVisible = false; await DisplayAlert("Thông báo", "Không thể thực hiện tác vụ này, xin thử lại sau!", "OK"); } } catch (Exception ex) { PopUpDialog.HideDialog(); PopUpDialog.IsVisible = false; Debug.WriteLine("Error start Circle" + ex.ToString()); await DisplayAlert("Thông báo", "Có lỗi sảy ra, kiểm tra lại kết nối mạng hoặc cài đặt vị trí của bạn và thử lại sau !", "OK"); } } //} } else { //await DisplayAlert("Info", await takeImageAsync(), "OK"); var answer = await DisplayAlert("Checkout", "Bạn có muốn kết thúc làm việc ngay lúc này!", "Yes", "No"); if (answer == true) { try { PopUpDialog.ShowDialog(); PopUpDialog.IsVisible = true; var hasPermission = await Utils.CheckPermissions(Permission.Location); if (!hasPermission) { PopUpDialog.HideDialog(); PopUpDialog.IsVisible = false; Debug.WriteLine("hasPermission---------------------------------------------"); return; } var position = await ContentGlobal.getLocation(); if (position == null) { PopUpDialog.HideDialog(); PopUpDialog.IsVisible = false; await DisplayAlert("Thông báo", "Không thể xác định vị trí lúc này, thử lại sau!", "OK"); return; } Debug.WriteLine("Position Status: Latitude ------------------------------------------" + position.Latitude); Debug.WriteLine("Position Status: Longitude ------------------------------------------" + position.Longitude); //await DisplayAlert("Location", string.Format("Latitude :{0} \n Longitude:{1}", position.Latitude, position.Longitude), "OK"); var strLatitude = position.Latitude.ToString().Replace(",", "."); var strLongitude = position.Longitude.ToString().Replace(",", "."); var device_id = CrossDeviceInfo.Current.Id; string strSubFirebase = "CheckOdooByApp"; string strParam = @"{""uid"":""" + Application.Current.Properties["uId"].ToString() + @""",""location"":""" + strLatitude + @"," + strLongitude + @""",""device_id"":""" + device_id + @"""}"; Debug.WriteLine("strParam CheckOdooByApp-------------------------------------------------- " + strParam); var data = await ContentGlobal.FirebasePOSTFunctions(strSubFirebase, strParam); if ((string)data["return"] == "OK") { ContentGlobal.allldata = await ContentGlobal.GetAllOfPersonal(); OnAppearing(); PopUpDialog.HideDialog(); PopUpDialog.IsVisible = false; await DisplayAlert("Thông báo", "Bạn đã kết thúc ca làm việc", "OK"); /*ViewExtensions.CancelAnimations(imgRound); * boolAnimation = false;*/ } else { PopUpDialog.HideDialog(); PopUpDialog.IsVisible = false; await DisplayAlert("Thông báo", "Không thể thực hiện tác vụ này, xin thử lại sau!", "OK"); } } catch (Exception ex) { PopUpDialog.HideDialog(); PopUpDialog.IsVisible = false; Debug.WriteLine("Error stop Circle" + ex.ToString()); await DisplayAlert("Thông báo", "Có lỗi sảy ra, kiểm tra lại kết nối mạng hoặc cài đặt vị trí của bạn và thử lại sau !", "OK"); } } } }; imgCircle.GestureRecognizers.Add(tapImgCircle); //lbDateOfToday.GestureRecognizers.Add(tapImgCircle); //lbTimeIn.GestureRecognizers.Add(tapImgCircle); imgRound.GestureRecognizers.Add(tapImgCircle); lbTimeIn.GestureRecognizers.Add(tapImgCircle); lbTimework.GestureRecognizers.Add(tapImgCircle); stkTimeIn.GestureRecognizers.Add(tapImgCircle); stkTimework.GestureRecognizers.Add(tapImgCircle); }