예제 #1
0
            public static decimal GemWeight(GemShape shape, GemStoneType gem, GemShapeMeasurements measurements)
            {
                var m = measurements.Diameters.GroupBy(d => d.GemShapeMesurementsID)
                        .Select(n => new
                {
                    Count   = n.Count(),
                    Average = n.Average(d => d.Diameter),
                    Max     = n.Max(d => d.Diameter),
                    Min     = n.Min(d => d.Diameter)
                });

                int c = measurements.Diameters.Count();

                if (c >= 2)
                {
                    var a = measurements.Diameters.Average(s => s.Diameter);
                }

                var width  = measurements.Diameters.Min(s => s.Diameter);
                var length = measurements.Diameters.Max(s => s.Diameter);

                return(GemWeight(shape, gem, measurements.Depth, length, width));
            }
예제 #2
0
 public static decimal GemWeight(GemShape shape, GemStoneType gem, decimal Depth, decimal Length, decimal Width)
 {
     return(CalculateGemWeight(Length, Width, Depth, gem.AverageSpecificGravity, shape.WeightFactor));
 }