Ejemplo n.º 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;
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Default constructor
 /// </summary>
 public Time()
 {
     salary         = 0.0;
     overTimeSalary = 0.0;
     timeCalc       = new TimeCalculation();
     date           = DateTime.Now;
 }
Ejemplo n.º 3
0
        /// <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;
        }
Ejemplo n.º 4
0
        /// <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)));
 }
Ejemplo n.º 6
0
 /// <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);
 }