Beispiel #1
0
        public static string GetDescrizione(ReportJobDto reportJob)
        {
            try
            {
                if (reportJob != null)
                {
                    var tipo = reportJob.Tipo;
                    string descrizione = null;
                    if (tipo == Tipi.TipoReport.Fornitore.ToString())
                        descrizione = BusinessLogic.Fornitore.GetCodifica(reportJob.AnagraficaFornitore);
                    else if (tipo == Tipi.TipoReport.Committente.ToString())
                        descrizione = BusinessLogic.Committente.GetCodifica(reportJob.AnagraficaCommittente);

                    return descrizione;
                }
            }
            catch (Exception ex)
            {
                UtilityError.Write(ex);
            }
            return null;
        }
	    /// <summary>
	    /// Deletes reportjob from the database by the given dto object.
	    /// </summary>
	    /// <param name="reportjob">The dto object.</param>
	    public void DeleteReportJob(ReportJobDto reportjob)
	    {
	        this.ReportJobService.Delete(reportjob);
	        this.UnitOfWork.SaveChanges();		
	    }
	    /// <summary>
	    /// Adds a new reportjob from the given dto object into the database.
	    /// </summary>
	    /// <param name="reportjob">The dto object.</param>
	    /// <returns>The dto key of the newly created reportjob.</returns>
	    public string CreateReportJob(ReportJobDto reportjob)
	    {
	        string key = this.ReportJobService.Add(reportjob);
	        this.UnitOfWork.SaveChanges();
	        return key;
	    }
Beispiel #4
0
 public static string GetCodifica(ReportJobDto reportJob)
 {
     try
     {
         if (reportJob != null)
         {
             var codifica = reportJob.Codice + " - TIPO " + reportJob.Tipo;
             return codifica;
         }
     }
     catch (Exception ex)
     {
         UtilityError.Write(ex);
     }
     return null;
 }