/// <summary> /// Realiza la actualizacion de un mailplan para factuacion del sistema por mailgroup. Lo deja en estado abierto para facturar /// </summary> /// <param name="item"></param> /// <returns></returns> public bool UpdateEstadoFacturacionAbierto(MailGroupInfo item) { try { return(module.UpdateEstadoFacturacionAbierto(item)); } catch (Exception ex) { System.Diagnostics.Trace.WriteLine(string.Format("NIVI Error: {0} , NameSpace: {1}, Clase: {2}, Metodo: {3} ", ex.Message, MethodBase.GetCurrentMethod().DeclaringType.Namespace, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name)); return(false); } }
/// <summary> /// lista todos los MailGroup existentes. /// </summary> /// <returns></returns> public List <MailGroupInfo> List() { db.SetParameterValue(commandMailGroup, "i_operation", 'S'); db.SetParameterValue(commandMailGroup, "i_option", 'A'); List <MailGroupInfo> col = new List <MailGroupInfo>(); IDataReader dr = null; MailGroupInfo m = null; try { dr = db.ExecuteReader(commandMailGroup); while (dr.Read()) { m = Factory.GetMailGroup(dr); col.Add(m); } } catch (Exception ex) { System.Diagnostics.Trace.WriteLine(string.Format("NIVI Error: {0} , NameSpace: {1}, Clase: {2}, Metodo: {3} ", ex.Message, MethodBase.GetCurrentMethod().DeclaringType.Namespace, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name)); bool rethrow = ExceptionPolicy.HandleException(ex, "DataAccess Policy"); if (rethrow) { throw; } } finally { if (dr != null) { dr.Close(); } } return(col); }
/// <summary> /// Realiza la actualizacion de un mailplan para factuacion del sistema por mailgroup. Lo deja en estado cerrado y no se puede facturar /// </summary> /// <param name="item"></param> /// <returns></returns> public bool UpdateEstadoFacturacionCerrado(MailGroupInfo item) { bool transOk = false; IDataReader dr = null; try { db.SetParameterValue(commandMailGroup, "i_operation", 'U'); db.SetParameterValue(commandMailGroup, "i_option", 'C'); db.SetParameterValue(commandMailGroup, "i_mailgroup", item.MailGroup); dr = db.ExecuteReader(commandMailGroup); transOk = true; } catch (Exception ex) { System.Diagnostics.Trace.WriteLine(string.Format("NIVI Error: {0} , NameSpace: {1}, Clase: {2}, Metodo: {3} ", ex.Message, MethodBase.GetCurrentMethod().DeclaringType.Namespace, MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name)); bool rethrow = ExceptionPolicy.HandleException(ex, "DataAccess Policy"); if (rethrow) { throw; } } finally { if (dr != null) { dr.Close(); } } return(transOk); }