public List <string> Destination() { TestMVCentityEntities1 db = new TestMVCentityEntities1(); var destination = db.FareLists.Select(c => c.DestinationStation).ToList(); return(destination); }
public List <string> Source() { TestMVCentityEntities1 db = new TestMVCentityEntities1(); var source = db.FareLists.Select(c => c.SourceStation).ToList(); return(source); }
public double Cal_Fare(int count, string source, string destination) { TestMVCentityEntities1 db = new TestMVCentityEntities1(); var fare = db.FareLists.Where(c => c.SourceStation == source).Where(q => q.DestinationStation == destination); double totalFare; if (fare.Count() > 0) { totalFare = fare.First().Fare *count; return(totalFare); } else { return(0); } }