private void SendRequestForRelease() { _Client = new Clients(_FuelOrder.AdminClientID); _Customer.Contacts = new ContactsCollection(); _Customer.Contacts.LoadByCustClientID(_Customer.CustClientID); try { if (_Customer.Contacts.Count > 0) { if (!string.IsNullOrEmpty(_Customer.Email) && !_Customer.Email.EndsWith(";")) { _Customer.Email += ";"; } foreach (Contacts contact in _Customer.Contacts) { if (!contact.Distribute || string.IsNullOrEmpty(contact.Email)) { continue; } _Customer.Email += contact.Email + ";"; } } _FuelOrder.Aircraft = Aircrafts.GetAircraft(_FuelOrder.AircraftID); _FuelOrder.Aircraft.MakeAndModel = AircraftData.GetAircraftData(_FuelOrder.Aircraft.MakeModelID); CreateAndSendEmail(); } catch (Exception e) { ErrorLog EL = new ErrorLog(e); EL.UserID = _FuelOrder.CustClientID; EL.URL = "SendFuelOrderVendorDispatchRequestForRelease, ID: " + _FuelOrder.Id.ToString(); EL.LogError(); } }
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 static Aircrafts GetAircraft(int id) { return(Aircrafts.GetAircraft(id)); }