コード例 #1
0
 private void BindViewAzienda(AziendaDto azienda)
 {
     try
     {
         editAzienda.Model = azienda;
         editAzienda.Value = BusinessLogic.Azienda.GetCodifica(azienda);
     }
     catch (Exception ex)
     {
         UtilityError.Write(ex);
     }
 }
コード例 #2
0
ファイル: Azienda.cs プロジェクト: es-dev/cantieri
 public static string GetCodifica(AziendaDto azienda)
 {
     try
     {
         if(azienda!=null)
         {
             var codifica = azienda.Codice + " - " + azienda.RagioneSociale;
             return codifica;
         }
     }
     catch (Exception ex)
     {
         UtilityError.Write(ex);
     }
     return null;
 }
コード例 #3
0
ファイル: Notifica.cs プロジェクト: es-dev/cantieri
        internal static NotificaDto GetNewNotifica(AziendaDto azienda, Tipi.TipoReport tipoReport, string applicazione)
        {
            try
            {
                if (azienda != null)
                {
                    var notifica = new NotificaDto();
                    notifica.Applicazione = applicazione;
                    notifica.Codice = "Id=Report";
                    notifica.Tipo = tipoReport.ToString();
                    notifica.Data = DateTime.Now;

                    return notifica;
                }
            }
            catch (Exception ex)
            {
                UtilityError.Write(ex);
            }
            return null;
        }
コード例 #4
0
ファイル: WorkAction.cs プロジェクト: es-dev/cantieri
        private string GetBodyNotificaReport(AziendaDto azienda, DateTime elaborazione, string url, Tipi.TipoReport tipoReport)
        {
            try
            {
                var pathRoot = UtilityWeb.GetRootPath(context);
                var templateName = "";
                if (tipoReport == Tipi.TipoReport.Committenti)
                    templateName = "TemplateReportCommittenti.html";
                else if(tipoReport == Tipi.TipoReport.Fornitori)
                    templateName = "TemplateReportFornitori.html";

                var pathTemplateReport = pathRoot + @"\Resources\Templates\"+ templateName;
                var content = System.IO.File.ReadAllText(pathTemplateReport);
                var codificaAzienda = BusinessLogic.Azienda.GetCodifica(azienda);
                content = content.Replace("$elaborazione$", elaborazione.ToString("dd/MM/yyyy"));
                content = content.Replace("$url$", url);
                content = content.Replace("$codificaAzienda$", codificaAzienda);

                return content;
            }
            catch (Exception ex)
            {
                UtilityError.Write(ex);
            }
            return null;
        }
コード例 #5
0
	    /// <summary>
	    /// Deletes azienda from the database by the given dto object.
	    /// </summary>
	    /// <param name="azienda">The dto object.</param>
	    public void DeleteAzienda(AziendaDto azienda)
	    {
	        this.AziendaService.Delete(azienda);
	        this.UnitOfWork.SaveChanges();		
	    }
