コード例 #1
0
 public Cost(string name, int price, TypeCost type, DateTime date)
 {
     Name  = name;
     Price = price;
     Date  = date;
     Type  = type;
 }
コード例 #2
0
 public CostMaterial(string name, TypeCost typeCost,
                     Func <Cost, string> getTypeCostName) : base(name, typeCost)
 {
 }
コード例 #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);
        }