protected void Page_Load(object sender, EventArgs e) { try { panelMensaje.CssClass = "OcultarMensaje"; if (!Page.IsPostBack && !Page.IsCallback) { getClientes(); getNotaCobro(); } } catch (Exception ex) { ISException.RegisterExcepcion(ex); panelMensaje.CssClass = "MostrarMensaje"; lblMensaje.Text = ex.Message; return; } }
protected void grdFacturas_RowCommand(object sender, System.Web.UI.WebControls.GridViewCommandEventArgs e) { try { if (e.CommandName == "Detalles") { int index = int.Parse(e.CommandArgument.ToString()); string val = this.grdFacturas.DataKeys[index]["ID_FACTURA"].ToString(); Response.Redirect("DetalleFactura.aspx?Id=" + val, false); } } catch (Exception ex) { ISException.RegisterExcepcion(ex); panelMensaje.CssClass = "MostrarMensaje"; lblMensaje.Text = ex.Message; return; } }
protected void grdFacturas_RowDataBound(object sender, GridViewRowEventArgs e) { try { if (e.Row.RowType == DataControlRowType.DataRow) { DTO_RESUMEN_FACTURA dto = (DTO_RESUMEN_FACTURA)e.Row.DataItem; CheckBox chkSeleccionar = (CheckBox)e.Row.FindControl("chkSeleccionar"); chkSeleccionar.Visible = !dto.NUMERO_FACTURA.HasValue; } } catch (Exception ex) { ISException.RegisterExcepcion(ex); panelMensaje.CssClass = "MostrarMensaje"; lblMensaje.Text = ex.Message; return; } }
protected void lnkPagar_Click(object sender, EventArgs e) { try { LinkButton image = sender as LinkButton; int? Id = int.Parse(image.CommandArgument); if (Id.HasValue) { Response.Redirect("RegistroPago.aspx?Id=" + Id + "&cliente=" + hdIdCliente.Value, false); } } catch (Exception ex) { ISException.RegisterExcepcion(ex); panelMensaje.CssClass = "MostrarMensaje"; lblMensaje.Text = ex.Message; return; } }
protected void btnLimpiar_Click(object sender, EventArgs e) { try { panelMensaje.CssClass = "OcultarMensaje"; txtRutCliente.Text = string.Empty; txtNombreCliente.Text = string.Empty; ddlComuna.ClearSelection(); ddlConvenio.ClearSelection(); grdClientes.Visible = false; } catch (Exception ex) { ISException.RegisterExcepcion(ex); panelMensaje.CssClass = "MostrarMensaje"; lblMensaje.Text = ex.Message; return; } }
public void Update(int Id, int ESPECIEId, string NOMBRE) { Init(); try { using (LQCEEntities context = new LQCEEntities()) { RepositorioRAZA repositorio = new RepositorioRAZA(context); RAZA _RAZA = repositorio.GetById(Id); if (Equals(_RAZA, null)) { throw new Exception(String.Concat("No se ha encontrado RAZA con Id =", Id.ToString())); } RepositorioESPECIE _repositorioESPECIE = new RepositorioESPECIE(context); ESPECIE _objESPECIE = _repositorioESPECIE.GetById(ESPECIEId); if (Equals(_objESPECIE, null)) { throw new Exception(String.Concat("No se ha encontrado ESPECIE con Id =", ESPECIEId.ToString())); } //properties if (!string.IsNullOrEmpty(NOMBRE)) { _RAZA.NOMBRE = NOMBRE; } //parents _RAZA.ESPECIE = _objESPECIE; context.SaveChanges(); } } catch (Exception ex) { ISException.RegisterExcepcion(ex); Error = ex.Message; throw ex; } }
public IQueryable <CARGA_PRESTACIONES_HUMANAS_EXAMEN> GetByFilter(int?EXAMENId = null, int?CARGA_PRESTACIONES_HUMANAS_DETALLEId = null, System.DateTime?FECHA_ACTUALIZACION = null, string NOMBRE_EXAMEN = "", string VALOR_EXAMEN = "", int?VALOR_VALOR_EXAMEN = null) { Error = string.Empty; try { var q = from i in _context.CARGA_PRESTACIONES_HUMANAS_EXAMEN where i.ACTIVO select i; if (!string.IsNullOrEmpty(NOMBRE_EXAMEN)) { q = q.Where(i => i.NOMBRE_EXAMEN.Contains(NOMBRE_EXAMEN)); } if (!string.IsNullOrEmpty(VALOR_EXAMEN)) { q = q.Where(i => i.VALOR_EXAMEN.Contains(VALOR_EXAMEN)); } if (FECHA_ACTUALIZACION.HasValue) { q = q.Where(i => i.FECHA_ACTUALIZACION == FECHA_ACTUALIZACION.Value); } if (VALOR_VALOR_EXAMEN.HasValue) { q = q.Where(i => i.VALOR_VALOR_EXAMEN == VALOR_VALOR_EXAMEN.Value); } if (EXAMENId.HasValue) { q = q.Where(i => i.EXAMEN.ID == EXAMENId.Value); } if (CARGA_PRESTACIONES_HUMANAS_DETALLEId.HasValue) { q = q.Where(i => i.CARGA_PRESTACIONES_HUMANAS_DETALLE.ID == CARGA_PRESTACIONES_HUMANAS_DETALLEId.Value); } return(q); } catch (Exception ex) { ISException.RegisterExcepcion(ex); Error = ex.Message; throw ex; } }
public void Update(int Id, int TIPO_PRESTACIONId, string NOMBRE) { Init(); try { using (LQCEEntities context = new LQCEEntities()) { RepositorioCONVENIO repositorio = new RepositorioCONVENIO(context); CONVENIO _CONVENIO = repositorio.GetById(Id); if (Equals(_CONVENIO, null)) { throw new Exception(String.Concat("No se ha encontrado CONVENIO con Id =", Id.ToString())); } RepositorioTIPO_PRESTACION _repositorioTIPO_PRESTACION = new RepositorioTIPO_PRESTACION(context); TIPO_PRESTACION _objTIPO_PRESTACION = _repositorioTIPO_PRESTACION.GetById(TIPO_PRESTACIONId); if (Equals(_objTIPO_PRESTACION, null)) { throw new Exception(String.Concat("No se ha encontrado TIPO_PRESTACION con Id =", TIPO_PRESTACIONId.ToString())); } //properties if (!string.IsNullOrEmpty(NOMBRE)) { _CONVENIO.NOMBRE = NOMBRE; } //parents _CONVENIO.TIPO_PRESTACION = _objTIPO_PRESTACION; context.SaveChanges(); } } catch (Exception ex) { ISException.RegisterExcepcion(ex); Error = ex.Message; throw ex; } }
public IQueryable <VISTA_FACTURAS_POR_NOTIFICAR> GetByFilter(int?ID_CLIENTE = null, string RUT = "", string NOMBRE = "", System.DateTime?FECHA_FACTURACION = null, int?CONTADOR_NOTAS_COBRO = null, int?NUMERO_FACTURA = null) { Error = string.Empty; try { var q = from i in _context.VISTA_FACTURAS_POR_NOTIFICAR select i; if (ID_CLIENTE.HasValue) { q = q.Where(i => i.ID_CLIENTE == ID_CLIENTE.Value); } if (!string.IsNullOrEmpty(RUT)) { q = q.Where(i => i.RUT.Contains(RUT)); } if (!string.IsNullOrEmpty(NOMBRE)) { q = q.Where(i => i.NOMBRE.Contains(NOMBRE)); } if (FECHA_FACTURACION.HasValue) { q = q.Where(i => i.FECHA_FACTURACION == FECHA_FACTURACION.Value); } if (NUMERO_FACTURA.HasValue) { q = q.Where(i => i.NUMERO_FACTURA == NUMERO_FACTURA.Value); } if (CONTADOR_NOTAS_COBRO.HasValue) { q = q.Where(i => i.CONTADOR_NOTAS_COBRO == CONTADOR_NOTAS_COBRO.Value); } return(q); } catch (Exception ex) { ISException.RegisterExcepcion(ex); Error = ex.Message; throw ex; } }
protected void btnAgrega_Click(object sender, EventArgs e) { try { if (Page.IsValid) { if (string.IsNullOrEmpty(txtExamen.Text)) { throw new Exception("Debe ingresar un nombre para el examen"); } if (string.IsNullOrEmpty(txtValor.Text)) { throw new Exception("Debe ingresar el valor del examen"); } DTOExamen dto = new DTOExamen(); dto.NOMBRE_EXAMEN = txtExamen.Text; dto.ID = 0; dto.VALOR_EXAMEN = txtValor.Text; var lista = this.ListaExamen; lista.Add(dto); this.ListaExamen = lista; grdExamen.DataSource = lista; grdExamen.DataBind(); txtExamen.Text = string.Empty; txtValor.Text = string.Empty; pnAgregaFila.Visible = false; CalculoMontoPrestaciones(); } } catch (Exception ex) { ISException.RegisterExcepcion(ex); panelMensaje.CssClass = "MostrarMensaje"; lblMensaje.Text = ex.Message; return; } }
public void Update(int Id, int CLIENTEId, string NOMBRE) { Init(); try { using (LQCEEntities context = new LQCEEntities()) { RepositorioCLIENTE_SINONIMO repositorio = new RepositorioCLIENTE_SINONIMO(context); CLIENTE_SINONIMO _CLIENTE_SINONIMO = repositorio.GetById(Id); if (Equals(_CLIENTE_SINONIMO, null)) { throw new Exception(String.Concat("No se ha encontrado CLIENTE_SINONIMO con Id =", Id.ToString())); } RepositorioCLIENTE _repositorioCLIENTE = new RepositorioCLIENTE(context); CLIENTE _objCLIENTE = _repositorioCLIENTE.GetById(CLIENTEId); if (Equals(_objCLIENTE, null)) { throw new Exception(String.Concat("No se ha encontrado CLIENTE con Id =", CLIENTEId.ToString())); } //properties if (!string.IsNullOrEmpty(NOMBRE)) { _CLIENTE_SINONIMO.NOMBRE = NOMBRE; } //parents _CLIENTE_SINONIMO.CLIENTE = _objCLIENTE; context.SaveChanges(); } } catch (Exception ex) { ISException.RegisterExcepcion(ex); Error = ex.Message; throw ex; } }
public IQueryable <VISTA_PRESTACIONES_POR_FACTURAR> GetByFilter(int?ID_CLIENTE = null, string RUT = "", string NOMBRE = "", int?DESCUENTO = null, System.DateTime?FECHA_RECEPCION = null, int?TOTAL = null) { Error = string.Empty; try { var q = from i in _context.VISTA_PRESTACIONES_POR_FACTURAR select i; if (ID_CLIENTE.HasValue) { q = q.Where(i => i.ID_CLIENTE == ID_CLIENTE.Value); } if (!string.IsNullOrEmpty(RUT)) { q = q.Where(i => i.RUT.Contains(RUT)); } if (!string.IsNullOrEmpty(NOMBRE)) { q = q.Where(i => i.NOMBRE.Contains(NOMBRE)); } if (DESCUENTO.HasValue) { q = q.Where(i => i.DESCUENTO == DESCUENTO.Value); } if (FECHA_RECEPCION.HasValue) { q = q.Where(i => i.FECHA_RECEPCION == FECHA_RECEPCION.Value); } if (TOTAL.HasValue) { q = q.Where(i => i.TOTAL == TOTAL.Value); } return(q); } catch (Exception ex) { ISException.RegisterExcepcion(ex); Error = ex.Message; throw ex; } }
public void Update(int Id, int PRESTACIONId, string NOMBRE) { Init(); try { using (LQCEEntities context = new LQCEEntities()) { RepositorioPRESTACION_MUESTRA repositorio = new RepositorioPRESTACION_MUESTRA(context); PRESTACION_MUESTRA _PRESTACION_MUESTRA = repositorio.GetById(Id); if (Equals(_PRESTACION_MUESTRA, null)) { throw new Exception(String.Concat("No se ha encontrado PRESTACION_MUESTRA con Id =", Id.ToString())); } RepositorioPRESTACION _repositorioPRESTACION = new RepositorioPRESTACION(context); PRESTACION _objPRESTACION = _repositorioPRESTACION.GetById(PRESTACIONId); if (Equals(_objPRESTACION, null)) { throw new Exception(String.Concat("No se ha encontrado PRESTACION con Id =", PRESTACIONId.ToString())); } //properties if (!string.IsNullOrEmpty(NOMBRE)) { _PRESTACION_MUESTRA.NOMBRE = NOMBRE; } //parents _PRESTACION_MUESTRA.PRESTACION = _objPRESTACION; context.SaveChanges(); } } catch (Exception ex) { ISException.RegisterExcepcion(ex); Error = ex.Message; throw ex; } }
public void Update(int Id, int EXAMENId, string NOMBRE) { Init(); try { using (LQCEEntities context = new LQCEEntities()) { RepositorioEXAMEN_SINONIMO repositorio = new RepositorioEXAMEN_SINONIMO(context); EXAMEN_SINONIMO _EXAMEN_SINONIMO = repositorio.GetById(Id); if (Equals(_EXAMEN_SINONIMO, null)) { throw new Exception(String.Concat("No se ha encontrado EXAMEN_SINONIMO con Id =", Id.ToString())); } RepositorioEXAMEN _repositorioEXAMEN = new RepositorioEXAMEN(context); EXAMEN _objEXAMEN = _repositorioEXAMEN.GetById(EXAMENId); if (Equals(_objEXAMEN, null)) { throw new Exception(String.Concat("No se ha encontrado EXAMEN con Id =", EXAMENId.ToString())); } //properties if (!string.IsNullOrEmpty(NOMBRE)) { _EXAMEN_SINONIMO.NOMBRE = NOMBRE; } //parents _EXAMEN_SINONIMO.EXAMEN = _objEXAMEN; context.SaveChanges(); } } catch (Exception ex) { ISException.RegisterExcepcion(ex); Error = ex.Message; throw ex; } }
public int Add(int ID, string NOMBRE) { Init(); try { using (LQCEEntities context = new LQCEEntities()) { RepositorioREGION repositorio = new RepositorioREGION(context); if (repositorio.GetByFilter(ID, true).Any()) { throw new Exception("Ya existe una región con este ID"); } REGION _REGION = null; if (repositorio.GetByFilter(ID, false).Any()) { _REGION = repositorio.GetByFilter(ID, false).First(); _REGION.NOMBRE = NOMBRE; _REGION.ACTIVO = true; } else { _REGION = new Modelo.REGION(); _REGION.ID = ID; _REGION.NOMBRE = NOMBRE; _REGION.ACTIVO = true; context.AddObject("REGION", _REGION); } context.SaveChanges(); return(_REGION.ID); } } catch (Exception ex) { ISException.RegisterExcepcion(ex); Error = ex.Message; throw ex; } }
protected void imgEditar_Click(object sender, ImageClickEventArgs e) { try { ImageButton _link = sender as ImageButton; int? Id = int.Parse(_link.CommandArgument); if (Id.HasValue) { //Se muestra el contenido del archivo seleccionado Response.Redirect("EditarRegistros.aspx?Id=" + Id, false); } } catch (Exception ex) { ISException.RegisterExcepcion(ex); panelMensaje.CssClass = "MostrarMensaje"; lblMensaje.Text = ex.Message; return; } }
protected void Page_Load(object sender, EventArgs e) { try { panelMensaje.CssClass = "OcultarMensaje"; if (!Page.IsPostBack && !Page.IsCallback) { GetTipoPrestacion(); GetEstado(); CargaGrilla(null, null); } } catch (Exception ex) { ISException.RegisterExcepcion(ex); panelMensaje.CssClass = "MostrarMensaje"; lblMensaje.Text = ex.Message; return; } }
protected void imgActualizar_Click(object sender, ImageClickEventArgs e) { try { panelMensaje.CssClass = "OcultarMensaje"; ImageButton _link = sender as ImageButton; int? Id = int.Parse(_link.CommandArgument); if (Id.HasValue) { Response.Redirect("ActualizarClientes.aspx?Id=" + Id, false); } } catch (Exception ex) { ISException.RegisterExcepcion(ex); panelMensaje.CssClass = "MostrarMensaje"; lblMensaje.Text = ex.Message; return; } }
protected void rblNumerar_SelectedIndexChanged(object sender, EventArgs e) { try { bool EsRango = (rblNumerar.SelectedValue != "1"); txtDesdeN.Enabled = EsRango; txtHastaN.Enabled = EsRango; txtDesdeN.Text = ""; txtHastaN.Text = ""; RequiredFieldValidator_txtDesdeN.Enabled = EsRango; RequiredFieldValidator_txtHastaN.Enabled = EsRango; } catch (Exception ex) { ISException.RegisterExcepcion(ex); panelMensaje.CssClass = "MostrarMensaje"; lblMensaje.Text = ex.Message; return; } }
protected void grdFacturas_RowDataBound(object sender, GridViewRowEventArgs e) { try { if (e.Row.RowType == DataControlRowType.DataRow) { DTO_RESUMEN_FACTURA dto = (DTO_RESUMEN_FACTURA)e.Row.DataItem; LinkButton linkSeleccionar = (LinkButton)e.Row.FindControl("linkSeleccionar"); linkSeleccionar.Visible = (dto.NUMERO_FACTURA.HasValue && dto.PAGADA == false); linkSeleccionar.CommandArgument = dto.ID_FACTURA.ToString(); } } catch (Exception ex) { ISException.RegisterExcepcion(ex); panelMensaje.CssClass = "MostrarMensaje"; lblMensaje.Text = ex.Message; return; } }
public void Update(int Id, int FACTURAId, System.DateTime FECHA_EMISION, int NUMERO_NOTA_CREDITO, bool CORRECCION_TOTAL_PARCIAL) { Init(); try { using (LQCEEntities context = new LQCEEntities()) { RepositorioNOTA_CREDITO repositorio = new RepositorioNOTA_CREDITO(context); NOTA_CREDITO _NOTA_CREDITO = repositorio.GetById(Id); if (Equals(_NOTA_CREDITO, null)) { throw new Exception(String.Concat("No se ha encontrado NOTA_CREDITO con Id =", Id.ToString())); } RepositorioFACTURA _repositorioFACTURA = new RepositorioFACTURA(context); FACTURA _objFACTURA = _repositorioFACTURA.GetById(FACTURAId); if (Equals(_objFACTURA, null)) { throw new Exception(String.Concat("No se ha encontrado FACTURA con Id =", FACTURAId.ToString())); } //properties _NOTA_CREDITO.FECHA_EMISION = FECHA_EMISION; _NOTA_CREDITO.NUMERO_NOTA_CREDITO = NUMERO_NOTA_CREDITO; _NOTA_CREDITO.CORRECCION_TOTAL_PARCIAL = CORRECCION_TOTAL_PARCIAL; //parents _NOTA_CREDITO.FACTURA = _objFACTURA; context.SaveChanges(); } } catch (Exception ex) { ISException.RegisterExcepcion(ex); Error = ex.Message; throw ex; } }
private EDDY.IS.LeadPing.Domain.MpicProspectInfo TransLateToInternalProspect(MpicProspectInfo ProspectInfo) { try { EDDY.IS.LeadPing.Domain.MpicProspectInfo ReturnValue = new EDDY.IS.LeadPing.Domain.MpicProspectInfo(); ReturnValue.AddressLine2 = ProspectInfo.AddressLine2; ReturnValue.City = ProspectInfo.City; ReturnValue.Email = ProspectInfo.Email; ReturnValue.FirstName = ProspectInfo.FirstName; ReturnValue.LastName = ProspectInfo.LastName; ReturnValue.Phone1 = ProspectInfo.Phone1; if (ProspectInfo.Phone2 == null) { ReturnValue.Phone2 = ProspectInfo.Phone1; } else if (ProspectInfo.Phone2.Length == 0) { ReturnValue.Phone2 = ProspectInfo.Phone1; } else { ReturnValue.Phone2 = ProspectInfo.Phone2; } ReturnValue.StateAbbreviation = ProspectInfo.StateCode; ReturnValue.ZipCode = ProspectInfo.ZipCode; ReturnValue.StreetAddress = ProspectInfo.StreetAddress; ReturnValue.AddressLine2 = ProspectInfo.AddressLine2; return(ReturnValue); } catch (Exception Ex) { ISException isEx = new ISException(Ex, MethodBase.GetCurrentMethod().DeclaringType.Namespace + "." + MethodBase.GetCurrentMethod().DeclaringType.Name + "." + MethodBase.GetCurrentMethod().Name, ProspectInfo); isEx.Save(true); throw Ex; } }
public List <CLIENTE> GetByFilterWithFullReferences(string RUT, string NOMBRE, int?ID_REGION, int?ID_COMUNA, int?ID_TIPO_PRESTACION, int?ID_CONVENIO, int PageIndex, int PageSize) { Init(); try { using (LQCEEntities context = new LQCEEntities()) { RepositorioCLIENTE repositorio = new RepositorioCLIENTE(context); return((from f in repositorio.GetByFilterWithFullReferences(RUT, NOMBRE, ID_REGION, ID_COMUNA, ID_TIPO_PRESTACION, ID_CONVENIO) .OrderBy(f => f.NOMBRE) .Skip((PageIndex - 1) * PageSize).Take(PageSize) select f).ToList()); } } catch (Exception ex) { ISException.RegisterExcepcion(ex); Error = ex.Message; throw ex; } }
protected void btnPaso1Template_Click(object sender, EventArgs e) { try { string attachment = "attachment; filename=PrestacionesVeterinarias.xlsx"; Response.ClearContent(); Response.AddHeader("content-disposition", attachment); Response.ContentType = "application/octet-stream"; string nombreArchivo = MapPath("~/_layouts/Prestaciones/PrestacionesVeterinarias.xlsx"); Response.WriteFile(nombreArchivo); Response.End(); //this.Context.ApplicationInstance.CompleteRequest(); } catch (Exception ex) { ISException.RegisterExcepcion(ex); panelMensaje.CssClass = "MostrarMensaje"; lblMensaje.Text = ex.Message; return; } }
protected void gridFacturacion_RowDataBound(object sender, GridViewRowEventArgs e) { try { if (e.Row.RowType == DataControlRowType.DataRow) { DTO_RESUMEN_FACTURACION dto = (DTO_RESUMEN_FACTURACION)e.Row.DataItem; HiddenField hdnIdFacturacion = (HiddenField)e.Row.FindControl("hdnIdFacturacion"); HiddenField hdnIdTipoFactura = (HiddenField)e.Row.FindControl("hdnIdTipoFactura"); hdnIdFacturacion.Value = dto.ID_FACTURACION.ToString(); hdnIdTipoFactura.Value = dto.ID_TIPO_FACTURA.ToString(); } } catch (Exception ex) { ISException.RegisterExcepcion(ex); panelMensaje.CssClass = "MostrarMensaje"; lblMensaje.Text = ex.Message; return; } }
protected void Page_Load(object sender, EventArgs e) { try { panelMensaje.CssClass = "OcultarMensaje"; if (!Page.IsPostBack && !Page.IsCallback) { grdPrestaciones.PageIndex = 1; GetEstado(); BuscarPrestaciones(); Paginador1.SetPage(1); } } catch (Exception ex) { ISException.RegisterExcepcion(ex); panelMensaje.CssClass = "MostrarMensaje"; lblMensaje.Text = ex.Message; return; } }
public CARGA_PRESTACIONES_VETERINARIAS_DETALLE GetByIdWithReferencesFull(int id) { Error = string.Empty; try { return(_context.CARGA_PRESTACIONES_VETERINARIAS_DETALLE .Include("CARGA_PRESTACIONES_ENCABEZADO.CARGA_PRESTACIONES_ESTADO") .Include("CARGA_PRESTACIONES_VETERINARIAS_EXAMEN") .Include("CARGA_PRESTACIONES_DETALLE_ESTADO") .Include("CLIENTE") .Include("GARANTIA1") .Include("PREVISION") .FirstOrDefault(i => i.ID == id && i.ACTIVO)); } catch (Exception ex) { ISException.RegisterExcepcion(ex); Error = ex.Message; return(null); } }
public void Update(int Id, int CLIENTEId, int FECHA_PAGO, int MONTO_PAGO) { Init(); try { using (LQCEEntities context = new LQCEEntities()) { RepositorioPAGO repositorio = new RepositorioPAGO(context); PAGO _PAGO = repositorio.GetById(Id); if (Equals(_PAGO, null)) { throw new Exception(String.Concat("No se ha encontrado PAGO con Id =", Id.ToString())); } RepositorioCLIENTE _repositorioCLIENTE = new RepositorioCLIENTE(context); CLIENTE _objCLIENTE = _repositorioCLIENTE.GetById(CLIENTEId); if (Equals(_objCLIENTE, null)) { throw new Exception(String.Concat("No se ha encontrado CLIENTE con Id =", CLIENTEId.ToString())); } //properties _PAGO.FECHA_PAGO = FECHA_PAGO; _PAGO.MONTO_PAGO = MONTO_PAGO; //parents _PAGO.CLIENTE = _objCLIENTE; context.SaveChanges(); } } catch (Exception ex) { ISException.RegisterExcepcion(ex); Error = ex.Message; throw ex; } }
public string Transform(string inputXml, string inputXslt) { try { //SE CREA Y CARGA EL DOCUMENTO XML INPUT var objXmlIntputDocument = new XmlDocument(); objXmlIntputDocument.LoadXml(inputXml); //SE CREA Y CARGA EL XLST INTPUT var objXslTemplate = new XmlDocument(); objXslTemplate.LoadXml(inputXslt); //SE CREA EL TRANSFORM Y SE CARGA EL XSLT var objXslCompiledTransform = new XslCompiledTransform(); objXslCompiledTransform.Load(objXslTemplate); //SE CREA LOS ESCRITORES DE SALIDA var sbOutput = new StringBuilder(); using (XmlWriter objXmlWriter = XmlWriter.Create(sbOutput, objXslCompiledTransform.OutputSettings)) { //SE TRANSFORMA EL XML CON EL XSLT objXslCompiledTransform.Transform(objXmlIntputDocument, objXmlWriter); objXmlWriter.Flush(); objXmlWriter.Close(); } return(sbOutput.ToString()); } catch (XmlException exXml) { ISException.RegisterExcepcion(exXml); } catch (Exception ex) { ISException.RegisterExcepcion(ex); } return(string.Empty); }
public void Update(int Id, int CONVENIOId, System.DateTime FECHA_VIGENCIA) { Init(); try { using (LQCEEntities context = new LQCEEntities()) { RepositorioCONVENIO_TARIFARIO repositorio = new RepositorioCONVENIO_TARIFARIO(context); CONVENIO_TARIFARIO _CONVENIO_TARIFARIO = repositorio.GetById(Id); if (Equals(_CONVENIO_TARIFARIO, null)) { throw new Exception(String.Concat("No se ha encontrado CONVENIO_TARIFARIO con Id =", Id.ToString())); } RepositorioCONVENIO _repositorioCONVENIO = new RepositorioCONVENIO(context); CONVENIO _objCONVENIO = _repositorioCONVENIO.GetById(CONVENIOId); if (Equals(_objCONVENIO, null)) { throw new Exception(String.Concat("No se ha encontrado CONVENIO con Id =", CONVENIOId.ToString())); } //properties _CONVENIO_TARIFARIO.FECHA_VIGENCIA = FECHA_VIGENCIA; //parents _CONVENIO_TARIFARIO.CONVENIO = _objCONVENIO; context.SaveChanges(); } } catch (Exception ex) { ISException.RegisterExcepcion(ex); Error = ex.Message; throw ex; } }