public void GetAllPozitieFacturaIesireTest() { var target = PozitieFacturaIesire.GetAll(); if (target == null) { Assert.Fail(); } }
private void facturiGrid_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex == facturiGrid.Columns["btnColumn"].Index) { var factura = (FacturaIesire)facturiGrid.Rows[e.RowIndex].Tag; new ReportViewerForm { FacturaIesire = factura, PozitiiFacturaIesire = PozitieFacturaIesire.GetAll().Where(p => p.IdFacturaIesire == factura.ID).ToList() }.Show(); } }
private void MakeChartWithProdus(Produs produs, DateTime beginDate, DateTime endDate, IntervalType interval = IntervalType.Zilnic) { string comparer = ""; switch (interval) { case IntervalType.Zilnic: comparer = "dd/MM/yyyy"; break; case IntervalType.Lunar: comparer = "MM/yyyy"; break; } chartVanzari.Series.Clear(); var vanzariPeProdus = new List <VanzareProdus>(); while (beginDate.Date <= endDate.Date) { var result = from poz in PozitieFacturaIesire.GetAll() where poz.FacturaIesireObject.Data.ToString(comparer) == beginDate.Date.ToString(comparer) && poz.StocObject.IdProdus == produs.ID group poz by poz.FacturaIesireObject.Data.ToString(comparer) into poz_nou select new VanzareProdus { Cantitate = poz_nou.Sum(p => p.Cantitate).ToString("0.00"), DataVanzarii = beginDate.Date.ToString(comparer) }; VanzareProdus vanzare = null; vanzare = result.FirstOrDefault() == null ? new VanzareProdus { Cantitate = "0", DataVanzarii = beginDate.Date.ToString(comparer) } : result.FirstOrDefault(); vanzariPeProdus.Add(vanzare); switch (interval) { case IntervalType.Zilnic: beginDate = beginDate.AddDays(1); break; case IntervalType.Lunar: beginDate = beginDate.AddMonths(1); break; } } var series = new Series(produs.Nume); series.XValueMember = "DataVanzarii"; series.XValueType = ChartValueType.Date; series.YValueMembers = "Cantitate"; series.YValueType = ChartValueType.String; chartVanzari.DataSource = vanzariPeProdus.ToList(); chartVanzari.Series.Add(series); }
private void LoadData() { progressBar.Invoke(new UpdateDelegate(UpdateProgressBar)); runningOperationLbl.Text = "Se incarca bancile..."; Banca.GetAll(); progressBar.Invoke(new UpdateDelegate(UpdateProgressBar)); runningOperationLbl.Text = "Se incarca delegatii..."; Delegat.GetAll(); progressBar.Invoke(new UpdateDelegate(UpdateProgressBar)); runningOperationLbl.Text = "Se incarca drepturile..."; Drept.GetAll(); progressBar.Invoke(new UpdateDelegate(UpdateProgressBar)); runningOperationLbl.Text = "Se incarca facturile..."; FacturaIntrare.GetAll(); progressBar.Invoke(new UpdateDelegate(UpdateProgressBar)); runningOperationLbl.Text = "Se incarca facturile..."; FacturaIesire.GetAll(); progressBar.Invoke(new UpdateDelegate(UpdateProgressBar)); runningOperationLbl.Text = "Se incarca firmele..."; Firma.GetAll(); progressBar.Invoke(new UpdateDelegate(UpdateProgressBar)); runningOperationLbl.Text = "Se incarca platile..."; Plata.GetAll(); progressBar.Invoke(new UpdateDelegate(UpdateProgressBar)); runningOperationLbl.Text = "Se incarca platile..."; PlataFactura.GetAll(); progressBar.Invoke(new UpdateDelegate(UpdateProgressBar)); runningOperationLbl.Text = "Se incarca platile..."; PozitieFacturaIesire.GetAll(); progressBar.Invoke(new UpdateDelegate(UpdateProgressBar)); runningOperationLbl.Text = "Se incarca platile..."; PozitieFacturaIntrare.GetAll(); progressBar.Invoke(new UpdateDelegate(UpdateProgressBar)); runningOperationLbl.Text = "Se incarca produsele..."; Produs.GetAll(); progressBar.Invoke(new UpdateDelegate(UpdateProgressBar)); runningOperationLbl.Text = "Se incarca rolurile..."; Rol.GetAll(); progressBar.Invoke(new UpdateDelegate(UpdateProgressBar)); runningOperationLbl.Text = "Se incarca platile..."; RolDrept.GetAll(); progressBar.Invoke(new UpdateDelegate(UpdateProgressBar)); runningOperationLbl.Text = "Se incarca stocurile..."; Stoc.GetAll(); progressBar.Invoke(new UpdateDelegate(UpdateProgressBar)); runningOperationLbl.Text = "Se incarca utilizatorii..."; Utilizator.GetAll(); }