Example #1
0
 public static string GetCodifica(ResoDto reso)
 {
     try
     {
         if(reso!=null)
         {
             var codifica = reso.Codice + " DEL " + UtilityValidation.GetDataND(reso.Data);
             return codifica;
         }
     }
     catch (Exception ex)
     {
         UtilityError.Write(ex);
     }
     return null;
 }
	    /// <summary>
	    /// Deletes reso from the database by the given dto object.
	    /// </summary>
	    /// <param name="reso">The dto object.</param>
	    public void DeleteReso(ResoDto reso)
	    {
	        this.ResoService.Delete(reso);
	        this.UnitOfWork.SaveChanges();		
	    }
	    /// <summary>
	    /// Adds a new reso from the given dto object into the database.
	    /// </summary>
	    /// <param name="reso">The dto object.</param>
	    /// <returns>The dto key of the newly created reso.</returns>
	    public string CreateReso(ResoDto reso)
	    {
	        string key = this.ResoService.Add(reso);
	        this.UnitOfWork.SaveChanges();
	        return key;
	    }