Beispiel #1
0
        private void GetTotalPurchaseAmountChart()
        {
            try
            {
                ChartHeader     = "Purchase Total";
                PlotModel.Title = ChartHeader;
                var dataPerDetector = StockIns.OrderBy(m => m.PurchaseDate).GroupBy(m => m.PurchaseDate).
                                      Select(g => new { Total = g.Sum(p => p.UnitPrice * p.Quantity), date = g.Key }).ToList();

                var lineSerie = new OxyPlot.Series.LineSeries
                {
                    // LabelFormatString = dataPerDetector.Select(a=>a.Total).FirstOrDefault().ToString(),
                    StrokeThickness = 1,
                    MarkerSize      = 3,
                    // MarkerStroke = OxyColors.Red,
                    MarkerType = MarkerType.Diamond,
                    CanTrackerInterpolatePoints = false,
                    Title  = "Total Purchase",
                    Smooth = false,
                };
                foreach (var item in dataPerDetector)
                {
                    lineSerie.Points.Add(new DataPoint(OxyPlot.Axes.DateTimeAxis.ToDouble(item.date), (double)item.Total));
                }


                PlotModel.Series.Add(lineSerie);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Beispiel #2
0
        protected void saveButton_Click(object sender, EventArgs e)
        {
            try
            {
                StockIns aStockIn = new StockIns();
                aStockIn.CompanySl       = Convert.ToInt32(companyDropDownList.SelectedValue);
                aStockIn.ItemNo          = Convert.ToInt32(itemNameDropDownList.SelectedValue);
                aStockIn.StockInQuantity = Convert.ToInt32(StockInQuantityTextBox.Text);
                if (companyDropDownList.SelectedIndex == 0)
                {
                    Literal1.Text = "<script>alert('Please select Company!!!');</script>";
                    return;
                }
                if (itemNameDropDownList.SelectedIndex == 0)
                {
                    Literal1.Text = "<script>alert('Please select Item!!!');</script>";
                    return;
                }

                Literal1.Text = aStockInManager.Save(aStockIn);

                companyDropDownList.SelectedIndex  = -1;
                itemNameDropDownList.SelectedIndex = -1;
                reorderLevelTextBox.Text           = "";
                availableQuantityTextBox.Text      = "";
                StockInQuantityTextBox.Text        = "";
            }
            catch (Exception ex1)
            {
                Literal1.Text = ex1.Message;
            }
        }