/// <summary>
        /// UpdateDirect
        /// </summary>
        /// <param name="countryId">countryId</param>
        /// <param name="provinceId">provinceId</param>
        /// <param name="countyId">countyId</param>
        /// <param name="cityId">cityId</param>
        /// <param name="projectId">projectId</param>
        /// <param name="companyId">companyId</param>
        public void Save(Int64? countryId, Int64? provinceId, Int64? countyId, Int64? cityId, int projectId, int companyId)
        {
            //Update Section
            RehabAssessmentTDS RehabAssessmentChanges = (RehabAssessmentTDS)Data.GetChanges();

            if (RehabAssessmentChanges.SectionDetails.Rows.Count > 0)
            {
                RehabAssessmentSectionDetailsGateway rehabAssessmentSectionDetailsGateway = new RehabAssessmentSectionDetailsGateway(RehabAssessmentChanges);

                // Update sections
                foreach (RehabAssessmentTDS.SectionDetailsRow sectionDetailsRow in (RehabAssessmentTDS.SectionDetailsDataTable)RehabAssessmentChanges.SectionDetails)
                {
                    // Unchanged values
                    int workId = sectionDetailsRow.WorkID;
                    int assetId = sectionDetailsRow.AssetID;
                    string sectionId = sectionDetailsRow.SectionID;

                    // Original values
                    string originalStreet = rehabAssessmentSectionDetailsGateway.GetStreetOriginal(workId);
                    int? originalUsmh = rehabAssessmentSectionDetailsGateway.GetUsmh(workId);
                    string originalUsmhId = rehabAssessmentSectionDetailsGateway.GetUsmhDescriptionOriginal(workId);
                    int? originalDsmh = rehabAssessmentSectionDetailsGateway.GetDsmh(workId);
                    string originalDsmhId = rehabAssessmentSectionDetailsGateway.GetDsmhDescriptionOriginal(workId);
                    string originalMapSize = rehabAssessmentSectionDetailsGateway.GetMapSizeOriginal(workId);
                    string originalSize = rehabAssessmentSectionDetailsGateway.GetSizeOriginal(workId);
                    string originalMapLength = rehabAssessmentSectionDetailsGateway.GetMapLengthOriginal(workId);
                    string originalLength = rehabAssessmentSectionDetailsGateway.GetLengthOriginal(workId);
                    int? originalLaterals = rehabAssessmentSectionDetailsGateway.GetLateralsOriginal(workId);
                    int? originalLiveLaterals = rehabAssessmentSectionDetailsGateway.GetLiveLateralsOriginal(workId);
                    string originalUsmhDepth = rehabAssessmentSectionDetailsGateway.GetUsmhDepthOriginal(workId);
                    string originalDsmhDepth = rehabAssessmentSectionDetailsGateway.GetDsmhDepthOriginal(workId);
                    string originalSteelTapeThroughSewer = rehabAssessmentSectionDetailsGateway.GetSteelTapeThroughSewerOriginal(workId);
                    string originalUsmhMouth12 = rehabAssessmentSectionDetailsGateway.GetUsmhMouth12Original(workId);
                    string originalUsmhMouth1 = rehabAssessmentSectionDetailsGateway.GetUsmhMouth1Original(workId);
                    string originalUsmhMouth2 = rehabAssessmentSectionDetailsGateway.GetUsmhMouth2Original(workId);
                    string originalUsmhMouth3 = rehabAssessmentSectionDetailsGateway.GetUsmhMouth3Original(workId);
                    string originalUsmhMouth4 = rehabAssessmentSectionDetailsGateway.GetUsmhMouth4Original(workId);
                    string originalUsmhMouth5 = rehabAssessmentSectionDetailsGateway.GetUsmhMouth5Original(workId);
                    string originalDsmhMouth12 = rehabAssessmentSectionDetailsGateway.GetDsmhMouth12Original(workId);
                    string originalDsmhMouth1 = rehabAssessmentSectionDetailsGateway.GetDsmhMouth1Original(workId);
                    string originalDsmhMouth2 = rehabAssessmentSectionDetailsGateway.GetDsmhMouth2Original(workId);
                    string originalDsmhMouth3 = rehabAssessmentSectionDetailsGateway.GetDsmhMouth3Original(workId);
                    string originalDsmhMouth4 = rehabAssessmentSectionDetailsGateway.GetDsmhMouth4Original(workId);
                    string originalDsmhMouth5 = rehabAssessmentSectionDetailsGateway.GetDsmhMouth5Original(workId);
                    string originalUsmhAddress = rehabAssessmentSectionDetailsGateway.GetUsmhAddressOriginal(workId);
                    string originalDsmhAddress = rehabAssessmentSectionDetailsGateway.GetDsmhAddressOriginal(workId);
                    string originalSubArea = rehabAssessmentSectionDetailsGateway.GetSubAreaOriginal(workId);
                    string originalThickness = rehabAssessmentSectionDetailsGateway.GetThicknessOriginal(workId);

                    // New variables
                    string newStreet = rehabAssessmentSectionDetailsGateway.GetStreet(workId);
                    string newUsmh = rehabAssessmentSectionDetailsGateway.GetUsmhDescription(workId);
                    string newDsmh = rehabAssessmentSectionDetailsGateway.GetDsmhDescription(workId);
                    string newMapSize = rehabAssessmentSectionDetailsGateway.GetMapSize(workId);
                    string newSize = rehabAssessmentSectionDetailsGateway.GetSize_(workId);
                    string newMapLength = rehabAssessmentSectionDetailsGateway.GetMapLength(workId);
                    string newLength = rehabAssessmentSectionDetailsGateway.GetLength(workId);
                    int? newLaterals = rehabAssessmentSectionDetailsGateway.GetLaterals(workId);
                    int? newLiveLaterals = rehabAssessmentSectionDetailsGateway.GetLiveLaterals(workId);
                    string newUsmhDepth = rehabAssessmentSectionDetailsGateway.GetUsmhDepth(workId);
                    string newDsmhDepth = rehabAssessmentSectionDetailsGateway.GetDsmhDepth(workId);
                    string newSteelTapeThroughSewer = rehabAssessmentSectionDetailsGateway.GetSteelTapeThroughSewer(workId);
                    string newUsmhMouth12 = rehabAssessmentSectionDetailsGateway.GetUsmhMouth12(workId);
                    string newUsmhMouth1 = rehabAssessmentSectionDetailsGateway.GetUsmhMouth1(workId);
                    string newUsmhMouth2 = rehabAssessmentSectionDetailsGateway.GetUsmhMouth2(workId);
                    string newUsmhMouth3 = rehabAssessmentSectionDetailsGateway.GetUsmhMouth3(workId);
                    string newUsmhMouth4 = rehabAssessmentSectionDetailsGateway.GetUsmhMouth4(workId);
                    string newUsmhMouth5 = rehabAssessmentSectionDetailsGateway.GetUsmhMouth5(workId);
                    string newDsmhMouth12 = rehabAssessmentSectionDetailsGateway.GetDsmhMouth12(workId);
                    string newDsmhMouth1 = rehabAssessmentSectionDetailsGateway.GetDsmhMouth1(workId);
                    string newDsmhMouth2 = rehabAssessmentSectionDetailsGateway.GetDsmhMouth2(workId);
                    string newDsmhMouth3 = rehabAssessmentSectionDetailsGateway.GetDsmhMouth3(workId);
                    string newDsmhMouth4 = rehabAssessmentSectionDetailsGateway.GetDsmhMouth4(workId);
                    string newDsmhMouth5 = rehabAssessmentSectionDetailsGateway.GetDsmhMouth5(workId);
                    string newUsmhAddress = rehabAssessmentSectionDetailsGateway.GetUsmhAddress(workId);
                    string newDsmhAddress = rehabAssessmentSectionDetailsGateway.GetDsmhAddress(workId);
                    string newSubArea = rehabAssessmentSectionDetailsGateway.GetSubArea(workId);
                    string newThickness = rehabAssessmentSectionDetailsGateway.GetThickness(workId);

                    // Update
                    Update(projectId, countryId, provinceId, countyId, cityId, workId, assetId, sectionId, originalStreet, originalUsmh, originalUsmhId, originalDsmh, originalDsmhId, originalMapSize, originalSize, originalMapLength, originalLength, originalLaterals, originalLiveLaterals, originalUsmhDepth, originalDsmhDepth, originalSteelTapeThroughSewer, originalSubArea, originalUsmhMouth12, originalUsmhMouth1, originalUsmhMouth2, originalUsmhMouth3, originalUsmhMouth4, originalUsmhMouth5, originalDsmhMouth12, originalDsmhMouth1, originalDsmhMouth2, originalDsmhMouth3, originalDsmhMouth4, originalDsmhMouth5,  false, companyId, originalUsmhAddress, originalDsmhAddress, originalThickness, workId, assetId, sectionId, newStreet, newUsmh, newDsmh, newMapSize, newSize, newMapLength, newLength, newLaterals, newLiveLaterals, newUsmhDepth, newDsmhDepth, newSteelTapeThroughSewer, newSubArea, newUsmhMouth12, newUsmhMouth1, newUsmhMouth2, newUsmhMouth3, newUsmhMouth4, newUsmhMouth5, newDsmhMouth12, newDsmhMouth1, newDsmhMouth2, newDsmhMouth3, newDsmhMouth4, newDsmhMouth5, false, companyId, newUsmhAddress, newDsmhAddress, newThickness);
                }
            }
        }
