public HostingUnitDetails(BO.HostingUnit hostingUnit, BlApi.IBl bl) { InitializeComponent(); this.bl = bl; HostingUnit = hostingUnit; calendarDates = new List <CalendarDateRange>(); setBlackOutDates(HostingUnit); MainGrid.DataContext = HostingUnit; OrdersDataGrid.ItemsSource = bl.GetOrdersOfHost(hostingUnit.Owner).Where(x => x.HostingUnit.Key == hostingUnit.Key && x.Status == BO.Order_Status.APPROVED); MonthlyProgressBar.Value = Math.Round(CalculateMonthlyPercentage(), 2); TotalProgressBar.Value = Math.Round(CalculateTotalPercentage(), 2); }
public static BO.Host CastingToBOHost(DO.Host host) { BO.Host bHost = new BO.Host(); bHost.Person = new Person(); bHost.Person = imp.GetPerson(host.HostID); bHost.BankBranch = imp.GetBankBranch(host.BranchNumber); bHost.BankAccuontNumber = host.BankAccuontNumber; bHost.CollectionClearance = host.CollectionClearance; bHost.Status = (BO.Status)host.Status; bHost.TotalCommission = host.TotalCommission; bHost.HostingUnits = imp.GetHostingUnitsOfHost(host.HostID); bHost.Orders = imp.GetOrdersOfHost(host.HostID); bHost.Website = host.Website; return(bHost); }
public MainHostPage(BlApi.IBl bl, BO.Host host) { InitializeComponent(); this.bl = bl; this.Host = host; UpdateHostGrid.DataContext = Host; HostId = Host.Person.Id; try { this.Host.HostingUnits = bl.GetHostingUnitsOfHost(HostId); this.Host.Orders = bl.GetOrdersOfHost(HostId); } catch { this.Host.HostingUnits = new List <BO.HostingUnit>(); this.Host.Orders = new List <BO.Order>(); } }