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 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();
            }
        }