Пример #2
0
        private void LoadSectionData(int workId)
        {
            RehabAssessmentSectionDetailsGateway rehabAssessmentSectionDetailsGateway = new RehabAssessmentSectionDetailsGateway(rehabAssessmentTDS);
            if (rehabAssessmentSectionDetailsGateway.Table.Rows.Count > 0)
            {
                // Load Section Details
                tbxFlowOrderId.Text = rehabAssessmentSectionDetailsGateway.GetFlowOrderId(workId);
                hdfFlowOrderId.Value = rehabAssessmentSectionDetailsGateway.GetFlowOrderId(workId);
                hdfSectionId.Value = rehabAssessmentSectionDetailsGateway.GetSectionId(workId);
                tbxOldCwpId.Text = rehabAssessmentSectionDetailsGateway.GetOriginalSectionId(workId);
                tbxStreet.Text = rehabAssessmentSectionDetailsGateway.GetStreet(workId);
                tbxUSMH.Text = rehabAssessmentSectionDetailsGateway.GetUsmhDescription(workId);
                tbxDSMH.Text = rehabAssessmentSectionDetailsGateway.GetDsmhDescription(workId);
                tbxMapSize.Text = rehabAssessmentSectionDetailsGateway.GetMapSize(workId);
                tbxConfirmedSize.Text = rehabAssessmentSectionDetailsGateway.GetSize_(workId);
                ddlThickness.SelectedValue = rehabAssessmentSectionDetailsGateway.GetThickness(workId);
                tbxMapLength.Text = rehabAssessmentSectionDetailsGateway.GetMapLength(workId);
                tbxSteelTapeLength.Text = rehabAssessmentSectionDetailsGateway.GetLength(workId);
                tbxLaterals.Text = "0"; if (rehabAssessmentSectionDetailsGateway.GetLaterals(workId).HasValue) tbxLaterals.Text = rehabAssessmentSectionDetailsGateway.GetLaterals(workId).ToString().Trim();
                tbxLiveLaterals.Text = "0"; if (rehabAssessmentSectionDetailsGateway.GetLiveLaterals(workId).HasValue) tbxLiveLaterals.Text = rehabAssessmentSectionDetailsGateway.GetLiveLaterals(workId).ToString().Trim();

                // For m1 data
                // ... for depths
                tbxM1DataUsmhDepth.Text = rehabAssessmentSectionDetailsGateway.GetUsmhDepth(workId);
                tbxM1DataDsmhDepth.Text = rehabAssessmentSectionDetailsGateway.GetDsmhDepth(workId);

                // ... for address
                tbxM1DataUsmhAddress.Text = rehabAssessmentSectionDetailsGateway.GetUsmhAddress(workId);
                tbxM1DataDsmhAddress.Text = rehabAssessmentSectionDetailsGateway.GetDsmhAddress(workId);

                // ... Get lfs asset sewer data
                tbxM1DataSteelTapeThroughSewer.Text = rehabAssessmentSectionDetailsGateway.GetSteelTapeThroughSewer(workId);
                tbxM1DataUsmhMouth12.Text = rehabAssessmentSectionDetailsGateway.GetUsmhMouth12(workId);
                tbxM1DataUsmhMouth1.Text = rehabAssessmentSectionDetailsGateway.GetUsmhMouth1(workId);
                tbxM1DataUsmhMouth2.Text = rehabAssessmentSectionDetailsGateway.GetUsmhMouth2(workId);
                tbxM1DataUsmhMouth3.Text = rehabAssessmentSectionDetailsGateway.GetUsmhMouth3(workId);
                tbxM1DataUsmhMouth4.Text = rehabAssessmentSectionDetailsGateway.GetUsmhMouth4(workId);
                tbxM1DataUsmhMouth5.Text = rehabAssessmentSectionDetailsGateway.GetUsmhMouth5(workId);
                tbxM1DataDsmhMouth12.Text = rehabAssessmentSectionDetailsGateway.GetDsmhMouth12(workId);
                tbxM1DataDsmhMouth1.Text = rehabAssessmentSectionDetailsGateway.GetDsmhMouth1(workId);
                tbxM1DataDsmhMouth2.Text = rehabAssessmentSectionDetailsGateway.GetDsmhMouth2(workId);
                tbxM1DataDsmhMouth3.Text = rehabAssessmentSectionDetailsGateway.GetDsmhMouth3(workId);
                tbxM1DataDsmhMouth4.Text = rehabAssessmentSectionDetailsGateway.GetDsmhMouth4(workId);
                tbxM1DataDsmhMouth5.Text = rehabAssessmentSectionDetailsGateway.GetDsmhMouth5(workId);
                tbxGeneralSubArea.Text = rehabAssessmentSectionDetailsGateway.GetSubArea(workId);
            }
        }