コード例 #1
0
        private void deleteTrainingDay()
        {
            TrainingDayDTO day = SelectedTrainingDay;

            if (!ReadOnly && day != null && DomainObjectOperatonHelper.DeleteTrainingDay(UserContext.SessionData, day))
            {
                monthCalendar1.RemoveDateInfo(day.TrainingDate);
            }
        }
コード例 #2
0
        private void deleteTrainingDay()
        {
            TrainingDayDTO day = SelectedTrainingDay;

            if (!ReadOnly && day != null && DomainObjectOperatonHelper.DeleteTrainingDay(day, GetDayInfo(day.TrainingDate)))
            {
                //entriesViewer.CalendarControl.RemoveDateInfo(day.TrainingDate);
            }
        }
コード例 #3
0
 private void tsbDeleteTrainingDay_Click(object sender, EventArgs e)
 {
     if (DomainObjectOperatonHelper.DeleteTrainingDay(UserContext.SessionData, day))
     {
         dayRemoved = true;
         XtraForm parentForm = ControlHelper.GetParentControl <XtraForm>(this);
         parentForm.DialogResult = DialogResult.OK;
         parentForm.Close();
     }
 }
コード例 #4
0
        private void openTrainingDay(DateTime selectedDate)
        {
            if (!isFilled || UserContext.Current.LoginStatus != LoginStatus.Logged /*|| IsSelectedDateFuture*/)
            {
                return;
            }

            if (IsSelectedDateFuture && !UIHelper.EnsurePremiumLicence())
            {
                return;
            }

            var day = new TrainingDayDTO(selectedDate, UserContext.Current.CurrentProfile.GlobalId);

            if (Customer != null)
            {
                day.CustomerId = Customer.GlobalId;
            }
            var info = entriesViewer.CalendarControl.GetDateInfo(selectedDate);

            if (info.Count > 0)
            {
                day = (TrainingDayDTO)info[0].Tag;
            }
            else if (ReadOnly)
            {
                return;
            }
            var dayInfo = GetDayInfo(day.TrainingDate);

            if (dayInfo != null)
            {
                dayInfo.IsProcessing = true;
            }
            //MainWindow.Instance.ShowView(delegate
            //    {
            //        var view= DomainObjectOperatonHelper.CreateTrainingDayWindow(day, User, Customer, null);
            //        if (dayInfo != null)
            //        {
            //            dayInfo.IsProcessing = false;
            //        }
            //        return view;
            //    });


            MainWindow.Instance.ShowPage(new Uri("pack://application:,,,/BodyArchitect.Client.UI;component/Windows/TrainingDayWindow.xaml"), () =>
            {
                var view = DomainObjectOperatonHelper.CreateTrainingDayWindow(day, User, Customer, null);
                if (dayInfo != null)
                {
                    dayInfo.IsProcessing = false;
                }
                return(view);
            });
            //MainWindow.Instance.ShowPage(delegate
            //{
            //    var view = DomainObjectOperatonHelper.CreateTrainingDayWindow(day, User, Customer, null);
            //    if (dayInfo != null)
            //    {
            //        dayInfo.IsProcessing = false;
            //    }
            //    return view;
            //});
        }