public TicketDetailsPageViewModel() { // dch rkl 12/07/2016 catch exception try { _scheduledAppointment = App.Database.RetrieveCurrentScheduledAppointment(); if (_scheduledAppointment != null) { _workTicket = App.Database.GetWorkTicket(_scheduledAppointment); _customer = App.Database.GetAppCustomer(_salesOrderHeader.CustomerNo); _salesOrder = App.Database.GetSalesOrder(_workTicket, _customer); if (_workTicket.DtlRepairItemCode != null) { _repairItem = App.Database.GetItemFromDB(_workTicket.DtlRepairItemCode); } else { _repairItem = new CI_Item(); } JT_Technician jt_technician = App.Database.GetCurrentTechnicianFromDb(); _appTechnician = new App_Technician(jt_technician); AR_CustomerContact customerContact = App.Database.GetCustomerContact(_customer.ContactCode); _customerContact = new App_CustomerContact(customerContact); } } catch (Exception ex) { // dch rkl 12/07/2016 Log Error ErrorReporting errorReporting = new ErrorReporting(); errorReporting.sendException(ex, "TechDashboard.TicketDetailsPageViewModel()"); } }
public TicketDetailsPageViewModel(App_ScheduledAppointment scheduledAppointment) { _scheduledAppointment = scheduledAppointment; _workTicket = App.Database.GetWorkTicket(_scheduledAppointment); _customer = App.Database.GetAppCustomer(_workTicket); _salesOrder = App.Database.GetSalesOrder(_workTicket, _customer); if (_workTicket.DtlRepairItemCode != null) { _repairItem = App.Database.GetItemFromDB(_workTicket.DtlRepairItemCode); } else { _repairItem = new CI_Item(); } JT_Technician jt_technician = App.Database.GetCurrentTechnicianFromDb(); _appTechnician = new App_Technician(jt_technician); AR_CustomerContact customerContact = App.Database.GetCustomerContact(_customer.ContactCode); _customerContact = new App_CustomerContact(customerContact); }