private void LoadDetailedData(int serviceId) { ServiceInformationBasicInformationGateway serviceInformationBasicInformationGateway = new ServiceInformationBasicInformationGateway(serviceInformationTDS); if (serviceInformationBasicInformationGateway.Table.Rows.Count > 0) { // Load for General Tab tbxGeneralCreatedBy.Text = serviceInformationBasicInformationGateway.GetCreatedBy(serviceId); tbxGeneralMileage.Text = serviceInformationBasicInformationGateway.GetMileage(serviceId); lblGeneralMileageUnitOfMeasurement.Text = serviceInformationBasicInformationGateway.GetMileageUnitOfMeasurement(serviceId); // Load for Assginment Tab LoadDetailaDataAssignmentData(serviceId, serviceInformationBasicInformationGateway); // Load for Start Work Tab LoadDetailaDataStartWork(serviceId, serviceInformationBasicInformationGateway); // Load for Complete Work Tab LoadDetailaDataCompleteWork(serviceId, serviceInformationBasicInformationGateway); } }
private void LoadDetailaDataCompleteWork(int serviceId, ServiceInformationBasicInformationGateway serviceInformationBasicInformationGateway) { // Load for CompleteWork Tab // ... pnlCompleteWork tbxCompleteWorkDataCompleteWorkDateTime.Text = serviceInformationBasicInformationGateway.GetCompleteWorkDateTime(serviceId).ToString(); if (serviceInformationBasicInformationGateway.GetUnitBackInServiceDate(serviceId).HasValue) { DateTime backInServiceDate = (DateTime)serviceInformationBasicInformationGateway.GetUnitBackInServiceDate(serviceId); tkrdpCompleteWorkDataUnitBackInServiceDate.SelectedDate = DateTime.Parse(backInServiceDate.Month.ToString() + "/" + backInServiceDate.Day.ToString() + "/" + backInServiceDate.Year.ToString()); } tbxCompleteWorkDataCompleteMileage.Text = serviceInformationBasicInformationGateway.GetCompleteWorkMileage(serviceId); lblCompleteWorkDataMileageUnitOfMeasurement.Text = serviceInformationBasicInformationGateway.GetMileageUnitOfMeasurement(serviceId); lblCompleteWorkDataMileageUnitOfMeasurementReadOnly.Text = serviceInformationBasicInformationGateway.GetMileageUnitOfMeasurement(serviceId); // ... For team member tbxCompleteWorkDataDescription.Text = serviceInformationBasicInformationGateway.GetCompleteWorkDetailDescription(serviceId); ckbxCompleteWorkDataPreventable.Checked = serviceInformationBasicInformationGateway.GetCompleteWorkDetailPreventable(serviceId); tbxCompleteWorkDataLabourHours.Text = serviceInformationBasicInformationGateway.GetCompleteWorkDetailTMLabourHours(serviceId).ToString(); // ... For third party vendor tbxCompleteWorkDataDescriptionThirdPartyVendor.Text = serviceInformationBasicInformationGateway.GetCompleteWorkDetailDescription(serviceId); ckbxCompleteWorkDataPreventableThirdPartyVendor.Checked = serviceInformationBasicInformationGateway.GetCompleteWorkDetailPreventable(serviceId); tbxCompleteWorkDataInvoiceNumberThirdPartyVendor.Text = serviceInformationBasicInformationGateway.GetCompleteWorkDetailTPVInvoiceNumber(serviceId); tbxCompleteWorkDataInvoiceAmountThirdPartyVendor.Text = serviceInformationBasicInformationGateway.GetCompleteWorkDetailTPVInvoiceAmout(serviceId).ToString(); // ... PnlCompleteWorkReadOnly tbxCompleteWorkDataCompleteWorkDateTimeReadOnly.Text = serviceInformationBasicInformationGateway.GetCompleteWorkDateTime(serviceId).ToString(); tbxCompleteWorkDataUnitBackInServiceDateReadOnly.Text = ""; if (serviceInformationBasicInformationGateway.GetUnitBackInServiceDate(serviceId).HasValue) { DateTime backInServiceDate = (DateTime)serviceInformationBasicInformationGateway.GetUnitBackInServiceDate(serviceId); tbxCompleteWorkDataUnitBackInServiceDateReadOnly.Text = backInServiceDate.Month.ToString() + "/" + backInServiceDate.Day.ToString() + "/" + backInServiceDate.Year.ToString(); } tbxCompleteWorkDataCompleteMileageReadOnly.Text = serviceInformationBasicInformationGateway.GetCompleteWorkMileage(serviceId); // ... For team member tbxCompleteWorkDataDescriptionReadOnly.Text = serviceInformationBasicInformationGateway.GetCompleteWorkDetailDescription(serviceId); ckbxCompleteWorkDataPreventableReadOnly.Checked = serviceInformationBasicInformationGateway.GetCompleteWorkDetailPreventable(serviceId); tbxCompleteWorkDataLabourHoursReadOnly.Text = serviceInformationBasicInformationGateway.GetCompleteWorkDetailTMLabourHours(serviceId).ToString(); // ... For third party vendor tbxCompleteWorkDataDescriptionThirdPartyVendorReadOnly.Text = serviceInformationBasicInformationGateway.GetCompleteWorkDetailDescription(serviceId); ckbxCompleteWorkDataPreventableThirdPartyVendorReadOnly.Checked = serviceInformationBasicInformationGateway.GetCompleteWorkDetailPreventable(serviceId); tbxCompleteWorkDataInvoiceNumberThirdPartyVendorReadOnly.Text = serviceInformationBasicInformationGateway.GetCompleteWorkDetailTPVInvoiceNumber(serviceId); tbxCompleteWorkDataInvoiceAmountThirdPartyVendorReadOnly.Text = serviceInformationBasicInformationGateway.GetCompleteWorkDetailTPVInvoiceAmout(serviceId).ToString(); }
private void LoadDetailaDataStartWork(int serviceId, ServiceInformationBasicInformationGateway serviceInformationBasicInformationGateway) { // Load for StartWork Tab // ... pnlStartWork tbxStartWorkDataWorkStartDateTime.Text = serviceInformationBasicInformationGateway.GetStartWorkDateTime(serviceId).ToString(); if (serviceInformationBasicInformationGateway.GetUnitOutOfServiceDate(serviceId).HasValue) { DateTime outOfServiceDate = (DateTime)serviceInformationBasicInformationGateway.GetUnitOutOfServiceDate(serviceId); tkrdpStartWorkDataUnitOutOfServiceDate.SelectedDate = DateTime.Parse(outOfServiceDate.Month.ToString() + "/" + outOfServiceDate.Day.ToString() + "/" + outOfServiceDate.Year.ToString()); } tbxStartWorkDataStartMileage.Text = serviceInformationBasicInformationGateway.GetStartWorkMileage(serviceId); lblStartWorkDataMileageUnitOfMeasurement.Text = serviceInformationBasicInformationGateway.GetMileageUnitOfMeasurement(serviceId); lblStartWorkDataMileageUnitOfMeasurementReadOnly.Text = serviceInformationBasicInformationGateway.GetMileageUnitOfMeasurement(serviceId); // ... pnlStartWorkReadOnly tbxStartWorkDataStartWorkDateTimeReadOnly.Text = serviceInformationBasicInformationGateway.GetStartWorkDateTime(serviceId).ToString(); tbxStartWorkDataUnitOutOfServiceDateReadOnly.Text = ""; if (serviceInformationBasicInformationGateway.GetUnitOutOfServiceDate(serviceId).HasValue) { DateTime outOfServiceDate = (DateTime)serviceInformationBasicInformationGateway.GetUnitOutOfServiceDate(serviceId); tbxStartWorkDataUnitOutOfServiceDateReadOnly.Text = outOfServiceDate.Month.ToString() + "/" + outOfServiceDate.Day.ToString() + "/" + outOfServiceDate.Year.ToString(); } tbxStartWorkDataStartMileageReadOnly.Text = serviceInformationBasicInformationGateway.GetStartWorkMileage(serviceId); }
private void LoadDetailedData(int serviceId) { ServiceInformationBasicInformationGateway serviceInformationBasicInformationGateway = new ServiceInformationBasicInformationGateway(serviceInformationTDS); if (serviceInformationBasicInformationGateway.Table.Rows.Count > 0) { // Load for General Tab tbxGeneralCreatedBy.Text = serviceInformationBasicInformationGateway.GetCreatedBy(serviceId); tbxGeneralMileage.Text = serviceInformationBasicInformationGateway.GetMileage(serviceId); lblGeneralMileageUnitOfMeasurement.Text = serviceInformationBasicInformationGateway.GetMileageUnitOfMeasurement(serviceId); // Load for Assginment Tab tbxAssignmentDataAssignmentDateTime.Text = serviceInformationBasicInformationGateway.GetAssignmentDateTime(serviceId).ToString(); tbxAssignmentDataAssignedDeadlineDate.Text = ""; if (serviceInformationBasicInformationGateway.GetAssignedDeadlineDate(serviceId).HasValue) { DateTime deadlineDate = (DateTime)serviceInformationBasicInformationGateway.GetAssignedDeadlineDate(serviceId); tbxAssignmentDataAssignedDeadlineDate.Text = deadlineDate.Month.ToString() + "/" + deadlineDate.Day.ToString() + "/" + deadlineDate.Year.ToString(); } if ((serviceInformationBasicInformationGateway.GetToTeamMember(serviceId)) && (serviceInformationBasicInformationGateway.GetAssignedThirdPartyVendor(serviceId)) == "") { // ... For team member rbtnAssignmentDataToTeamMember.Checked = true; if (serviceInformationBasicInformationGateway.GetAssignTeamMemberId(serviceId).HasValue) { int teamMemberId = (int)serviceInformationBasicInformationGateway.GetAssignTeamMemberId(serviceId); EmployeeGateway employeeGateway = new EmployeeGateway(); employeeGateway.LoadByEmployeeId(teamMemberId); tbxAssigmentDataToTeamMemberName.Text = employeeGateway.GetLastName(teamMemberId) + " " + employeeGateway.GetFirstName(teamMemberId); } // ... For third party vendor rbtnAssignmentDataToThirdPartyVendor.Checked = false; } else { if ((!serviceInformationBasicInformationGateway.GetToTeamMember(serviceId)) && (serviceInformationBasicInformationGateway.GetAssignedThirdPartyVendor(serviceId)) != "") { // ... For team member rbtnAssignmentDataToTeamMember.Checked = false; // ... For third party vendor rbtnAssignmentDataToThirdPartyVendor.Checked = true; tbxAssignmentDataAssignToThirdPartyVendor.Text = serviceInformationBasicInformationGateway.GetAssignedThirdPartyVendor(serviceId); } else { rbtnAssignmentDataToTeamMember.Checked = false; rbtnAssignmentDataToThirdPartyVendor.Checked = false; } } tbxAssignmentDataAcceptedDateTime.Text = serviceInformationBasicInformationGateway.GetAcceptedDateTime(serviceId).ToString(); DateTime? acceptedDateTime = serviceInformationBasicInformationGateway.GetAcceptedDateTime(serviceId); if (acceptedDateTime.HasValue) tbxAssignmentDataAcceptedDateTime.Text = acceptedDateTime.ToString(); DateTime? rejectedDateTime = serviceInformationBasicInformationGateway.GetRejectedDateTime(serviceId); if (rejectedDateTime.HasValue) tbxAssignmentDataRejectedDateTime.Text = rejectedDateTime.ToString(); tbxAssignmentDataRejectedReason.Text = serviceInformationBasicInformationGateway.GetRejectedReason(serviceId); // Load for StartWork Tab tbxStartWorkDataWorkStartDateTime.Text = serviceInformationBasicInformationGateway.GetStartWorkDateTime(serviceId).ToString(); tbxStartWorkDataUnitOutOfServiceDate.Text = ""; if (serviceInformationBasicInformationGateway.GetUnitOutOfServiceDate(serviceId).HasValue) { DateTime outOfServiceDate = (DateTime)serviceInformationBasicInformationGateway.GetUnitOutOfServiceDate(serviceId); tbxStartWorkDataUnitOutOfServiceDate.Text = outOfServiceDate.Month.ToString() + "/" + outOfServiceDate.Day.ToString() + "/" + outOfServiceDate.Year.ToString(); } tbxStartWorkDataStartMileage.Text = serviceInformationBasicInformationGateway.GetStartWorkMileage(serviceId); lblStartWorkDataMileageUnitOfMeasurement.Text = serviceInformationBasicInformationGateway.GetMileageUnitOfMeasurement(serviceId); // Load for Complete Work Tab tbxCompleteWorkDataCompleteWorkDateTime.Text = serviceInformationBasicInformationGateway.GetCompleteWorkDateTime(serviceId).ToString(); tbxCompleteWorkDataUnitBackInServiceDate.Text = ""; if (serviceInformationBasicInformationGateway.GetUnitBackInServiceDate(serviceId).HasValue) { DateTime backInServiceDate = (DateTime)serviceInformationBasicInformationGateway.GetUnitBackInServiceDate(serviceId); tbxCompleteWorkDataUnitBackInServiceDate.Text = backInServiceDate.Month.ToString() + "/" + backInServiceDate.Day.ToString() + "/" + backInServiceDate.Year.ToString(); } tbxCompleteWorkDataCompleteMileage.Text = serviceInformationBasicInformationGateway.GetCompleteWorkMileage(serviceId); lblCompleteWorkDataMileageUnitOfMeasurement.Text = serviceInformationBasicInformationGateway.GetMileageUnitOfMeasurement(serviceId); // ... For team member tbxCompleteWorkDataDescription.Text = serviceInformationBasicInformationGateway.GetCompleteWorkDetailDescription(serviceId); ckbxCompleteWorkDataPreventable.Checked = serviceInformationBasicInformationGateway.GetCompleteWorkDetailPreventable(serviceId); tbxCompleteWorkDataLabourHours.Text = serviceInformationBasicInformationGateway.GetCompleteWorkDetailTMLabourHours(serviceId).ToString(); // ... For third party vendor tbxCompleteWorkDataDescriptionThirdPartyVendor.Text = serviceInformationBasicInformationGateway.GetCompleteWorkDetailDescription(serviceId); ckbxCompleteWorkDataPreventableThirdPartyVendor.Checked = serviceInformationBasicInformationGateway.GetCompleteWorkDetailPreventable(serviceId); tbxCompleteWorkDataInvoiceNumberThirdPartyVendor.Text = serviceInformationBasicInformationGateway.GetCompleteWorkDetailTPVInvoiceNumber(serviceId); tbxCompleteWorkDataInvoiceAmountThirdPartyVendor.Text = serviceInformationBasicInformationGateway.GetCompleteWorkDetailTPVInvoiceAmout(serviceId).ToString(); } }