// ////////////////////////////////////////////////////////////////////////
        // PUBLIC METHODS
        //
        /// <summary>
        /// Load liners
        /// </summary>
        /// <param name="jlLiningPlanTDS">jlLiningPlanTDS</param>       
        /// <param name="companyId">companyId</param>
        public void LoadLiners(JlLiningPlanTDS jlLiningPlanTDS, int companyId)
        {
            JlLiningPlanJlinerGateway jlLiningPlanJlinerGateway = new JlLiningPlanJlinerGateway(jlLiningPlanTDS.JlLiningPlanJliner.DataSet);
            jlLiningPlanJlinerGateway.ClearBeforeFill = false;
            JlLiningPlanJliner jlLiningPlanJliner = new JlLiningPlanJliner(jlLiningPlanTDS.JlLiningPlanJliner.DataSet);

            foreach (JlLiningPlanTDS.JlLiningPlanRow jlLiningPlanRow in jlLiningPlanTDS.JlLiningPlan.Rows)
            {
                if (jlLiningPlanRow.Selected != "9")
                {
                    string linerMN = jlLiningPlanRow.LinerMN;

                    jlLiningPlanJlinerGateway.LoadByAssetIdMnSelected(jlLiningPlanRow.AssetID, jlLiningPlanRow.COMPANY_ID, linerMN, jlLiningPlanRow.Selected);
                    jlLiningPlanJliner.UpdateForReport(companyId);
                }
            }
        }