コード例 #6
0
ファイル: ReportJob.cs プロジェクト: es-dev/cantieri
        public static UtilityReport.Report GetReportCommittenti(AziendaDto azienda, IList<AnagraficaCommittenteDto> anagraficheCommittenti, IList<CommittenteDto> committenti, DateTime data)
        {
            try
            {
                if (azienda != null && anagraficheCommittenti != null && committenti != null)
                {
                    var report = new UtilityReport.Report();

                    var committentiAvere = GetCommittentiAvere(committenti, data);
                    var anagraficheCommittentiAvere = GetAnagraficheCommittentiAvere(anagraficheCommittenti, committentiAvere);
                    if (anagraficheCommittentiAvere != null)
                    {
                        AddReportAzienda(azienda, report, data);
                        AddReportProspettoCommittenti(anagraficheCommittentiAvere, committentiAvere, report);

                        var tableCommittenti = new UtilityReport.Table("RagioneSociale", "TotaleFatture", "TotaleIncassiAvuto", "TotaleIncassiAvere");
                        var tableFatture = new UtilityReport.Table("Numero", "Data", "Scadenza", "Descrizione", "Imponibile", "IVA", "Totale", "TotaleIncassiAvuto", "TotaleIncassiAvere");
                        var tableIncassi = new UtilityReport.Table("Numero", "Data", "TipoPagamento", "Descrizione", "Note", "TransazionePagamento", "Importo");

                        foreach (var anagraficaCommittente in anagraficheCommittentiAvere)
                        {
                            var committentiAnagrafica = (from q in committentiAvere where q.AnagraficaCommittenteId == anagraficaCommittente.Id select q).ToList();
                            if (committentiAnagrafica != null && committentiAnagrafica.Count >= 1)
                            {
                                AddReportCommittente(tableCommittenti, anagraficaCommittente, committentiAnagrafica, data);

                                var codificaCommittente = "COMMITTENTE " + BusinessLogic.Committente.GetCodifica(anagraficaCommittente);
                                tableFatture.AddRowMerge(Color.LightGray, codificaCommittente, "", "", "", "", "", "", "", "");
                                foreach (var committente in committentiAnagrafica)
                                {
                                    //fatture per committente
                                    var fattureVendita = committente.FatturaVenditas;
                                    var fattureVenditaAvere = GetFattureVenditaAvere(fattureVendita, data);
                                    if (fattureVenditaAvere != null)
                                    {
                                        foreach (var fatturaVendita in fattureVenditaAvere)
                                        {
                                            AddReportFatturaVenditaCommittente(tableFatture, fatturaVendita, data);

                                            //pagamenti per fattura
                                            var totaleFattura = UtilityValidation.GetEuro(fatturaVendita.Totale);
                                            var _statoFattura = BusinessLogic.Fattura.GetStato(fatturaVendita);
                                            var statoFattura = UtilityEnum.GetDescription<Tipi.StatoFattura>(_statoFattura);
                                            var codificaFattura = "FATTURA " + BusinessLogic.Fattura.GetCodifica(fatturaVendita) + " - TOTALE IVATO " + totaleFattura + " - " + statoFattura.ToUpper() + " | " + codificaCommittente;
                                            tableIncassi.AddRowMerge(Color.LightGray, codificaFattura, "", "", "", "", "", "");
                                            var incassi = (from q in fatturaVendita.Incassos orderby q.Data ascending select q).ToList();
                                            if (incassi != null)
                                            {
                                                foreach (var incasso in incassi)
                                                    AddReportIncassoCommittente(tableIncassi, incasso);
                                            }
                                        }
                                    }
                                }
                            }
                        }
                        report.Tables.Add(tableCommittenti);
                        report.Tables.Add(tableFatture);
                        report.Tables.Add(tableIncassi);
                    }
                    return report;
                }
            }
            catch (Exception ex)
            {
                UtilityError.Write(ex);
            }
            return null;
        }
コード例 #7
0
	    /// <summary>
	    /// Adds a new azienda from the given dto object into the database.
	    /// </summary>
	    /// <param name="azienda">The dto object.</param>
	    /// <returns>The dto key of the newly created azienda.</returns>
	    public string CreateAzienda(AziendaDto azienda)
	    {
	        string key = this.AziendaService.Add(azienda);
	        this.UnitOfWork.SaveChanges();
	        return key;
	    }
