void CreateNewNoteMethod(object arg) { FactoryManager myManager = new FactoryManager(); myManager.GetNoteManager().CreateNewNote(note.NoteText, repair.RepairID); RefreshAction(); CloseAction(); }
void SaveNewVendorMethod(object arg) { FactoryManager myManager = new FactoryManager(); myManager.GetVendorManager().CreateNewVendor(vendor.Description, vendor.CompanyName); RefreshAction(); CloseAction(); }
public void RefreshRepairs() { ObservableCollection<RepairViewModel> repairs = new ObservableCollection<RepairViewModel>(); FactoryManager myManager = new FactoryManager(); var result = myManager.GetRepairManager().GetAllNotCompletedRepairsAndTheirVendors(); foreach (RepairDTO repair in result) { repairs.Add( new RepairViewModel() { RepairID = repair.ID, Description = repair.Description, PurchaseOrder = repair.PurchaseOrder, QuoteNumber = repair.QuoteNumber, Completed = repair.Completed, DateCreated = repair.DateCreatedAsUtcTime, DateCompleted = repair.DateCompleted, DueDate = repair.DueDate, Customer = new CustomerViewModel { CustomerId = repair.Customer.ID, CompanyName = repair.Customer.CompanyName }, VendorRepairs = new ObservableCollection<VendorRepairViewModel>((from vendorRepair in repair.VendorRepairs where vendorRepair.Completed == false select new VendorRepairViewModel { VendorID = vendorRepair.VendorID, RepairID = vendorRepair.RepairID, Completed = vendorRepair.Completed, DateCreatedAsUtcTime = vendorRepair.DateCreatedAsUtcTime, Vendor = new VendorViewModel() { VendorID = vendorRepair.Vendor.ID, CompanyName = vendorRepair.Vendor.CompanyName, } }).ToList()) }); } this.Repairs = repairs; }
void AssignNewRepairToVendorMethod(object arg) { FactoryManager myManager = new FactoryManager(); myManager.GetVendorRepairManager().AssignVendorToRepair(repair.RepairID, selectedVendor.VendorID); RefreshAction(); CloseAction(); }
void RefreshVendorList() { FactoryManager myManager = new FactoryManager(); var result = myManager.GetVendorManager().GetVendorList(); List<VendorViewModel> vendorResult = new List<VendorViewModel>(); foreach (VendorDTO vendor in result) { vendorResult.Add(new VendorViewModel() { VendorID = vendor.ID, CompanyName = vendor.CompanyName }); } vendors = new ObservableCollection<VendorViewModel>(vendorResult); }
public void GetCustomerList() { ObservableCollection<CustomerViewModel> customers = new ObservableCollection<CustomerViewModel>(); FactoryManager myManager = new FactoryManager(); foreach (var item in myManager.GetCustomerManager().GetAllCustomers()) { customers.Add( new CustomerViewModel() { CustomerId = item.ID, CompanyName = item.CompanyName }); } this.Customers = customers; }
void SaveNewRepairMethod(object arg) { FactoryManager myManager = new FactoryManager(); myManager.GetRepairManager().CreateNewRepair(repair.Description, repair.PurchaseOrder, repair.QuoteNumber, repair.DueDate, selectedCustomer.CustomerId); RefreshAction(); CloseAction(); }
void PopulateNotes() { FactoryManager myManager = new FactoryManager(); List<NoteDTO> result = myManager.GetNoteManager().GetNotesByRepair(this.repairID); notes = new ObservableCollection<NoteViewModel>((from note in result select new NoteViewModel() { NoteID = note.ID, NoteText = note.NoteText, DateCreatedAsUtcTime = note.DateCreatedAsUtcTime, RepairID = note.RepairID }).ToList()); }
public void DeleteEntity() { FactoryManager myManager = new FactoryManager(); myManager.GetRepairManager().DeleteRepair(this.repairID); }