public string getTruckTypes() { JavaScriptSerializer j = new JavaScriptSerializer(); TruckTypes tp = new TruckTypes(); List <TruckTypes> trucksTypesList = tp.getTruckTypesList(); return(j.Serialize(trucksTypesList)); }
//without active public Trucks(int truckID, int truckLicense, string manufacturer, string model, string kmToDate, string hand, float purchaseCost, string purchaseYear, TruckTypes truckType, string urea, DateTime onRoadDate, DateTime insuranceExpiredDate) { TruckID = truckID; TruckLicense = truckLicense; Manufacturer = manufacturer; Model = model; KMToDate = kmToDate; Hand = hand; PurchaseCost = purchaseCost; PurchaseYear = purchaseYear; TruckType = truckType; OnRoadDate = onRoadDate; InsuranceExpiredDate = insuranceExpiredDate; Urea = urea; }
public List <TruckTypes> getTruckTypesList() { #region DB functions string query = "select * from TruckTypes order by TruckType"; List <TruckTypes> list = new List <TruckTypes>(); DbService db = new DbService(); DataSet ds = db.GetDataSetByQuery(query); foreach (DataRow dr in ds.Tables[0].Rows) { TruckTypes tmp = new TruckTypes((int)dr["TruckTypeID"], dr["TruckType"].ToString()); list.Add(tmp); } #endregion return(list); }
//Constructors public Truck(string make, string model, CarColors carColor, TruckTypes truckType) : base(make, model, 2000, carColor) { TruckType = truckType; }