public void SendFuelRequestConfirmation(int fuelOrderId) { _FuelOrder = new FuelOrders(fuelOrderId); _Customer = new CustomerDetails(_FuelOrder.CustClientID); try { _Customer.Contacts = new ContactsCollection(); _Customer.Contacts.LoadByCustClientID(_Customer.CustClientID); _Customer.Email = ""; foreach (Contacts contact in _Customer.Contacts) { if (contact.Distribute) { _Customer.Email += contact.Email + ";"; } } _FuelOrder.Aircraft = Aircrafts.GetAircraft(_FuelOrder.AircraftID); _FuelOrder.Aircraft.MakeAndModel = AircraftData.GetAircraftData(_FuelOrder.Aircraft.MakeModelID); CreateAndSendEmail(); _FuelOrder.AdminStatus = AdminStatuses.Confirmed; _FuelOrder.Update(); } catch (Exception e) { ErrorLog EL = new ErrorLog(e); EL.UserID = _FuelOrder.CustClientID; EL.URL = "SendFuelRequestConfirmation, ID: " + _FuelOrder.Id.ToString(); EL.LogError(); } }
public HttpResponseMessage UpdateFuelOrder(UpdateFuelOrderRequest model) { if (!CheckAccount(model)) { return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, badResponse)); } FuelOrders fuelOrder = new FuelOrders(model.Id); fuelOrder.IsFromFuelerLinx = true; fuelOrder.TailNumber = model.TailNumber; fuelOrder.AdminStatus = model.AdminStatus; fuelOrder.CustStatus = model.CustStatus; fuelOrder.QuotedPPG = model.QuotedPPG; fuelOrder.FuelingDateTime = model.FuelingDateTime; fuelOrder.FuelOn = model.FuelOn; fuelOrder.CertificateType = model.CertificateType; fuelOrder.FuelingDateTime = model.FuelingDateTime; fuelOrder.InvoicedPPG = model.InvoicedPPG; fuelOrder.InvoicedVolume = model.InvoicedVolume; fuelOrder.BasePPG = model.BasePPG; fuelOrder.TripID = model.TripID; fuelOrder.PostedRetail = model.PostedRetail; fuelOrder.PlattsPrice = model.PlattsPrice; fuelOrder.AdminNotes = model.AdminNotes; fuelOrder.RampFee = model.RampFee; fuelOrder.RampFeeWaivedAt = model.RampFeeWaivedAt; fuelOrder.InvoiceNumber = model.InvoiceNumber; fuelOrder.InvoiceStatus = model.InvoiceStatus; fuelOrder.NoFuel = model.NoFuel; ItemResponse <int> response = new ItemResponse <int>(); response.Item = FuelOrdersService.UpdateFuelOrder(fuelOrder); return(Request.CreateResponse(response)); }
public int UpdateFuelOrder(object fuelOrderOBJ) { FuelOrders fuelOrder = new FuelOrders(); fuelOrder.SetProperties((Dictionary <string, object>)fuelOrderOBJ); fuelOrder.Update(); return(fuelOrder.Id); }
public static int UpdateFuelOrder(object fuelOrderOBJ) { FuelOrders fuelOrder = new FuelOrders(); fuelOrder.Clone(fuelOrderOBJ); fuelOrder.Update(); return(fuelOrder.Id); }
public static FuelOrders GetFuelOrder(int id) { FuelOrders order = new FuelOrders(id); //order.FuelOrderTaxes = new FuelOrderTaxesCollection(); //order.FuelOrderNotes = new FuelOrderNotesCollection(); //order.FuelOrderNotes.LoadByFuelOrder(id); order.Aircraft = new Aircrafts(order.AircraftID); return(order); }
public void SendFuelRequestForRelease(int fuelOrderId) { _FuelOrder = new FuelOrders(fuelOrderId); _Customer = new CustomerDetails(_FuelOrder.CustClientID); GetSupplierEmail(); if (_SupplierEmail != "" && !_Customer.IsDemoMode) { SendRequestForRelease(); } }
public bool GetTrips() { SchedulingGenerateFuelOrdersCollection schedulingImportsCollection = new SchedulingGenerateFuelOrdersCollection(); schedulingImportsCollection.LoadAll(SchedulingPlatform, AdminClientID, CustClientID); AircraftsCollection aircrafts = new AircraftsCollection(); aircrafts.LoadByAdminAndCustClientID(AdminClientID, CustClientID); foreach (SchedulingGenerateFuelOrders schedulingImport in schedulingImportsCollection) { if (aircrafts.GetTailNumber(schedulingImport.TailNumber) != null) { FuelOrders fuelOrder = new FuelOrders(); fuelOrder.ICAO = schedulingImport.ICAO; fuelOrder.FBO = schedulingImport.FBO; fuelOrder.AdminClientID = schedulingImport.AdminClientID; fuelOrder.CustClientID = schedulingImport.CustClientID; fuelOrder.TailNumber = schedulingImport.TailNumber; fuelOrder.AircraftID = aircrafts.GetTailNumber(fuelOrder.TailNumber).Id; fuelOrder.FuelingDateTime = schedulingImport.Arrival; fuelOrder.QuotedVolume = 1; fuelOrder.DateRequested = DateTime.Now; //aircraftid relationship in databases aren't matching fuelOrder.OrderedByUserID = Users.CurrentUser.Id; FuelOrderPricingsCollection prices = GetQuote(AdminClientID, CustClientID, fuelOrder.ICAO, fuelOrder.TailNumber); if (prices.Count > 0) { fuelOrder.QuotedPPG = prices[0].Price; fuelOrder.Vendor = prices[0].Vendor; fuelOrder.SupplierID = prices[0].SupplierID; fuelOrder.Product = prices[0].Product; } fuelOrder.Update(); //FuelOrderDispatchRequestForRelease fuelOrderDispatchConfirmation = new FuelOrderDispatchRequestForRelease(); //fuelOrderDispatchConfirmation.SendFuelRequestForRelease(fuelOrder); } } return(true); }
public void SendFuelRequestForRelease(FuelOrders fuelOrder) { _FuelOrder = fuelOrder; SendRequestForRelease(); }
public void DeleteFuelOrder(int id) { FuelOrders.DeleteFuelOrder(id); }
public List <FuelOrders> GetListOfFuelOrders() { return(FuelOrders.LoadList()); }
public FuelOrders GetFuelOrder(int id) { return(FuelOrders.GetFuelOrder(id)); }
public static List <FuelOrders> GetFuelOrdersByCustClient(int clientId, DateTime startDate, DateTime endDate) { return(FuelOrders.LoadListByCustClient(clientId, startDate, endDate)); }
public void SendFuelRequestForRelease(int fuelOrderId) { _FuelOrder = new FuelOrders(fuelOrderId); SendRequestForRelease(); }