public static System.Data.DataSet Execute(ExtExternalProcessing processing, string sql)
 {
     System.Data.DataSet set;
     if ((processing == null) || (processing == ExtExternalProcessing.Null))
     {
         return null;
     }
     if ((processing.Status != 0) || (processing.ProcessingTemplateId == 0L))
     {
         throw new System.ApplicationException("Отчет непригоден для выполнения");
     }
     processing.Status = 1;
     processing.SaveChanges();
     try
     {
         set = Mappers.ExtExternalProcessingMapper.RunSql(sql, processing.Id);
         processing.Status = 2;
         processing.SaveChanges();
     }
     catch (System.Exception)
     {
         processing.Status = 0;
         processing.SaveChanges();
         throw;
     }
     return set;
 }