Пример #1
0
        }         //  end check3Pcounts

        public static ArrayList buildPrintArray(CountTreeDO cdo, string stratumCode)
        {
            ArrayList countList = new ArrayList();

            countList.Add(" ");
            countList.Add(cdo.CuttingUnit.Code.PadLeft(3, ' '));
            countList.Add(stratumCode.PadLeft(2, ' '));
            countList.Add(cdo.SampleGroup.Code.PadLeft(2, ' '));
            if (cdo.TreeDefaultValue == null)
            {
                countList.Add("      ");
            }
            else
            {
                countList.Add(cdo.TreeDefaultValue.Species.PadRight(6, ' '));
            }
            countList.Add(cdo.SampleGroup.SamplingFrequency.ToString().PadLeft(4, ' '));
            countList.Add(cdo.SampleGroup.KZ.ToString().PadLeft(5, ' '));
            countList.Add(cdo.TreeCount.ToString().PadLeft(5, ' '));
            countList.Add(cdo.SumKPI.ToString().PadLeft(6, ' '));
            if (cdo.Tally == null)
            {
                countList.Add(" ");
            }
            else
            {
                countList.Add(cdo.Tally.Description);
            }

            return(countList);
        } //  end buildPrintArray
Пример #2
0
        DAL SetupDataStore()
        {
            var dataStore = new DAL(_pathToFile, true);

            var sale = new SaleDO(dataStore)
            {
                LogGradingEnabled = false,
                SaleNumber        = "12345",
                Region            = "01",
                Forest            = "01",
                District          = "01"
            };

            sale.Save();

            var unit = new CuttingUnitDO(dataStore)
            {
                Code = "01"
            };

            unit.Save();

            var stratum = new StratumDO(dataStore)
            {
                Code   = "01",
                Method = CruiseMethods.STR
            };

            stratum.Save();
            unit.Strata.Add(stratum);
            unit.Strata.Save();

            var sg = new SampleGroupDO(dataStore)
            {
                Code           = "01",
                CutLeave       = "C",
                UOM            = "1",
                PrimaryProduct = "01"
            };

            sg.Stratum            = stratum;
            sg.SamplingFrequency  = 5;
            sg.InsuranceFrequency = 0;

            sg.Save();

            var countTree = new CountTreeDO(dataStore)
            {
                SampleGroup = sg,
                CuttingUnit = unit
            };

            countTree.Save();

            return(dataStore);
        }
Пример #3
0
 public void LogSumKPIEdit(CountTreeDO countTree, long oldValue, long newValue)
 {
     LogMessage(String.Format("SumKPI Edit: CT_CN={0}; PrevVal={1}; NewVal={2}", countTree.CountTree_CN, oldValue, newValue), "I");
 }
Пример #4
0
        private CruiseDAL.DAL CreateDatastore(string cruiseMethod, int freqORkz, int insuranceFreq)
        {
            var ds = new CruiseDAL.DAL();

            try
            {
                var sale = new SaleDO()
                {
                    DAL               = ds,
                    SaleNumber        = "12345",
                    Region            = "1",
                    Forest            = "1",
                    District          = "1",
                    Purpose           = "something",
                    LogGradingEnabled = true
                };
                sale.Save();

                var stratum = new StratumDO()
                {
                    DAL    = ds,
                    Code   = "01",
                    Method = cruiseMethod
                };
                stratum.Save();

                var cuttingUnit = new CuttingUnitDO()
                {
                    DAL  = ds,
                    Code = "01"
                };
                cuttingUnit.Save();

                var cust = new CuttingUnitStratumDO()
                {
                    DAL         = ds,
                    CuttingUnit = cuttingUnit,
                    Stratum     = stratum
                };
                cust.Save();

                var sampleGroup = new SampleGroupDO()
                {
                    DAL                = ds,
                    Stratum            = stratum,
                    Code               = "01",
                    PrimaryProduct     = "01",
                    UOM                = "something",
                    CutLeave           = "something",
                    InsuranceFrequency = insuranceFreq
                };

                if (CruiseMethods.THREE_P_METHODS.Contains(cruiseMethod))
                {
                    sampleGroup.KZ = freqORkz;
                }
                else
                {
                    sampleGroup.SamplingFrequency = freqORkz;
                }

                sampleGroup.Save();

                var tally = new TallyDO()
                {
                    DAL         = ds,
                    Hotkey      = "A",
                    Description = "something"
                };
                tally.Save();

                var count = new CountTreeDO()
                {
                    DAL         = ds,
                    CuttingUnit = cuttingUnit,
                    SampleGroup = sampleGroup,
                    Tally       = tally
                };
                count.Save();

                return(ds);
            }
            catch
            {
                ds.Dispose();
                throw;
            }
        }