public void LoadCounts(CuttingUnitDO unit)
        {
            var counts        = new List <CountTree>();
            var tallySettings = DAL.From <TallySettings>()
                                .Where("SampleGroup_CN = @p1")
                                .GroupBy("CountTree.SampleGroup_CN", "CountTree.TreeDefaultValue_CN", "CountTree.Tally_CN")
                                .Read(SampleGroup_CN);

            foreach (TallySettings ts in tallySettings)
            {
                CountTree count = DAL.From <CountTree>()
                                  .Where("CuttingUnit_CN = @p1 AND SampleGroup_CN = @p2 AND Tally_CN = @p3")
                                  .Read(unit.CuttingUnit_CN
                                        , ts.SampleGroup_CN
                                        , ts.Tally_CN).FirstOrDefault();
                if (count == null)
                {
                    count                     = new CountTree(DAL);
                    count.CuttingUnit         = unit;
                    count.SampleGroup_CN      = ts.SampleGroup_CN;
                    count.TreeDefaultValue_CN = ts.TreeDefaultValue_CN;
                    count.Tally_CN            = ts.Tally_CN;

                    count.Save();
                }

                count.SampleGroup = this;

                counts.Add(count);
            }

            Counts = counts;
        }
 public void OnTally(FSCruiser.Core.Models.CountTree count)
 {
     if (_viewLoading)
     {
         return;
     }
     this.DataEntryController.OnTally(count);
     this._BS_tallyHistory.MoveLast();
 }
Beispiel #3
0
 public TallyAction(Tree treeRecord, CountTree count)
 {
     TreeRecord = treeRecord;
 }
Beispiel #4
0
 public TallyAction(CountTree count)
     : this()
 {
     Count = count;
 }