Esempio n. 1
0
        public static CargoEntry[] GetCargo()
        {
            DataTable dt = CargoDAO.GetCargo();
            var cargoList = new List<CargoEntry>();
            foreach (DataRow row in dt.Rows)
            {
                var cargoEntry = new CargoEntry();
                cargoEntry.Id = (int)row["id"];
                cargoEntry.Item = (string)row["item"];
                cargoEntry.Amount = (Int16)row["amount"];
                cargoEntry.Cost = (decimal)row["cost"];
                cargoList.Add(cargoEntry);
            }

            CargoEntry[] entryArr = cargoList.ToArray();
            return entryArr;
        }
 public IHttpActionResult PostTodo(CargoEntry entry)
 {
     return Ok();
 }