private void listbox_Orders_DoubleClick(object sender, EventArgs e) { OrderBuy orderBuy = listbox_Orders.SelectedItem as OrderBuy; OrderBuyToForm(orderBuy); ClientToForm(orderBuy.Client); ProductToForm(orderBuy.Product); DesignToForm(orderBuy.CarDesign); listbox_Clients.SelectedValue = orderBuy.Client.Id; listbox_Cars.SelectedValue = orderBuy.Product.Id; listbox_Designs.SelectedValue = orderBuy.CarDesign.Id; CarExtraArr carExtraArrInOrder = new CarExtraArr(); OrderDetailsBuyArr orderDetailsBuyArr = new OrderDetailsBuyArr(); orderDetailsBuyArr.Fill(); orderDetailsBuyArr = orderDetailsBuyArr.Filter(orderBuy); carExtraArrInOrder = orderDetailsBuyArr.GetCarExtraArr(); CarExtraArrToForm(carExtraArrInOrder, listbox_InOrder); CarExtraArr carExtraArrNotInOrder = new CarExtraArr(); carExtraArrNotInOrder.Fill(); carExtraArrNotInOrder.Remove(carExtraArrInOrder); CarExtraArrToForm(carExtraArrNotInOrder, listbox_Potential); }
public CarExtraArr GetCarExtraBuy(PayBuy payBuy) { OrderBuy order = payBuy.Order; OrderDetailsBuyArr orderDetailsBuyArr = new OrderDetailsBuyArr(); orderDetailsBuyArr.Fill(); orderDetailsBuyArr = orderDetailsBuyArr.Filter(order); return(orderDetailsBuyArr.GetCarExtraArr()); }
public void CarExtraBuyToChart(DateTime dt) { RadioButton(true); chart1.Palette = ChartColorPalette.SeaGreen; chart1.ChartAreas[0].AxisX.LabelStyle.Interval = 1; chart1.Titles.Clear(); chart1.Titles.Add("Distribution"); SortedDictionary <string, int> dictionary = new SortedDictionary <string, int>(); OrderDetailsBuyArr detailsBuy = new OrderDetailsBuyArr(); detailsBuy.Fill(); CarExtraArr carExtraArr = detailsBuy.GetCarExtraArr(); foreach (CarExtra extra in carExtraArr) { Count = detailsBuy.Filter(extra, dt).Count; if (Count > 0) { dictionary.Add(extra.Name, Count); } } Series series = new Series("Car Extra", carExtraArr.Count); series.ChartType = SeriesChartType.Column; series.Label = "[#PERCENT{P0}]"; series.Points.DataBindXY(dictionary.Keys, dictionary.Values); chart1.Series.Clear(); chart1.Series.Add(series); }