public InventoryLookupItem(Inventory inventory, BadgerDataModel ctx) { if (inventory == null) { return; } _context = ctx; jobService = new JobsService(_context); orderService = new OrdersService(_context); recieptService = new OrderRecieptService(_context); employeeService = new EmployeeService(_context); po = orderService.GetOrderByID(recieptService.GetOrderReciept (inventory.OrderReceiptID.Value).OrderNum.Value); job = jobService.Find(inventory.JobId.Value); receipt = recieptService.GetOrderReciept(inventory.OrderReceiptID.Value); emp = employeeService.Find(receipt.EmployeeId.Value); orderNum = po.OrderNum.ToString(); orderDate = po.OrderDate.Value.ToShortDateString(); jobName = job.Jobname.ToString(); quantity = inventory.Qnty.ToString(); unitCost = "0.0"; itemDescription = inventory.Description; supplierName = po.Supplier.SupplierName.ToString(); receivedDate = receipt.ReceiptDate.Value.ToShortDateString(); receivedBy = emp.Firstname + " " + emp.Lastname; orderedBy = po.Employee.Firstname.ToString() + " " + po.Employee.Lastname.ToString(); }
public OrderReceiptsControl(BadgerDataModel Context) { InitializeComponent(); dgRecieptItems.AutoGenerateColumns = false; context = Context; ordersService = new OrderRecieptService(context); suppliersService = new SuppliersService(context); jobsService = new JobsService(context); inventoryService = new InventoryService(context); poService = new OrdersService(context); empService = new EmployeeService(context); }