/// <summary> /// btnBuscar_Click /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnBuscar_Click(object sender, EventArgs e) { try { lblMensajeError.InnerText = ""; //WS-SINIESTRO IwsPresupuestoClient owsPresupuestoClient = new IwsPresupuestoClient(); //Parametros string NumPresupuesto = txtNumPresupuesto.Value; string NumInforme = txtNumInforme.Value; string NumPoliza = txtNumPoliza.Value; string FechaPresupuesto = txtFechaPresupuesto.Value; //Obtiene Listado de Siniestros string listadoJson = owsPresupuestoClient.BuscarPresupuesto(NumPresupuesto, NumInforme, NumPoliza, FechaPresupuesto); List <MSPresupuesto> listado = new JavaScriptSerializer().Deserialize <List <MSPresupuesto> >(listadoJson); rptListadoPresupuestos.DataSource = listado; rptListadoPresupuestos.DataBind(); } catch (Exception ex) { //throw ex; hddMensajeError.Value = ex.Message; } }
protected void Page_Load(object sender, EventArgs e) { try { lblMensajeError.InnerText = ""; if (!this.IsPostBack) { /* * List<String> tipoSiniestro = Utilitario.getTipoSiniestro(); * * foreach (string tipo in tipoSiniestro) * { * cmbTipoSiniestro.Items.Add(tipo); * } */ //Valores int id = int.Parse(Request.QueryString["pIdPresupuesto"]); //WS-SINIESTRO IwsPresupuestoClient service = new IwsPresupuestoClient(); //Parametros string modelJson = service.ObtenerPresupuesto(id); MSPresupuesto model = new JavaScriptSerializer().Deserialize <MSPresupuesto>(modelJson); MS_Presupuesto_Id.Value = model.MS_Presupuesto_Id.ToString(); UsuarioRegistro.Value = model.UsuarioRegistro; FechaRegistro.Value = model.FechaModifico.ToString("d"); txtNumPresupuesto.Value = model.NumPresupuesto; txtFechaPresupuesto.Value = model.FechaPresupuesto.ToString("d"); txtSubTotal.Value = model.SubTotal.ToString(); txtIGV.Value = model.IGV.ToString(); txtTotal.Value = model.Total.ToString(); hdnInformeAccidenteId.Value = model.MS_Informe_Accidente_Id.ToString(); txtNumInforme.Value = model.InformeAccidente.NumInforme; cmbTipoSiniestro.Value = model.InformeAccidente.Siniestro.Tipo; txtNumSiniestro.Value = model.InformeAccidente.Siniestro.NumSiniestro; txtFecSiniestro.Value = model.InformeAccidente.Siniestro.FechaRegistro.ToString("d"); txtLugar.Value = model.InformeAccidente.Siniestro.Lugar; txtNumPoliza.Value = model.InformeAccidente.Siniestro.Poliza.NumPoliza; txtAsegurado.Value = model.InformeAccidente.Siniestro.Poliza.Asegurado.Nombre + " " + model.InformeAccidente.Siniestro.Poliza.Asegurado.ApellidoPaterno + " " + model.InformeAccidente.Siniestro.Poliza.Asegurado.ApellidoMaterno; hdnMarcaId.Value = model.InformeAccidente.Siniestro.Poliza.Vehiculo.MP_Marca_Id.ToString(); hdnModeloId.Value = model.InformeAccidente.Siniestro.Poliza.Vehiculo.MP_Modelo_Id.ToString(); string DetalleFichaCargaSerializado = new JavaScriptSerializer().Serialize(model.DetallePresupuesto); txtDetalle.Value = DetalleFichaCargaSerializado; Session["detallePresupuestoAnterior"] = model.DetallePresupuesto; } } catch (Exception ex) { lblMensajeError.InnerText = ex.Message; } }
protected void Page_Load(object sender, EventArgs e) { try { //Controla Mostrar Mensaje string strMensaje = (string)HttpContext.Current.Session["PRESUPUESTO_MENSAJE"]; if (strMensaje == null) { strMensaje = ""; } HttpContext.Current.Session.Remove("PRESUPUESTO_MENSAJE"); hddMensaje.Value = strMensaje; //Controla Mostrar MensajeError string strMensajeError = (string)HttpContext.Current.Session["PRESUPUESTO_MENSAJE_ERROR"]; if (strMensaje == null) { strMensaje = ""; } HttpContext.Current.Session.Remove("PRESUPUESTO_MENSAJE_ERROR"); hddMensajeError.Value = strMensajeError; //lblMensajeError.InnerText = ""; //IsPostBack if (!this.IsPostBack) { //WS-SINIESTRO IwsPresupuestoClient owsPresupuestoClient = new IwsPresupuestoClient(); //Obtiene Listado de Siniestros string listadoJson = owsPresupuestoClient.ListarPresupuesto(); List <MSPresupuesto> listado = new JavaScriptSerializer().Deserialize <List <MSPresupuesto> >(listadoJson); rptListadoPresupuestos.DataSource = listado; rptListadoPresupuestos.DataBind(); } } catch (Exception ex) { //throw ex; hddMensajeError.Value = ex.Message; } }
/// <summary> /// btnGrabar_Click /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnGrabar_Click(object sender, EventArgs e) { try { lblMensajeError.InnerText = ""; //WS-SINIESTRO IwsPresupuestoClient service = new IwsPresupuestoClient(); //Validación //Parametros MSPresupuesto model = new MSPresupuesto(); model.MS_Presupuesto_Id = int.Parse(MS_Presupuesto_Id.Value); model.NumPresupuesto = txtNumPresupuesto.Value; model.FechaPresupuesto = Convert.ToDateTime(txtFechaPresupuesto.Value); model.SubTotal = float.Parse(txtSubTotal.Value); model.IGV = float.Parse(txtIGV.Value); model.Total = float.Parse(txtTotal.Value); model.UsuarioRegistro = UsuarioRegistro.Value; model.FechaRegistro = Convert.ToDateTime(FechaRegistro.Value); model.MS_Informe_Accidente_Id = int.Parse(hdnInformeAccidenteId.Value); string DetalleFichaCargaSerializado = txtDetalle.Value; MSPresupuesto modelJson = new JavaScriptSerializer().Deserialize <MSPresupuesto>(DetalleFichaCargaSerializado); model.DetallePresupuesto = (ICollection <MSDetallePresupuesto>)Session["detallePresupuestoAnterior"]; Session["detallePresupuestoAnterior"] = null; string mensaje = service.ModificarPresupuesto(model, modelJson.DetallePresupuesto.ToArray()); HttpContext.Current.Session["PRESUPUESTO_MENSAJE"] = mensaje; Response.Redirect("~/Modulos/Presupuesto/frm_BSQ_Presupuesto.aspx", false); } catch (Exception ex) { //throw ex; HttpContext.Current.Session["PRESUPUESTO_MENSAJE_ERROR"] = ex.Message; } }