// ////////////////////////////////////////////////////////////////////////
        // PUBLIC METHODS
        //
        /// <summary>
        /// LoadByWorkId
        /// </summary>
        /// <param name="workId">workId</param>              
        /// <param name="companyId">companyId</param>
        public void LoadByWorkId(int workId, int companyId)
        {
            PointRepairsSectionDetailsGateway pointRepairsSectionDetailsGateway = new PointRepairsSectionDetailsGateway(Data);
            pointRepairsSectionDetailsGateway.LoadByWorkId(workId, companyId);

            // Update some fields before to show
            UpdateFieldsForSections();
        }
        protected void grdLiningPlan_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                int workId = Int32.Parse(((HiddenField)e.Row.FindControl("hdfWorkID")).Value);
                int companyId = Int32.Parse(hdfCompanyId.Value);

                PointRepairsSectionDetailsGateway pointRepairsSectionDetailsGateway = new PointRepairsSectionDetailsGateway();
                pointRepairsSectionDetailsGateway.LoadByWorkId(workId, companyId);

                string usmh = pointRepairsSectionDetailsGateway.GetUsmhDescription(workId);
                string dsmh = pointRepairsSectionDetailsGateway.GetDsmhDescription(workId);

                DropDownList ddlVideoMN = (DropDownList)e.Row.FindControl("ddlVideoMN");
                DropDownList ddlLinerMN = (DropDownList)e.Row.FindControl("ddlLinerMN");

                ddlVideoMN.Items.Add("");
                ddlVideoMN.Items.Add(usmh);
                ddlVideoMN.Items.Add(dsmh);

                try
                {
                    ddlVideoMN.SelectedValue = ((HiddenField)e.Row.FindControl("hdfVideoMN")).Value;
                }
                catch
                {
                    ddlVideoMN.SelectedIndex = 0;
                }

                ddlLinerMN.Items.Add("");
                ddlLinerMN.Items.Add(usmh);
                ddlLinerMN.Items.Add(dsmh);

                try
                {
                    ddlLinerMN.SelectedValue = ((HiddenField)e.Row.FindControl("hdfLinerMN")).Value;
                }
                catch
                {
                    ddlLinerMN.SelectedIndex = 0;
                }
            }
        }
Exemplo n.º 3
0
 private void LoadSectionData(int workId)
 {
     PointRepairsSectionDetailsGateway pointRepairsSectionDetailsGateway = new PointRepairsSectionDetailsGateway(pointRepairsTDS);
     if (pointRepairsSectionDetailsGateway.Table.Rows.Count > 0)
     {
         // Load Section Details
         tbxFlowOrderId.Text = pointRepairsSectionDetailsGateway.GetFlowOrderId(workId);
         hdfSectionId.Value = pointRepairsSectionDetailsGateway.GetSectionId(workId);
         hdfFlowOrderId.Value = pointRepairsSectionDetailsGateway.GetFlowOrderId(workId);
         hdfSectionId.Value = pointRepairsSectionDetailsGateway.GetSectionId(workId);
         tbxStreet.Text = pointRepairsSectionDetailsGateway.GetStreet(workId);
         tbxUSMH.Text = pointRepairsSectionDetailsGateway.GetUsmhDescription(workId);
         tbxUSMHMN.Text = pointRepairsSectionDetailsGateway.GetUsmhAddress(workId);
         tbxDSMH.Text = pointRepairsSectionDetailsGateway.GetDsmhDescription(workId);
         tbxDSMHMN.Text = pointRepairsSectionDetailsGateway.GetDsmhAddress(workId);
         tbxMapSize.Text = pointRepairsSectionDetailsGateway.GetMapSize(workId);
         tbxConfirmedSize.Text = pointRepairsSectionDetailsGateway.GetSize_(workId);
         tbxMapLength.Text = pointRepairsSectionDetailsGateway.GetMapLength(workId);
         tbxSteelTapeLength.Text = pointRepairsSectionDetailsGateway.GetLength(workId);
         tbxLaterals.Text = "0"; if (pointRepairsSectionDetailsGateway.GetLaterals(workId).HasValue) tbxLaterals.Text = pointRepairsSectionDetailsGateway.GetLaterals(workId).ToString().Trim();
         tbxLiveLaterals.Text = "0"; if (pointRepairsSectionDetailsGateway.GetLiveLaterals(workId).HasValue) tbxLiveLaterals.Text = pointRepairsSectionDetailsGateway.GetLiveLaterals(workId).ToString().Trim();
         tbxGeneralDataSubArea.Text = pointRepairsSectionDetailsGateway.GetSubArea(workId);
     }
 }
        /// <summary>
        ///Save
        /// </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
            PointRepairsTDS pointRepairsChanges = (PointRepairsTDS)Data.GetChanges();

            if (pointRepairsChanges.SectionDetails.Rows.Count > 0)
            {
                PointRepairsSectionDetailsGateway pointRepairsSectionDetailsGateway = new PointRepairsSectionDetailsGateway(pointRepairsChanges);

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

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

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