Example #1
0
        private string[] ExportToFileFormatTime(string[] scheduleArray) //форматирование строки в вид "9 17!"
        {
            string beginHour;
            string endHour;

            for (int i = 0; scheduleArray.Length > i; i++)
            {
                if (scheduleArray[i] == "Выходной") //если по расписанию выхожной
                {
                    scheduleArray[i] = "H";
                    continue;
                }
                scheduleArray[i] = scheduleArray[i].Replace(" - ", " ");

                beginHour = scheduleArray[i].Remove(scheduleArray[i].IndexOf(" "));
                endHour   = scheduleArray[i].Substring(scheduleArray[i].IndexOf(" ") + 1);

                beginHour = FormatLines.ShortFormatTime(beginHour);
                endHour   = FormatLines.ShortFormatTime(endHour);

                scheduleArray[i] = $"{beginHour} {endHour}";
            }

            return(scheduleArray);
        }
Example #2
0
        private void BtnAccept_Click(object sender, EventArgs e)
        {
            string sleepHrBegin   = FormatLines.ShortFormatTime(MTBSleepBegin.Text);
            string sleepHrEnd     = FormatLines.ShortFormatTime(MTBSleepEnd.Text);
            string motivHints     = ChBMotivHints.Checked == true ? "1" : "0";
            string closeGames     = ChBCloseGames.Checked == true ? "1" : "0";
            string hrsToCloseGame = TBHrsToStopGms.Text;

            FileManagement.FillCommonFile(TBGetStatsHrs.Text, TBFunHrsPerWeek.Text, sleepHrBegin, sleepHrEnd, TBHrsToRest.Text,     //обновление настроек
                                          TBHrsToWork.Text, motivHints, closeGames, hrsToCloseGame);

            BtnBack_Click(null, null);
        }