public CommodityTypes() : base() { InitializeComponent(); this.toolstripChild = this.toolStripChildForm; this.fastListIndex = this.fastCommodityTypeIndex; this.commodityTypeAPIs = new CommodityTypeAPIs(CommonNinject.Kernel.Get <ICommodityTypeAPIRepository>()); this.commodityTypeViewModel = CommonNinject.Kernel.Get <CommodityTypeViewModel>(); this.commodityTypeViewModel.PropertyChanged += new PropertyChangedEventHandler(ModelDTO_PropertyChanged); this.baseDTO = this.commodityTypeViewModel; }
protected override void InitializeCommonControlBinding() { base.InitializeCommonControlBinding(); this.treeWarehouseID.RootKeyValue = 0; this.treeCommodityID.RootKeyValue = 0; this.treeCommodityTypeID.RootKeyValue = 0; this.treeCustomerID.RootKeyValue = 0; this.treeEmployeeID.RootKeyValue = 0; this.treeWarehouseIssueID.RootKeyValue = 0; this.treeWarehouseReceiptID.RootKeyValue = 0; this.treeWarehouseAdjustmentTypeID.RootKeyValue = 0; WarehouseAPIs warehouseAPIs = new WarehouseAPIs(CommonNinject.Kernel.Get <IWarehouseAPIRepository>()); this.warehouseTrees = warehouseAPIs.GetWarehouseTrees(ContextAttributes.User.LocationID); this.treeWarehouseID.DataSource = new BindingSource(this.warehouseTrees, ""); this.warehouseIssueTrees = warehouseAPIs.GetWarehouseTrees(null); this.treeWarehouseIssueID.DataSource = new BindingSource(this.warehouseIssueTrees, ""); this.warehouseReceiptTrees = warehouseAPIs.GetWarehouseTrees(null); this.treeWarehouseReceiptID.DataSource = new BindingSource(this.warehouseReceiptTrees, ""); WarehouseAdjustmentTypeAPIs warehouseAdjustmentTypeAPIs = new WarehouseAdjustmentTypeAPIs(CommonNinject.Kernel.Get <IWarehouseAdjustmentTypeAPIRepository>()); this.warehouseAdjustmentTypeTrees = warehouseAdjustmentTypeAPIs.GetWarehouseAdjustmentTypeTrees(); this.treeWarehouseAdjustmentTypeID.DataSource = new BindingSource(this.warehouseAdjustmentTypeTrees, ""); CommodityAPIs commodityAPIs = new CommodityAPIs(CommonNinject.Kernel.Get <ICommodityAPIRepository>()); this.commodityTrees = commodityAPIs.GetCommodityTrees(); this.treeCommodityID.DataSource = new BindingSource(this.commodityTrees, ""); CommodityTypeAPIs commodityTypeAPIs = new CommodityTypeAPIs(CommonNinject.Kernel.Get <ICommodityTypeAPIRepository>()); this.commodityTypeTrees = commodityTypeAPIs.GetCommodityTypeTrees(); this.treeCommodityTypeID.DataSource = new BindingSource(this.commodityTypeTrees, ""); CustomerAPIs customerAPIs = new CustomerAPIs(CommonNinject.Kernel.Get <ICustomerAPIRepository>()); this.customerTrees = customerAPIs.GetCustomerTrees(); this.treeCustomerID.DataSource = new BindingSource(this.customerTrees, ""); EmployeeAPIs employeeAPIs = new EmployeeAPIs(CommonNinject.Kernel.Get <IEmployeeAPIRepository>()); this.employeeTrees = employeeAPIs.GetEmployeeTrees(); this.treeEmployeeID.DataSource = new BindingSource(this.employeeTrees, ""); this.comboSummaryVersusDetail.ComboBox.Items.AddRange(new string[] { "Summary only", "Show detail" }); this.comboSummaryVersusDetail.ComboBox.SelectedIndex = 0; this.comboQuantityVersusVolume.ComboBox.Items.AddRange(new string[] { "By quantity", "By volume" }); this.comboQuantityVersusVolume.ComboBox.SelectedIndex = 1; this.comboDateVersusMonth.ComboBox.Items.AddRange(new string[] { "Daily summary", "Monthly summary" }); this.comboDateVersusMonth.ComboBox.SelectedIndex = 1; this.comboSalesVersusPromotion.ComboBox.Items.AddRange(new string[] { "Sales & promotions", "Sales only", "Promotions only" }); this.comboSalesVersusPromotion.ComboBox.SelectedIndex = 0; this.comboForecastFilters.ComboBox.Items.AddRange(new string[] { "[All Items in Stock]", "[Current Stock + In Transit] > 0", "[Current Stock + In Transit] = 0", "[Current Stock + In Transit] < 0", "[Current Stock + In Transit] Between Low-High Level", "[Current Stock + In Transit] Out of Range Low-High Level", "[Current Stock + In Transit] Under Low-Level", "[Current Stock + In Transit] Over High-Level" }); this.comboForecastFilters.ComboBox.SelectedIndex = 0; this.comboSlowMoving.Items.AddRange(new string[] { "Regardless forecast", "And without forecast" }); this.comboSlowMoving.SelectedIndex = 0; UserControlAPIs userControlAPIs = new UserControlAPIs(CommonNinject.Kernel.Get <IUserControlAPIRepository>()); this.comboUserName.ComboBox.Items.Add("[All users]"); this.comboUserName.ComboBox.Items.AddRange(Array.ConvertAll(userControlAPIs.GetUserControlIndexes(GlobalEnums.ActiveOption.Both).ToArray(), u => u.UserName)); this.comboUserName.ComboBox.SelectedIndex = 0; this.dateTimexFromDate.DataBindings.Add("Value", GlobalEnums.GlobalOptionSetting, CommonExpressions.PropertyName <OptionSetting>(p => p.FromDate), true, DataSourceUpdateMode.OnPropertyChanged); this.dateTimexToDate.DataBindings.Add("Value", GlobalEnums.GlobalOptionSetting, CommonExpressions.PropertyName <OptionSetting>(p => p.ToDate), true, DataSourceUpdateMode.OnPropertyChanged); this.fastReportIndex.AboutToCreateGroups += fastReportIndex_AboutToCreateGroups; this.fastReportIndex.ShowGroups = true; //this.olvApproved.Renderer = new MappedImageRenderer(new Object[] { 1, Resources.Placeholder16, 2, Resources.Void_16 }); }