コード例 #8
0
ファイル: ReportJob.cs プロジェクト: es-dev/cantieri
 private static void AddReportAzienda(AziendaDto azienda, UtilityReport.Report report, DateTime data)
 {
     try
     {
         if (azienda != null)
         {
             report.AddData("RagioneSocialeAzienda", azienda.RagioneSociale);
             report.AddData("IndirizzoAzienda", azienda.Indirizzo + " " + azienda.CAP + " " + azienda.Comune + " (" + azienda.Provincia + ")");
             report.AddData("TelefonoAzienda", azienda.Telefono, TypeFormat.StringND);
             report.AddData("EmailAzienda", azienda.Email, TypeFormat.StringND);
             report.AddData("PartitaIvaAzienda", azienda.PartitaIva, TypeFormat.StringND);
             report.AddData("Elaborazione", data, TypeFormat.DateDDMMYYYY);
         }
     }
     catch (Exception ex)
     {
         UtilityError.Write(ex);
     }
 }
コード例 #9
0
ファイル: ReportJob.cs プロジェクト: es-dev/cantieri
        public static UtilityReport.Report GetReportFornitore(AziendaDto azienda, AnagraficaFornitoreDto anagraficaFornitore, IList<FornitoreDto> fornitori, DateTime data)
        {
            try
            {
                if (azienda!=null && fornitori != null && anagraficaFornitore!=null)
                {
                    var report = new UtilityReport.Report();

                    AddReportAzienda(azienda, report, data);
                    AddReportProspettoFornitore(anagraficaFornitore, report);
                    AddReportTotaliFornitore(fornitori, report, data);

                    var tableCommesse = new UtilityReport.Table("Commessa", "TotaleImponibile", "TotaleIVA", "TotaleFatture", "TotalePagamentiDato", "TotalePagamentiDare");
                    var tableFatture = new UtilityReport.Table("Numero", "Data", "Scadenza", "Descrizione", "Imponibile", "IVA", "Totale", "TotalePagamentiDato", "TotalePagamentiDare");
                    var tablePagamenti = new UtilityReport.Table("Numero", "Data", "TipoPagamento", "Descrizione", "Note", "TransazionePagamento", "Importo");
                    foreach (var fornitore in fornitori)
                    {
                        //totali per commessa
                        var commessa = fornitore.Commessa;
                        AddReportCommessaFornitore(tableCommesse, fornitore, commessa, data);

                        //fatture per commessa
                        var codificaCommessa = "COMMESSA " + BusinessLogic.Commessa.GetCodifica(commessa);
                        tableFatture.AddRowMerge(Color.LightGray, codificaCommessa, "", "", "", "", "", "", "", "");
                        var fattureAcquisto = fornitore.FatturaAcquistos;
                        if (fattureAcquisto != null)
                        {
                            foreach (var fatturaAcquisto in fattureAcquisto)
                            {
                                AddReportFatturaAcquistoFornitore(tableFatture, fatturaAcquisto, data);

                                //pagamenti per fattura
                                var totaleFattura = UtilityValidation.GetEuro(fatturaAcquisto.Totale);
                                var _statoFattura = BusinessLogic.Fattura.GetStato(fatturaAcquisto);
                                var statoFattura = UtilityEnum.GetDescription<Tipi.StatoFattura>(_statoFattura);
                                var codificaFattura = "FATTURA " + BusinessLogic.Fattura.GetCodifica(fatturaAcquisto) + " - TOTALE IVATO " + totaleFattura + " - " + statoFattura.ToUpper();
                                tablePagamenti.AddRowMerge(Color.LightGray, codificaFattura, "", "", "", "", "", "");
                                var pagamenti = (from q in fatturaAcquisto.Pagamentos orderby q.Data ascending select q).ToList();
                                if (pagamenti != null)
                                {
                                    foreach (var pagamento in pagamenti)
                                        AddReportPagamentoFornitore(tablePagamenti, pagamento);
                                }
                                //sconto
                                var _sconto = UtilityValidation.GetDecimal(fatturaAcquisto.Sconto);
                                if (_sconto > 0)
                                {
                                    var sconto = UtilityValidation.GetEuro(_sconto);
                                    tablePagamenti.AddRow("", "", "", "", "", "SCONTO", sconto);
                                }

                                //nota di credito/resi
                                var _totaleResi = BusinessLogic.Fattura.GetTotaleResi(fatturaAcquisto);
                                if (_totaleResi > 0)
                                {
                                    var totaleResi = UtilityValidation.GetEuro(_totaleResi);
                                    tablePagamenti.AddRow("", "", "", "", "", "NOTA DI CREDITO", totaleResi);
                                }
                            }
                        }
                    }
                    report.Tables.Add(tableCommesse);
                    report.Tables.Add(tableFatture);
                    report.Tables.Add(tablePagamenti);

                    return report;
                }
            }
            catch (Exception ex)
            {
                UtilityError.Write(ex);
            }
            return null;
        }
