/// <summary> /// Функция просмотра сохраненных планов /// </summary> /// <param name="param"></param> private async void ViewPlans(object param) { IPlanLoader Plans = CommonServiceLocator.ServiceLocator.Current.GetInstance <IPlanLoader>(); var plans = await Plans.GetPlans(); //await Application.Current.MainPage.Navigation.PushAsync(new ViewPlansPage(plans)); ViewSaved(this, new ViewPlansEventArgs(plans)); }
/// <summary> /// Создание модели /// </summary> /// <param name="Client"></param> public GraphicPageViewModel(IClientModel Client, IPlanLoader PlanLoader) { ShowPlans = new Command(LoadPlans); SavePlans = new Command(SaveSelectedPlans); OpenSavedPlans = new Command(OpenSaved); this.Client = Client; this.Client.Session = Globals.Config.GetItem("Session").Result; this.Client.Server = Globals.Config.GetItem("Server").Result; this.PlanLoader = PlanLoader; StartDate = EndDate = DateTime.Parse(DateTime.Now.ToString("d")); }
private async void OpenSaved() { IPlanLoader planLoader = ServiceLocator.Current.GetInstance <IPlanLoader>(); var plans = await planLoader.GetPlans(); if (Globals.PlanTypes == null) { Globals.PlanTypes = new Dictionary <string, string>(); Globals.PlanTypes.Add("1", "Рабочий день"); Globals.PlanTypes.Add("2", "Выходной"); Globals.PlanTypes.Add("3", "Больничный"); Globals.PlanTypes.Add("4", "Отпуск"); } ViewPlans(this, new ViewPlansEventArgs(plans)); }
/// <summary> /// Функция очистки сохраненных планов /// </summary> /// <param name="param"></param> private async void ClearPlans(object param) { string title = "Потдтверждение"; string message = "Вы уверены, что хотите очистить сохраненные дни графика?"; string butAccept = "Да"; string butCancel = "Нет"; var res = await Application.Current.MainPage.DisplayAlert(title, message, butAccept, butCancel); if (res == true) { IPlanLoader Plans = CommonServiceLocator.ServiceLocator.Current.GetInstance <IPlanLoader>(); await Plans.ClearPlans(); } }