public HttpResponseMessage GCP0023_ReunionRFC(BEGCP_Reunion oBe) { var oBeR = new BEResponseReunion(); try { var oBr = new BRGCP_Reunion(); oBe.acci = 1; var _be = new BEGCP_Reunion(); oBr.GCP0023_ReunionRFC(oBe); var oList = oBr.GCP0023_ReunionRFC_LIST(oBe); oBeR.success = true; oList.ForEach(obj => { if (obj.reu_Codigo == oBe.reu_Codigo) { oBeR.data = obj; } }); return(Request.CreateResponse(HttpStatusCode.OK, oBeR)); } catch (Exception ex) { oBeR.success = false; oBeR.data = new BEGCP_Reunion(); return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message)); } }
/// <summary> /// OBTENER LA LISTA DE REUNIONES DEL RFC /// </summary> /// <param name="oBe"></param> /// <returns></returns> public List <BEGCP_Reunion> GCP0023_ReunionRFC_LIST(BEGCP_Reunion oBe) { try { using (var odr = oda.GCP0023_ReunionRFC_LIST(oBe)) { var oList = new List <BEGCP_Reunion>(); var iLst = oList; ((IList)iLst).LoadFromReader <BEGCP_Reunion>(odr); if (odr.NextResult()) { var oListParticipante = new List <BEGCP_ReunionParticipante>(); var iListParticipante = oListParticipante; ((IList)iListParticipante).LoadFromReader <BEGCP_ReunionParticipante>(odr); oList.ForEach(obj => { oListParticipante.ForEach(objp => { if (objp.reu_Codigo == obj.reu_Codigo) { obj.ReunionParticipante.Add(objp); } }); }); } return(oList); } } catch (Exception ex) { throw new ArgumentException(ex.Message); } }
/// <summary> /// MANTENIMIENTO DE REUNIONES DEL RFC /// </summary> /// <param name="oBe"></param> public void GCP0023_ReunionRFC(BEGCP_Reunion oBe) { try { oda.GCP0023_ReunionRFC(oBe); } catch (Exception ex) { throw new Exception(ex.Message); } }
/// <summary> /// MANTENIMIENTO DE REUNIONES DEL RFC /// </summary> /// <param name="oBe"></param> public void GCP0023_ReunionRFC(BEGCP_Reunion oBe) { if (ocn.State == ConnectionState.Closed) { ocn.Open(); } BEGCP_Reunion _be = new BEGCP_Reunion(); using (var obts = ocn.BeginTransaction()) { try { using (var ocmd = odb.GetStoredProcCommand("GCP0023_ReunionRFC", oBe.rfc_Codigo, oBe.reu_FechaReunion, oBe.reu_HoraReunion, oBe.reu_Lugar, oBe.reu_Comentario, oBe.reu_Codigo)) { ocmd.CommandTimeout = 2000; odb.ExecuteNonQuery(ocmd, obts); oBe.reu_Codigo = Convert.ToInt32(odb.GetParameterValue(ocmd, "@reu_Codigo")); //Detalle Reunión Participantes DbCommand cmdo; oBe.ReunionParticipante.ForEach(obj => { cmdo = odb.GetStoredProcCommand("GCP0024_ReunionParticipanteRFC", oBe.reu_Codigo, oBe.rfc_Codigo, obj.per_Codigo); cmdo.CommandTimeout = 2000; odb.ExecuteNonQuery(cmdo, obts); }); obts.Commit(); _be = oBe; } } catch (Exception ex) { obts.Rollback(); throw new Exception(ex.Message); } finally { ocn.Close(); } } }
public HttpResponseMessage GCP0023_ReunionRFC_LIST(int id) { try { var oBr = new BRGCP_Reunion(); var oBe = new BEGCP_Reunion(); oBe.rfc_Codigo = id; var oList = oBr.GCP0023_ReunionRFC_LIST(oBe); return(Request.CreateResponse(HttpStatusCode.OK, oList)); } catch (Exception ex) { return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message)); } }
/// <summary> /// OBTENER LA LISTA DE REUNIONES DEL RFC /// </summary> /// <param name="oBe"></param> /// <returns></returns> public IDataReader GCP0023_ReunionRFC_LIST(BEGCP_Reunion oBe) { try { if (ocn.State == ConnectionState.Closed) { ocn.Open(); } var ocmd = odb.GetStoredProcCommand("GCP0023_ReunionRFC_LIST", oBe.rfc_Codigo); ocmd.CommandTimeout = 2000; var odr = odb.ExecuteReader(ocmd); return(odr); } catch (Exception ex) { throw new ArgumentException(ex.Message); } finally { ocn.Close(); } }