private void addBtn_Click(object sender, EventArgs e) { var pozitieIn = new PozitieFacturaIntrare(); decimal value = 0m; decimal.TryParse(cantitateTbox.Text, out value); pozitieIn.Cantitate = value; pozitieIn.IdFacturaIntrare = 2; // doar ca sa nu dea mesaj decimal.TryParse(pretUnitarTbox.Text, out value); pozitieIn.PretUnitar = value; pozitieIn.IdProdus = SelectedProdus == null ? 0 : SelectedProdus.ID; var errors = pozitieIn.GetErrorString(); if (errors.Trim() == string.Empty) { DataGridViewRow row = new DataGridViewRow(); row.Tag = pozitieIn; row.CreateCells(pozitieFacturaIntrareGrid, pozitieIn.ProdusObject.Nume, pozitieIn.Cantitate, pozitieIn.PretUnitar.ToString("0.00")); pozitieFacturaIntrareGrid.Rows.Add(row); } else { MessageBox.Show(errors); } }
public void GetAllPozitieFacturaIntrareTest() { var list = PozitieFacturaIntrare.GetAll(); if (list == null) { Assert.Fail(); } }
private void facturiGrid_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex == facturiGrid.Columns["btnColumn"].Index) { var factura = (FacturaIntrare)facturiGrid.Rows[e.RowIndex].Tag; new ReportViewerForm { FacturaIntrare = factura, PozitiiFacturaIntrare = PozitieFacturaIntrare.GetAll().Where(p => p.IdFacturaIntrare == factura.ID).ToList() }.Show(); } }
public void InsertPozitieFacturaIntrareTest() { PozitieFacturaIntrare target = new PozitieFacturaIntrare { Cantitate = 130m, IdFacturaIntrare = 25, IdProdus = 1, PretUnitar = 15 }; if (target.Save().Status == StatusEnum.Errors) { Assert.Fail(); } }
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(); }