public async Task SaveJob()
 {
     if (SelectedJob != null)
     {
         await SelectedJob.Update();
     }
 }
 public async Task AssignTechnician()
 {
     if (SelectedJob != null && App.LoggedInUser.GetType() == typeof(Technician))
     {
         SelectedJob.Technician = LoggedInUser.Id;
         selectedJob.Started    = DateTime.Now;
         await SelectedJob.Update();
     }
 }
Ejemplo n.º 3
0
        public void FindContractor()
        {
            DataTable dt = SelectedJob.Find();


            contractorJobCollection.Clear();
            // MessageBox.Show(dt.Rows.Count.ToString());
            int i        = 0;
            int assigned = 0;

            IsContractorSelected = true;
            foreach (DataRow dr in dt.Rows)
            {
                if (i == 0)
                {
                    SelectedContractor = new ContractorJob(dr);
                }
                i++;
                // MessageBox.Show(dr[0].ToString());
                if (dr[0].ToString().Equals("Proposed") || dr[0].ToString().Equals("Accepted") || dr[0].ToString().Equals("Completed"))
                {
                    assigned++;
                    //   MessageBox.Show(IsContractorSelected.ToString());
                }


                //  Contractor contractor = new Contractor(dr);
                // MessageBox.Show(dr[0].ToString());
                if (!(dr[0].ToString().Equals("Rejected")))
                {
                    ContractorJob contractorjob = new ContractorJob(dr);
                    contractorJobCollection.Add(contractorjob);
                }
            }
            if (contractorJobCollection.Count == 0)
            {
                IsContractorSelected = false;
                MessageBox.Show("No contractor availiable!", "Find Contractor", MessageBoxButton.OK, MessageBoxImage.Information);
            }
            else
            {
                if (assigned == 0)
                {
                    IsContractorSelected = true;
                }
                else
                {
                    IsContractorSelected = false;
                }
            }


            //MessageBox.Show(IsContractorSelected.ToString());
        }
 public async Task DeleteJob()
 {
     if (SelectedJob != null)
     {
         if (await SelectedJob.Delete())
         {
             // Remove the entity from the local list
             Jobs.Remove(SelectedJob);
             SelectedJob = null;
         }
     }
     else
     {
         await new MessageDialog("Please select a job").ShowAsync();
     }
 }
Ejemplo n.º 5
0
        private void AssignContractor()
        {
            try
            {
                if (SelectedContractorJob.ContractorID == 0)
                {
                }
            }
            catch (Exception)
            {
                MessageBox.Show("Select contractor and then click on Assign", "Contractor not selected", MessageBoxButton.OK, MessageBoxImage.Error);
                return;
            }

            SelectedJob.Assign(SelectedContractorJob.ContractorID);
            SelectedJob.Status = "Acknowledged";
            FindContractor();
        }
        public async Task MarkCompleted()
        {
            if (SelectedJob != null)
            {
                //Mark for completion
                SelectedJob.Completed = true;
                //Set the finish time
                SelectedJob.Finished = DateTimeOffset.Now;
                //Update backend
                await SelectedJob.Update();

                //Remove from active job queue
                Jobs.Remove(SelectedJob);
                SelectedJob = null;
            }
            else
            {
                await new MessageDialog("Please select a job").ShowAsync();
            }
        }
Ejemplo n.º 7
0
 private void OnTestItem(object parameter)
 {
     SelectedJob.Execute();
 }
        public RuntimeProperties(ServiceConfigParameters ConfigParameters)
        {
            _ServiceConfigParameters = ConfigParameters;
            //personal
            _Staff_ID = new StaffID();
            _Full_Name = new FullName();
            _Country = new Country();
            _ContractType = new ContractType();
            _ContractTypeForReports = new ContractTypeForReports();
            _Position = new Position();
            _DateOfTREnd = new DateOfTREnd();
            _DateOfTRStart = new DateOfTRStart();
            _DateOfEntrance = new DateOfEntrance();
            _CalendarName = new CalendarName();
            _TemplateFilter = new TemplateFilter();
            _ArePropReadyPersonal = new ArePropReady();
            _BusinessUnitInfo = new BusinessUnitInfo();
            _PMSA = new PMSA();
            _PMSAItem = new PMSAItem();
            _Gender = new Gender();
            _ActivityCodeInfo = new ActivityCodeInfo();
            _OfficialLS = new OfficialLS();
            _PhoneDirOnly = new PhoneDirOnly();
            //update
            _SelectedDate = new SelectedDate();
            _SelectedDateStatus = new SelectedDateStatus();
            _SelectedDateTransactionStatus = new SelectedDateTransactionStatus();
            _SelectedDateType = new SelectedDateType();
            _SelectedDateisOptional = new SelectedDateisOptional();
            _PercentPerDay = new PercentPerDay();
            _SelectedJob = new SelectedJob();
            _MaxHoursDaily = new MaxHoursDaily();
            _ArePropReadyTRUpdate = new ArePropReady();
            _TRInputListClient = new TRInputListClient();
            _LastOpenDay = new LastOpenDay();

            //submit
            _SumOfHours = new SumOfHours();
            _TRInputList = new TRInputList();
            _WorkingHoursWeekly = new WorkingHoursWeekly();
            _MinHoursDaily = new MinHoursDaily();
            _FirstSubmitableDay = new FirstSubmitableDay();
            _SelectedActivityCode = new SelectedActivityCode();
            _Description = new Description();
            _Location = new Location();
            _BusinessUnit = new BusinessUnit();
            _ReasonCode = new ReasonCode();
            _ArePropReadyTRSubmit = new ArePropReady();
            _PeriodEnd = new PeriodEnd();
            //reports

            _PeriodStarting = new PeriodStarting();
            _ArePropReadyReports = new ArePropReady();
            _ReportIntervalFrom = new ReportIntervalFrom();
            _ReportIntervalTo = new ReportIntervalTo();
            _UserIDList = new UserIDList();
            _SelectedReportTemplate = new SelectedReportTemplate();
            _SelectedReportType = new SelectedReportType();

            //külön queryk-ben/Getparameters-ben kap értéket

            _LastSubmittedDay = new LastSubmittedDay();
            _JobCh = new JobCH();
            _InsertedHour = new InstertedHour();
            _ValidationConstraint = new ValidationConstraint();
            _JobFilter = new JobFilter();
            _ActivityCodeFilter = new ActivityCodeFilter();
            _UserGroup = new UserGroup();
            _ReasonCodeFilter = new ReasonCodeFilter();
        }