public Cost(string name, int price, TypeCost type, DateTime date)
 {
     Name  = name;
     Price = price;
     Date  = date;
     Type  = type;
 }
 public CostMaterial(string name, TypeCost typeCost,
                     Func <Cost, string> getTypeCostName) : base(name, typeCost)
 {
 }
Beispiel #3
0
        public static StringProperty <double?> GetDuration(Project project, string comment, TypeCost typeCost)
        {
            StringProperty <double?> result = new StringProperty <double?>()
            {
                Name = string.Empty, Value = 0
            };

            var q = from g in project.ListNameGroupCost
                    from c in g.ListCost
                    where c.Comment.Value.Equals(comment) && c.TypeEnumObject == typeCost
                    select new { id = c.Id, comment = c.Comment.Value, name = c.Comment.Name, value = c.Duration.Value };

            var maxq = from item in q
                       group item by new { item.id }
            into g
                select new
            {
                id     = g.Key.id,
                maxDur = (from c in g
                          select c.value).Max()
            };

            double?sumDur = 0;

            sumDur = maxq.Sum(d => d.maxDur);

            result.Value = sumDur;

            return(result);
        }