コード例 #10
0
ファイル: Transport.cs プロジェクト: es-dev/cantieri
		public CentroCostoDto(int _id, string _codice, string _denominazione, string _note, int _aziendaId, AziendaDto _azienda, IList<FatturaAcquistoDto> _fatturaAcquistos)
		{
			this.Id = _id;
			this.Codice = _codice;
			this.Denominazione = _denominazione;
			this.Note = _note;
			this.AziendaId = _aziendaId;
			this.Azienda = _azienda;
			this.FatturaAcquistos = _fatturaAcquistos;
		}
コード例 #11
0
ファイル: Transport.cs プロジェクト: es-dev/cantieri
		public AnagraficaCommittenteDto(int _id, string _ragioneSociale, string _indirizzo, string _cAP, string _comune, string _provincia, string _telefono, string _mobile, string _fax, string _email, string _partitaIva, string _codice, string _codiceCatastale, string _localita, string _note, int _aziendaId, AziendaDto _azienda, IList<CommittenteDto> _committentes, IList<ReportJobDto> _reportJobs)
		{
			this.Id = _id;
			this.RagioneSociale = _ragioneSociale;
			this.Indirizzo = _indirizzo;
			this.CAP = _cAP;
			this.Comune = _comune;
			this.Provincia = _provincia;
			this.Telefono = _telefono;
			this.Mobile = _mobile;
			this.Fax = _fax;
			this.Email = _email;
			this.PartitaIva = _partitaIva;
			this.Codice = _codice;
			this.CodiceCatastale = _codiceCatastale;
			this.Localita = _localita;
			this.Note = _note;
			this.AziendaId = _aziendaId;
			this.Azienda = _azienda;
			this.Committentes = _committentes;
			this.ReportJobs = _reportJobs;
		}
コード例 #12
0
ファイル: Transport.cs プロジェクト: es-dev/cantieri
		public CommessaDto(int _id, int _aziendaId, DateTime? _creazione, DateTime? _scadenza, string _descrizione, string _denominazione, string _indirizzo, string _cAP, string _comune, string _provincia, string _riferimento, decimal? _importo, decimal? _margine, string _stato, string _oggetto, string _codiceCatastale, string _codice, decimal? _importoAvanzamento, decimal? _percentuale, string _estremiContratto, decimal? _importoPerizie, DateTime? _inizioLavori, DateTime? _fineLavori, string _localita, string _note, AziendaDto _azienda, IList<FornitoreDto> _fornitores, IList<SALDto> _sALs, IList<CommittenteDto> _committentes)
		{
			this.Id = _id;
			this.AziendaId = _aziendaId;
			this.Creazione = _creazione;
			this.Scadenza = _scadenza;
			this.Descrizione = _descrizione;
			this.Denominazione = _denominazione;
			this.Indirizzo = _indirizzo;
			this.CAP = _cAP;
			this.Comune = _comune;
			this.Provincia = _provincia;
			this.Riferimento = _riferimento;
			this.Importo = _importo;
			this.Margine = _margine;
			this.Stato = _stato;
			this.Oggetto = _oggetto;
			this.CodiceCatastale = _codiceCatastale;
			this.Codice = _codice;
			this.ImportoAvanzamento = _importoAvanzamento;
			this.Percentuale = _percentuale;
			this.EstremiContratto = _estremiContratto;
			this.ImportoPerizie = _importoPerizie;
			this.InizioLavori = _inizioLavori;
			this.FineLavori = _fineLavori;
			this.Localita = _localita;
			this.Note = _note;
			this.Azienda = _azienda;
			this.Fornitores = _fornitores;
			this.SALs = _sALs;
			this.Committentes = _committentes;
		}
