Exemple #1
0
        public Edit(int day)
        {
            InitializeComponent();

            var      activityRepo = new ActivitiesRepository();
            MainForm md           = new MainForm();

            labelMonth.Text = md.GetMonthName();
            //labelDayedit.Text = "Dia : " + day;
            textBoxHour.MaxLength = 3;
            Day = day;
            int tempoDispTotalMinutos = 24 * 60 - activityRepo.GetAvailableTime(Day, DateTime.Now.Month);
            int tempoDispHoras        = tempoDispTotalMinutos / 60;
            int tempoDispMinutos      = tempoDispTotalMinutos % 60;

            string tempoText = tempoDispHoras.ToString() + "h";

            if (tempoDispMinutos > 0)
            {
                tempoText += " " + tempoDispMinutos + "m";
            }
            labelSchedule.Text = tempoText;
        }