Пример #2
0
        /// <summary>
        /// ProcessForReport
        /// </summary>
        /// <param name="jlLiningPlanTDS">TDS for process</param>
        public void ProcessForReport(JlLiningPlanTDS jlLiningPlanTDS)
        {
            JlLiningPlanJlinerGateway jlLiningPlanJlinerGateway = new JlLiningPlanJlinerGateway(Data);
            jlLiningPlanJlinerGateway.ClearBeforeFill = false;
            JlLiningPlanJliner jlLiningPlanJliner = new JlLiningPlanJliner(Data);

            foreach (JlLiningPlanTDS.JlLiningPlanRow jlLiningPlanRow in jlLiningPlanTDS.JlLiningPlan.Rows)
            {
                if (jlLiningPlanRow.Selected != "9")
                {
                    // Create row for report
                    JlLiningPlanTDS.JlLiningPlanRow newRow = ((JlLiningPlanTDS.JlLiningPlanDataTable)Table).NewJlLiningPlanRow();

                    newRow.AssetID = jlLiningPlanRow.AssetID;
                    newRow.COMPANY_ID = jlLiningPlanRow.COMPANY_ID;
                    newRow.SectionID = jlLiningPlanRow.SectionID;
                    if (!jlLiningPlanRow.IsStreetNull()) newRow.Street = jlLiningPlanRow.Street;
                    if (!jlLiningPlanRow.IsSize_Null())
                    {
                        if (Distance.IsValidDistance(jlLiningPlanRow.Size_))
                        {
                            Distance distance = new Distance(jlLiningPlanRow.Size_);

                            switch (distance.DistanceType)
                            {
                                case 2:
                                    jlLiningPlanRow.Size_ = distance.ToStringInEng1();
                                    break;
                                case 3:
                                    if (Convert.ToDouble(jlLiningPlanRow.Size_) > 99)
                                    {
                                        double newSize_ = 0;
                                        newSize_ = Convert.ToDouble(jlLiningPlanRow.Size_) * 0.03937;
                                        jlLiningPlanRow.Size_ = Convert.ToString(Math.Ceiling(newSize_)) + "\"";
                                    }
                                    else
                                    {
                                        jlLiningPlanRow.Size_ = jlLiningPlanRow.Size_ + "\"";
                                    }
                                    break;
                                case 4:
                                    jlLiningPlanRow.Size_ = distance.ToStringInEng1();
                                    break;
                                case 5:
                                    jlLiningPlanRow.Size_ = distance.ToStringInEng1();
                                    break;
                            }
                        }
                    }
                    if (!jlLiningPlanRow.IsStandardBypassNull()) newRow.StandardBypass = jlLiningPlanRow.StandardBypass;
                    if (!jlLiningPlanRow.IsTrafficControlNull()) newRow.TrafficControl = jlLiningPlanRow.TrafficControl;
                    if (!jlLiningPlanRow.IsNumLatsNull()) newRow.NumLats = jlLiningPlanRow.NumLats;
                    if (!jlLiningPlanRow.IsNotLinedYetNull()) newRow.NotLinedYet = jlLiningPlanRow.NotLinedYet;
                    if (!jlLiningPlanRow.IsLengthNull()) newRow.Length = jlLiningPlanRow.Length;
                    if (!jlLiningPlanRow.IsUSMHNull()) newRow.USMH = jlLiningPlanRow.USMH;
                    if (!jlLiningPlanRow.IsDSMHNull()) newRow.DSMH = jlLiningPlanRow.DSMH;
                    if (!jlLiningPlanRow.IsAllMeasuredNull()) newRow.AllMeasured = jlLiningPlanRow.AllMeasured;
                    if (!jlLiningPlanRow.IsDate_Null()) newRow.Date_ = jlLiningPlanRow.Date_;
                    if (!jlLiningPlanRow.IsFlusherNull()) newRow.Flusher = jlLiningPlanRow.Flusher;
                    if (!jlLiningPlanRow.IsFlusherMNNull()) newRow.FlusherMN = jlLiningPlanRow.FlusherMN;
                    if (!jlLiningPlanRow.IsLinerNull()) newRow.Liner = jlLiningPlanRow.Liner;
                    if (!jlLiningPlanRow.IsLinerMNNull()) newRow.LinerMN = jlLiningPlanRow.LinerMN;
                    if (!jlLiningPlanRow.IsRotatorNull()) newRow.Rotator = jlLiningPlanRow.Rotator;
                    if (!jlLiningPlanRow.IsRotatorMNNull()) newRow.RotatorMN = jlLiningPlanRow.RotatorMN;
                    if (!jlLiningPlanRow.IsCompressorNull()) newRow.Compressor = jlLiningPlanRow.Compressor;
                    if (!jlLiningPlanRow.IsCompressorMNNull()) newRow.CompressorMN = jlLiningPlanRow.CompressorMN;
                    if (!jlLiningPlanRow.IsUSMHDescriptionNull()) newRow.USMHDescription = jlLiningPlanRow.USMHDescription; else newRow.SetUSMHDescriptionNull();
                    if (!jlLiningPlanRow.IsDSMHDescriptionNull()) newRow.DSMHDescription = jlLiningPlanRow.DSMHDescription; else newRow.SetDSMHDescriptionNull();
                    if (!jlLiningPlanRow.IsUSMHAddressNull()) newRow.USMHAddress = jlLiningPlanRow.USMHAddress; else newRow.SetUSMHAddressNull();
                    if (!jlLiningPlanRow.IsDSMHAddressNull()) newRow.DSMHAddress = jlLiningPlanRow.DSMHAddress; else newRow.SetDSMHAddressNull();
                    newRow.Selected = jlLiningPlanRow.Selected;
                    newRow.FlowOrderID = jlLiningPlanRow.FlowOrderID;
                    newRow.StandardBypassComments = jlLiningPlanRow.StandardBypassComments;
                    newRow.TrafficControlDetails = jlLiningPlanRow.TrafficControlDetails;

                    ((JlLiningPlanTDS.JlLiningPlanDataTable)Table).AddJlLiningPlanRow(newRow);

                    // Select jliners for report
                    foreach (JlLiningPlanTDS.JlLiningPlanJlinerRow jlLiningPlanJlinerRow in jlLiningPlanTDS.JlLiningPlanJliner.Rows)
                    {
                        if (jlLiningPlanJlinerRow.Selected != 30)
                        {
                            jlLiningPlanJlinerGateway.LoadBySection_AssetIdAndLateralOrder(jlLiningPlanRow.AssetID, jlLiningPlanRow.COMPANY_ID, newRow.LinerMN, jlLiningPlanJlinerRow.Selected, jlLiningPlanRow.Selected, jlLiningPlanJlinerRow.AssetID);
                        }
                    }

                    jlLiningPlanJliner.UpdateForReport(jlLiningPlanRow.COMPANY_ID);
                }
            }
        }