コード例 #13
0
ファイル: Transport.cs プロジェクト: es-dev/cantieri
		public PagamentoUnificatoDto(int _id, DateTime? _data, decimal? _importo, string _note, string _codice, string _tipoPagamento, string _descrizione, int _aziendaId, int _anagraficaFornitoreId, AziendaDto _azienda, AnagraficaFornitoreDto _anagraficaFornitore, IList<PagamentoDto> _pagamentos, IList<PagamentoUnificatoFatturaAcquistoDto> _pagamentoUnificatoFatturaAcquistos)
		{
			this.Id = _id;
			this.Data = _data;
			this.Importo = _importo;
			this.Note = _note;
			this.Codice = _codice;
			this.TipoPagamento = _tipoPagamento;
			this.Descrizione = _descrizione;
			this.AziendaId = _aziendaId;
			this.AnagraficaFornitoreId = _anagraficaFornitoreId;
			this.Azienda = _azienda;
			this.AnagraficaFornitore = _anagraficaFornitore;
			this.Pagamentos = _pagamentos;
			this.PagamentoUnificatoFatturaAcquistos = _pagamentoUnificatoFatturaAcquistos;
		}
コード例 #14
0
ファイル: Transport.cs プロジェクト: es-dev/cantieri
		public ReportJobDto(int _id, DateTime? _creazione, string _codice, string _denominazione, string _tipo, DateTime? _elaborazione, string _note, string _nomeFile, int _aziendaId, int? _anagraficaCommittenteId, int? _anagraficaFornitoreId, AziendaDto _azienda, AnagraficaCommittenteDto _anagraficaCommittente, AnagraficaFornitoreDto _anagraficaFornitore)
		{
			this.Id = _id;
			this.Creazione = _creazione;
			this.Codice = _codice;
			this.Denominazione = _denominazione;
			this.Tipo = _tipo;
			this.Elaborazione = _elaborazione;
			this.Note = _note;
			this.NomeFile = _nomeFile;
			this.AziendaId = _aziendaId;
			this.AnagraficaCommittenteId = _anagraficaCommittenteId;
			this.AnagraficaFornitoreId = _anagraficaFornitoreId;
			this.Azienda = _azienda;
			this.AnagraficaCommittente = _anagraficaCommittente;
			this.AnagraficaFornitore = _anagraficaFornitore;
		}
コード例 #15
0
ファイル: Transport.cs プロジェクト: es-dev/cantieri
		public AccountDto(int _id, int _aziendaId, string _username, string _password, string _nickname, string _ruolo, string _note, DateTime? _creazione, bool? _abilitato, AziendaDto _azienda)
		{
			this.Id = _id;
			this.AziendaId = _aziendaId;
			this.Username = _username;
			this.Password = _password;
			this.Nickname = _nickname;
			this.Ruolo = _ruolo;
			this.Note = _note;
			this.Creazione = _creazione;
			this.Abilitato = _abilitato;
			this.Azienda = _azienda;
		}
コード例 #16
0
ファイル: Transport.cs プロジェクト: es-dev/cantieri
		public AnagraficaArticoloDto(int _id, string _codice, string _descrizione, string _note, int _aziendaId, AziendaDto _azienda, IList<ArticoloDto> _articolos)
		{
			this.Id = _id;
			this.Codice = _codice;
			this.Descrizione = _descrizione;
			this.Note = _note;
			this.AziendaId = _aziendaId;
			this.Azienda = _azienda;
			this.Articolos = _articolos;
		}