public oldServiceDayModel(oldServiceDayModel backupDay, oldServiceSubmissionModel serviceBackup)
 {
     pauseUpdates = true;
     DtServiceDay = backupDay.DtServiceDay;
     TravelStartTime = backupDay.TravelStartTime;
     ArrivalOnsiteTime = backupDay.ArrivalOnsiteTime;
     DepartSiteTime = backupDay.DepartSiteTime;
     TravelEndTime = backupDay.TravelEndTime;
     Mileage = backupDay.Mileage;
     DailyAllowance = backupDay.DailyAllowance;
     OvernightAllowance = backupDay.OvernightAllowance;
     BarrierPayment = backupDay.BarrierPayment;
     TravelTimeToSite = backupDay.TravelTimeToSite;
     TravelTimeFromSite = backupDay.TravelTimeFromSite;
     TotalTravelTime = backupDay.TotalTravelTime;
     TotalTimeOnsite = backupDay.TotalTimeOnsite;
     DailyReport = backupDay.DailyReport;
     PartsSupplied = backupDay.PartsSupplied;
     CurrentServiceSubmission = serviceBackup;
     pauseUpdates = false;
 }
        public static oldServiceDayModel backupServiceDay(oldServiceDayModel masterServiceDay, oldServiceSubmissionModel backupServiceDay)
        {
            oldServiceDayModel backupData = new oldServiceDayModel(backupServiceDay);
            backupData.DtServiceDay = masterServiceDay.DtServiceDay;
            backupData.TravelStartTime = masterServiceDay.TravelStartTime;
            backupData.ArrivalOnsiteTime = masterServiceDay.ArrivalOnsiteTime;
            backupData.DepartSiteTime = masterServiceDay.DepartSiteTime;
            backupData.TravelEndTime = masterServiceDay.TravelEndTime;
            backupData.Mileage = masterServiceDay.Mileage;
            backupData.DailyAllowance = masterServiceDay.DailyAllowance;
            backupData.OvernightAllowance = masterServiceDay.OvernightAllowance;
            backupData.BarrierPayment = masterServiceDay.BarrierPayment;
            backupData.TravelTimeToSite = masterServiceDay.TravelTimeToSite;
            backupData.TravelTimeFromSite = masterServiceDay.TravelTimeFromSite;
            backupData.TotalTravelTime = masterServiceDay.TotalTravelTime;
            backupData.TotalTimeOnsite = masterServiceDay.TotalTimeOnsite;
            backupData.DailyReport = masterServiceDay.DailyReport;
            backupData.PartsSupplied = masterServiceDay.PartsSupplied;
            backupData.CurrentServiceSubmission = backupServiceDay;

            return backupData;
    }
        public static oldServiceSubmissionModel backupSubmission(oldServiceSubmissionModel masterSubmission)
        {
            oldServiceSubmissionModel backupSubmission = new oldServiceSubmissionModel();
            backupSubmission.SubmissionNo = masterSubmission.SubmissionNo;
            backupSubmission.SubmissionVersion = masterSubmission.SubmissionVersion;
            backupSubmission.Username = masterSubmission.Username;
            backupSubmission.UserFirstName = masterSubmission.UserFirstName;
            backupSubmission.UserSurname = masterSubmission.UserSurname;
            backupSubmission.Customer = masterSubmission.Customer;
            backupSubmission.Address1 = masterSubmission.Address1;
            backupSubmission.Address2 = masterSubmission.Address2;
            backupSubmission.TownCity = masterSubmission.TownCity;
            backupSubmission.Postcode = masterSubmission.Postcode;
            backupSubmission.CustomerContact = masterSubmission.CustomerContact;
            backupSubmission.CustomerPhone = masterSubmission.CustomerPhone;
            backupSubmission.MachineMakeModel = masterSubmission.MachineMakeModel;
            backupSubmission.MachineSerial = masterSubmission.MachineSerial;
            backupSubmission.MachineController = masterSubmission.MachineController;
            backupSubmission.JobStart = masterSubmission.JobStart;
            backupSubmission.CustomerOrderNo = masterSubmission.CustomerOrderNo;
            backupSubmission.MttJobNumber = masterSubmission.MttJobNumber;
            backupSubmission.JobDescription = masterSubmission.JobDescription;
            backupSubmission.TotalTimeOnsite = masterSubmission.TotalTimeOnsite;
            backupSubmission.TotalTravelTime = masterSubmission.TotalTravelTime;
            backupSubmission.TotalMileage = masterSubmission.TotalMileage;
            backupSubmission.TotalDailyAllowances = masterSubmission.TotalDailyAllowances;
            backupSubmission.TotalOvernightAllowances = masterSubmission.TotalOvernightAllowances;
            backupSubmission.TotalBarrierPayments = masterSubmission.TotalBarrierPayments;
            backupSubmission.JobStatus = masterSubmission.JobStatus;
            backupSubmission.FinalJobReport = masterSubmission.FinalJobReport;
            backupSubmission.AdditionalFaultsFound = masterSubmission.AdditionalFaultsFound;
            backupSubmission.QuoteRequired = masterSubmission.QuoteRequired;
            backupSubmission.PartsForFollowup = masterSubmission.PartsForFollowup;
            backupSubmission.Image1Url = masterSubmission.Image1Url;
            backupSubmission.Image2Url = masterSubmission.Image2Url;
            backupSubmission.Image3Url = masterSubmission.Image3Url;
            backupSubmission.Image4Url = masterSubmission.Image4Url;
            backupSubmission.Image5Url = masterSubmission.Image5Url;
            backupSubmission.CustomerSignatureUrl = masterSubmission.CustomerSignatureUrl;
            backupSubmission.CustomerSignName = masterSubmission.CustomerSignName;
            backupSubmission.DtSigned = masterSubmission.DtSigned;
            backupSubmission.MttEngSignatureUrl = masterSubmission.MttEngSignatureUrl;
            
            backupSubmission.MttEngineerSignature = masterSubmission.MttEngineerSignature;
            backupSubmission.CustomerSignature = masterSubmission.CustomerSignature;
            backupSubmission.Image1 = masterSubmission.Image1;
            backupSubmission.Image2 = masterSubmission.Image2;
            backupSubmission.Image3 = masterSubmission.Image3;
            backupSubmission.Image4 = masterSubmission.Image4;
            backupSubmission.Image5 = masterSubmission.Image5;
            backupSubmission.Approved = masterSubmission.Approved;
            backupSubmission.ResponseId = masterSubmission.ResponseId;
            backupSubmission.DtResponse = masterSubmission.DtResponse;
            backupSubmission.DtDevice = masterSubmission.DtDevice;

            ObservableCollection<oldServiceDayModel> backupServiceDays = new ObservableCollection<oldServiceDayModel>();
            
            foreach (oldServiceDayModel masterServiceDay in masterSubmission.ServiceTimesheets)
            {
                oldServiceDayModel backupServiceDay = oldServiceDayModel.backupServiceDay(masterServiceDay, backupSubmission);
                backupServiceDays.Add(backupServiceDay);
            }

            backupSubmission.ServiceTimesheets = backupServiceDays;

            return backupSubmission;
        }
 public void EndEdit()
 {
     if (!editMode)
     {
         return;
     }
     m_backupData = new oldServiceSubmissionModel();
     //RT 25/7/16 - set the edit mode to fault
     EditMode = false;
 }
 //RT allowing the user to cancel the changes
 public void BeginEdit()
 {
     if (editMode)
     {
         Console.WriteLine("Warning - Already in edit mode");
     }
     m_backupData = oldServiceSubmissionModel.backupSubmission(this);
     //RT 25/7/16 - When we start the edit, set the edit flag
     EditMode = true;
 }
 public oldServiceDayModel(oldServiceSubmissionModel currentSubmission)
 {
     CurrentServiceSubmission = currentSubmission;
 }