Example #1
0
 static public List <ProducedCompanyPower> GetTotalProducedPower(string företag = null)
 {
     using (var db = new SolkalkDbEntities())
     {
         if (företag != "" && företag != null)
         {
             var query = from power in db.ProducedCompanyPowers
                         where power.Företag == företag
                         select power;
             return(query.ToList());
         }
         else
         {
             var query = from power in db.ProducedCompanyPowers
                         select power;
             return(query.ToList());
         }
     }
 }
        //static public List<>

        static public List <ProducedMunicipalPower> GetTotalProducedPower(string kommun = null)
        {
            using (var db = new SolkalkDbEntities())
            {
                if (kommun != "" && kommun != null)
                {
                    var query = from power in db.ProducedMunicipalPowers
                                where power.Kommun == kommun
                                select power;
                    return(query.ToList());
                }
                else
                {
                    var query = from power in db.ProducedMunicipalPowers
                                select power;
                    return(query.ToList());
                }
            }
        }
 static public List <ProducedMunicipalPower> GetProducedPowerOfYear(Date date, string kommun = null)
 {
     using (var db = new SolkalkDbEntities())
     {
         if (kommun != "" && kommun != null)
         {
             var query = from power in db.ProducedMunicipalPowers
                         where power.Kommun == kommun && power.Year == date.year
                         select power;
             return(query.ToList());
         }
         else
         {
             var query = from power in db.ProducedMunicipalPowers
                         where power.Year == date.year
                         select power;
             return(query.ToList());
         }
     }
 }
Example #4
0
 static public List <ProducedCompanyPower> GetProducedPowerOfYear(Date date, string företag = null)
 {
     using (var db = new SolkalkDbEntities())
     {
         if (företag != "" && företag != null)
         {
             var query = from power in db.ProducedCompanyPowers
                         where power.Företag == företag && power.Year == date.year
                         select power;
             return(query.ToList());
         }
         else
         {
             var query = from power in db.ProducedCompanyPowers
                         where power.Year == date.year
                         select power;
             return(query.ToList());
         }
     }
 }