Example #1
0
 public FlightInfoNumberic(FlightInfo flightInfo)
 {
     Id = flightInfo.Id;
     From = flightInfo.From;
     To = flightInfo.To;
     TimeFrom = flightInfo.TimeFrom;
     TimeTo = flightInfo.TimeTo;
     Image = flightInfo.Image;
     Hang = flightInfo.Hang;
     try
     {
         string tien = flightInfo.GiaTien.Substring(0, flightInfo.GiaTien.Length - 3);
         string tien2 = tien.Replace(".", "");
         GiaTien = flightInfo.GiaTien != null ? Convert.ToInt32(tien2) : 0;
     }
     catch
     {
         GiaTien = 0;
     }
 }
Example #2
0
 public FlightInfo ToFlightInfo(FlightInfoNumberic flightNumberic)
 {
     var tamp = new FlightInfo{
     Id = flightNumberic.Id,
     From = flightNumberic.From,
     To = flightNumberic.To,
     TimeFrom = flightNumberic.TimeFrom,
     TimeTo = flightNumberic.TimeTo,
     Image = flightNumberic.Image,
     Hang = flightNumberic.Hang,
     GiaTien = flightNumberic.GiaTien.ToString("0,0", CultureInfo.InvariantCulture) + "VND"
     };
     return tamp;
 }