Пример #1
0
 void CreateNewNoteMethod(object arg)
 {
     FactoryManager myManager = new FactoryManager();
     myManager.GetNoteManager().CreateNewNote(note.NoteText, repair.RepairID);
     RefreshAction();
     CloseAction();
 }
Пример #2
0
 void SaveNewVendorMethod(object arg)
 {
     FactoryManager myManager = new FactoryManager();
     myManager.GetVendorManager().CreateNewVendor(vendor.Description, vendor.CompanyName);
     RefreshAction();
     CloseAction();
 }
Пример #3
0
        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;
        }
Пример #4
0
 void AssignNewRepairToVendorMethod(object arg)
 {
     FactoryManager myManager = new FactoryManager();
     myManager.GetVendorRepairManager().AssignVendorToRepair(repair.RepairID, selectedVendor.VendorID);
     RefreshAction();
     CloseAction();
 }
Пример #5
0
 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);
 }
Пример #6
0
 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;
 }
Пример #7
0
 void SaveNewRepairMethod(object arg)
 {
     FactoryManager myManager = new FactoryManager();
     myManager.GetRepairManager().CreateNewRepair(repair.Description, repair.PurchaseOrder, repair.QuoteNumber, repair.DueDate, selectedCustomer.CustomerId);
     RefreshAction();
     CloseAction();
 }
Пример #8
0
        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());
        }
Пример #9
0
 public void DeleteEntity()
 {
     FactoryManager myManager = new FactoryManager();
     myManager.GetRepairManager().DeleteRepair(this.repairID);
 }