Beispiel #1
0
 /// <summary>
 /// Copy constructor
 /// </summary>
 /// <param name="otherTimeCalculation"></param>
 public TimeCalculation(TimeCalculation otherTimeCalculation)
 {
     this.userStartHours   = otherTimeCalculation.userStartHours;
     this.userStartMinutes = otherTimeCalculation.userStartMinutes;
     this.userEndHours     = otherTimeCalculation.userEndHours;
     this.userEndMinutes   = otherTimeCalculation.userEndMinutes;
 }
 /// <summary>
 /// Default constructor
 /// </summary>
 public Time()
 {
     salary         = 0.0;
     overTimeSalary = 0.0;
     timeCalc       = new TimeCalculation();
     date           = DateTime.Now;
 }
        /// <summary>
        /// Copy constructor
        /// </summary>
        /// <param name="theOther"></param>
        public Time(Time theOther)
        {
            this.date      = theOther.date;
            this.fixedTime = theOther.fixedTime;

            this.userSchedule   = theOther.userSchedule;
            this.salary         = theOther.salary;
            this.overTimeSalary = theOther.overTimeSalary;
            this.timeCalc       = theOther.timeCalc;
        }
        /// <summary>
        /// Reads change time info and validates
        /// </summary>
        /// <returns></returns>
        private bool ReadInputTime()
        {
            timeCalc          = new TimeCalculation();
            time.TimeCalcData = timeCalc;
            ReadAndValidateTime();

            string message;
            bool   ok = timeCalc.Validate(out message);

            if (ok)
            {
            }
            else
            {
                string strMessage = "Set/Change time is invalid";
                MessageBox.Show(strMessage, "Error");
            }
            return(ok);
        }
 /// <summary>
 /// Overloaded method to add Schedule
 /// </summary>
 /// <param name="date"></param>
 /// <param name="fixedTime"></param>
 /// <param name="userSchedule"></param>
 /// <param name="salary"></param>
 /// <param name="overTimeSalary"></param>
 /// <param name="timeCalc"></param>
 /// <returns></returns>
 public bool AddSchedule(DateTime date, string fixedTime, int userSchedule, double salary, double overTimeSalary, TimeCalculation timeCalc)
 {
     return(AddSchedule(new Time(date, fixedTime, userSchedule, salary, overTimeSalary, timeCalc)));
 }
 /// <summary>
 /// Constructor with parameters
 /// </summary>
 /// <param name="date"></param>
 /// <param name="fixedTime"></param>
 /// <param name="userSchedule"></param>
 /// <param name="salary"></param>
 /// <param name="overTimeSalary"></param>
 /// <param name="timeCalc"></param>
 public Time(DateTime date, string fixedTime, int userSchedule,
             double salary, double overTimeSalary, TimeCalculation timeCalc)
 {
     this.timeCalc = new TimeCalculation(timeCalc);
 }