public GetTarProgCommand(TariffProgramType programType, int monthNumber, byte zeroBasedStartPointNumber,
                          byte pointsCount)
 {
     _programType = programType;
     _monthNumber = monthNumber;
     if (zeroBasedStartPointNumber > 15)
     {
         throw new Exception("Point number must be less than 16");
     }
     if (pointsCount < 1 || pointsCount > 6)
     {
         throw new Exception("Points count must be between 1 and 6 (including 1 and 6)");
     }
     _zeroBasedStartPointNumber = zeroBasedStartPointNumber;
     _pointsCount = pointsCount;
 }
        public static string GetDescription(this TariffProgramType tp)
        {
            switch (tp)
            {
            case TariffProgramType.Workday:
                return("������� ����");

            case TariffProgramType.SpecialDay:
                return("������ ����");

            case TariffProgramType.Saturday:
                return("��������� ����");

            case TariffProgramType.Sunday:
                return("���������� ����");
            }

            throw new Exception("Cannot get description");
        }
        public SetSpecialDayRecordCommand(byte zeroBasedRecordNumber, byte dayNumber, byte monthNumber,
                                          TariffProgramType tariffProgram)
        {
            if (zeroBasedRecordNumber > 31)
            {
                throw new IndexOutOfRangeException("Record number must be less than 32 (0..31)");
            }

            _zeroBasedRecordNumber = zeroBasedRecordNumber;

            /*if (dayNumber > 0 && monthNumber > 0)
             * {
             * _dayNumber = (byte) (dayNumber + 48);
             * _monthNumber = (byte) (monthNumber + 48);
             * }
             * else
             * {
             * _dayNumber = 0;
             * _monthNumber = 0;
             * }*/
            _dayNumber     = dayNumber.BinaryToBcd();
            _monthNumber   = monthNumber.BinaryToBcd();
            _tariffProgram = tariffProgram;
        }
 public GetSpecialDayRecordResult(int day, int month, TariffProgramType program)
 {
     Day     = day;
     Month   = month;
     Program = program;
 }