Exemplo n.º 1
0
 private static string getDayType(int i_Day)
 {
     if (i_Day == 5 || i_Day == 6)
     {
         return(DayTypeFactory.Get(eDayType.Holiday));
     }
     return(DayTypeFactory.Get(eDayType.WorkDay));
 }
Exemplo n.º 2
0
 public DayData(string i_MonthDay, string i_WeekDay, string i_DayType)
 {
     m_MonthDay = i_MonthDay;
     m_WeekDay = i_WeekDay;
     m_DayType = DayTypeFactory.Get(i_DayType);
     m_ArrivalTime = new TimeData();
     m_LeavingTime = new TimeData();
 }
Exemplo n.º 3
0
        private void setDayTypeBoxValues()
        {
            Array values = Enum.GetValues(typeof(eDayType));

            foreach (eDayType val in values)
            {
                DayTypeBox.Items.Add(DayTypeFactory.Get(val));
            }
        }
Exemplo n.º 4
0
 public DayData(string allData)
 {
     string[] sllDataArr = allData.Split(sr_Seperator);
     m_MonthDay = setMonthDay(sllDataArr[(int)eColumn.MonthDay]);
     m_WeekDay = sllDataArr[(int)eColumn.WeekDay];
     m_ArrivalTime = new TimeData(sllDataArr[(int)eColumn.Arrival]);
     m_LeavingTime = new TimeData(sllDataArr[(int)eColumn.Leaving]);
     m_DayType = DayTypeFactory.Get(sllDataArr[(int)eColumn.DayType]);
     m_Comment = sllDataArr[(int)eColumn.Comment];
 }
Exemplo n.º 5
0
 public static Color setDayTypeCell(string cellData)
 {
     if (cellData == DayTypeFactory.Get(eDayType.Holiday))
     {
         return(Color.DeepSkyBlue);
     }
     if (cellData == DayTypeFactory.Get(eDayType.HalfDay))
     {
         return(Color.CornflowerBlue);
     }
     return(Form.DefaultBackColor);
 }
Exemplo n.º 6
0
        private Color setDayTypeCellColor(string i_RowData)
        {
            if (DayTypeFactory.Get(eDayType.Holiday) == i_RowData)
            {
                return(Color.Chartreuse);
            }
            if (DayTypeFactory.Get(eDayType.HalfWorkDay) == i_RowData)
            {
                return(Color.Yellow);
            }
            if (DayTypeFactory.Get(eDayType.PersonalVacation) == i_RowData)
            {
                return(Color.Cyan);
            }
            if (DayTypeFactory.Get(eDayType.SickDay) == i_RowData)
            {
                return(Color.Coral);
            }

            return(Color.White);
        }
Exemplo n.º 7
0
        private void daysGridView_CellContentClick(object i_Sender, DataGridViewCellEventArgs i_E)
        {
            int    day = i_E.RowIndex;
            string msg;

            if (day < 0 || i_E.ColumnIndex < 0)
            {
                return;
            }

            switch ((eColumn)i_E.ColumnIndex)
            {
            case eColumn.Comment:
                msg = (string)monthGridView.Rows[day].Cells[(int)eColumn.Comment].Value;
                msg = new GetCommentForm(msg).ShowDialog();
                if (msg != null)
                {
                    m_TimeWatch.AllDays[day].Comment = msg;
                }
                return;

            case eColumn.Arrival:
            case eColumn.Leaving:
                ArrivalOrLeavingPressed(i_E, day);
                return;

            case eColumn.DayType:
                string chosneDayType = (string)monthGridView.Rows[day].Cells[i_E.ColumnIndex].Value;
                msg = new GetDayTypeWindowForm(chosneDayType).ShowDialog();
                if (!string.IsNullOrEmpty(msg))
                {
                    m_TimeWatch.AllDays[day].DayType = DayTypeFactory.Get(msg);
                }
                return;
            }
        }
Exemplo n.º 8
0
 public void setDayType(string i_DayTypeStr)
 {
     DayType = DayTypeFactory.Get(i_DayTypeStr);
     if (Changed != null) Changed.Invoke();
 }
Exemplo n.º 9
0
 public override string ToString()
 {
     return string.Format(m_RowFormat, MonthDay, WeekDay, ArrivalTime, LeavingTime, TotalHoursStr(), DayTypeFactory.Get(DayType), Comment, TimeWatch.sr_RowSeparatorStr);
 }