public ResoModel(NotaCreditoDto notaCredito) { InitializeComponent(); try { this.notaCredito = notaCredito; } catch (Exception ex) { UtilityError.Write(ex); } }
private void BindViewNotaCredito(NotaCreditoDto notaCredito) { try { editNotaCredito.Model = notaCredito; editNotaCredito.Value = BusinessLogic.Fattura.GetCodifica(notaCredito); } catch (Exception ex) { UtilityError.Write(ex); } }
public static string GetCodifica(NotaCreditoDto notaCredito) { try { if (notaCredito != null) { string codfica = notaCredito.Numero + " DEL " + UtilityValidation.GetDataND(notaCredito.Data); return codfica; } } catch (Exception ex) { UtilityError.Write(ex); } return null; }
public ResoView(WcfService.Dto.NotaCreditoDto notaCredito) { InitializeComponent(); try { this.notaCredito = notaCredito; var viewModel = (Reso.ResoViewModel)ViewModel; if (viewModel != null) { viewModel.NotaCredito = notaCredito; } } catch (Exception ex) { UtilityError.Write(ex); } }
public static string GetCodice(NotaCreditoDto notaCredito) { try { if (notaCredito != null) { var progressivo = 1; var resi = notaCredito.Resos; if (resi != null) progressivo = resi.Count + 1; var codice = notaCredito.Numero + "/" + DateTime.Today.Year.ToString() + "/" + progressivo.ToString("000"); //numerofattura/anno/progressivo return codice; } } catch (Exception ex) { UtilityError.Write(ex); } return null; }
public static decimal GetIVANotaCredito(NotaCreditoDto notaCredito, DateTime data) { try { if (notaCredito != null && notaCredito.Resos != null) { var resi = (from q in notaCredito.Resos where q.Data <= data select q); if (resi != null) { decimal IVA = 0; foreach (var reso in resi) { var iva = UtilityValidation.GetDecimal(reso.IVA); IVA += iva; } return IVA; } } } catch (Exception ex) { UtilityError.Write(ex); } return 0; }
public static decimal GetImponibileNotaCredito(NotaCreditoDto notaCredito, DateTime data) { try { if (notaCredito != null && notaCredito.Resos != null) { var resi = (from q in notaCredito.Resos where q.Data <= data select q); if (resi != null) { decimal imponibile = 0; foreach (var reso in resi) { var importo = UtilityValidation.GetDecimal(reso.Importo); imponibile += importo; } return imponibile; } } } catch (Exception ex) { UtilityError.Write(ex); } return 0; }
private void BindViewCodiceNotaCredito(NotaCreditoDto notaCredito) { try { var codice = BusinessLogic.Reso.GetCodice(notaCredito); editCodice.Value = codice; } catch (Exception ex) { UtilityError.Write(ex); } }
private void BindViewTotali(NotaCreditoDto obj) { try { if (obj != null) { var data = UtilityValidation.GetData(editData.Value); editImponibile.Value = BusinessLogic.Fattura.GetImponibileNotaCredito(obj, data); editIVA.Value = BusinessLogic.Fattura.GetIVANotaCredito(obj, data); editTotale.Value = BusinessLogic.Fattura.GetTotaleNotaCredito(obj, data); } } catch (Exception ex) { UtilityError.Write(ex); } }
/// <summary> /// Deletes notacredito from the database by the given dto object. /// </summary> /// <param name="notacredito">The dto object.</param> public void DeleteNotaCredito(NotaCreditoDto notacredito) { this.NotaCreditoService.Delete(notacredito); this.UnitOfWork.SaveChanges(); }
/// <summary> /// Adds a new notacredito from the given dto object into the database. /// </summary> /// <param name="notacredito">The dto object.</param> /// <returns>The dto key of the newly created notacredito.</returns> public string CreateNotaCredito(NotaCreditoDto notacredito) { string key = this.NotaCreditoService.Add(notacredito); this.UnitOfWork.SaveChanges(); return key; }
public ResoDto(int _id, int _notaCreditoId, DateTime? _data, decimal? _importo, string _note, string _codice, string _descrizione, int _fatturaAcquistoId, decimal? _iVA, decimal? _totale, NotaCreditoDto _notaCredito, FatturaAcquistoDto _fatturaAcquisto) { this.Id = _id; this.NotaCreditoId = _notaCreditoId; this.Data = _data; this.Importo = _importo; this.Note = _note; this.Codice = _codice; this.Descrizione = _descrizione; this.FatturaAcquistoId = _fatturaAcquistoId; this.IVA = _iVA; this.Totale = _totale; this.NotaCredito = _notaCredito; this.FatturaAcquisto = _fatturaAcquisto; }