示例#1
0
 public static string GetCodifica(ArticoloDto articolo)
 {
     try
     {
         if(articolo!=null)
         {
             var codifica = GetCodifica(articolo.AnagraficaArticolo);
             return codifica;
         }
     }
     catch (Exception ex)
     {
         UtilityError.Write(ex);
     }
     return null;
 }
	    /// <summary>
	    /// Deletes articolo from the database by the given dto object.
	    /// </summary>
	    /// <param name="articolo">The dto object.</param>
	    public void DeleteArticolo(ArticoloDto articolo)
	    {
	        this.ArticoloService.Delete(articolo);
	        this.UnitOfWork.SaveChanges();		
	    }
	    /// <summary>
	    /// Adds a new articolo from the given dto object into the database.
	    /// </summary>
	    /// <param name="articolo">The dto object.</param>
	    /// <returns>The dto key of the newly created articolo.</returns>
	    public string CreateArticolo(ArticoloDto articolo)
	    {
	        string key = this.ArticoloService.Add(articolo);
	        this.UnitOfWork.SaveChanges();
	        return key;
	    }