protected void btnGrabar_Click(object sender, EventArgs e) { BL_SOL_ANDAMIOS obj = new BL_SOL_ANDAMIOS(); DataTable dt = new DataTable(); if (lblrpta.Text == "R") { if (txtrechazo.Text != string.Empty) { dt = obj.uspUPD_SOL_ANDAMIOS_PROCESAR(Convert.ToInt32(lblCodigo.Text), lblrpta.Text, txtrechazo.Text.Trim(), Session["IDE_USUARIO"].ToString()); BL_SOL_ANDAMIOS objCorreo = new BL_SOL_ANDAMIOS(); objCorreo.SP_ENVIARCORREO_SOL_ANDAMIOS_RPTA(Convert.ToInt32(lblCodigo.Text)); string cleanMessage = "Registro procesado"; ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true); limpiar(); Listar("", ""); } else { string cleanMessage = "Ingresar sustento"; ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true); } } }
protected void Guardar() { string cleanMessage = string.Empty; BE_SOL_ANDAMIOS oBESol = new BE_SOL_ANDAMIOS(); oBESol.IDE_ANDAMIOS = Convert.ToInt32(string.IsNullOrEmpty(lblCodigo.Text) ? "0" : lblCodigo.Text); oBESol.USUARIO_ATENCION = Session["IDE_USUARIO"].ToString(); oBESol.SUPERVIDOR_DNI = ddlSupervisor.SelectedValue.ToString(); oBESol.SUPERVIDOR = ddlSupervisor.SelectedItem.ToString(); oBESol.CAPATAZ_DNI = ddlCapataz.SelectedValue.ToString(); oBESol.CAPATAZ = ddlCapataz.SelectedItem.ToString(); oBESol.DURACION = Convert.ToInt32(string.IsNullOrEmpty(txtDuracion.Text) ? "0" : txtDuracion.Text); oBESol.HORAS = Convert.ToDecimal(string.IsNullOrEmpty(txtHoras.Text) ? "0" : txtHoras.Text); oBESol.FECHA_ENTREGA = txtFecEntrega.Text.ToString(); oBESol.FECHA_TERMINO = txtTermino.Text.ToString(); oBESol.FECHA_DESMONTAJE = txtDesmontaje.Text.ToString(); oBESol.OBSERVACIONES = txtObservacion.Text; oBESol.ESTADO = Convert.ToInt32(ddlEstados.SelectedValue.ToString()); int dtrpta = 0; dtrpta = new BL_SOL_ANDAMIOS().uspUPD_SOL_ANDAMIOS(oBESol); if (dtrpta > 0) { int estado = Convert.ToInt32(ddlEstados.SelectedValue.ToString()); if (estado == 4 || estado == 5) { BL_SOL_ANDAMIOS objCorreo = new BL_SOL_ANDAMIOS(); objCorreo.SP_ENVIARCORREO_SOL_ANDAMIOS_RPTA(Convert.ToInt32(lblCodigo.Text)); } Listar(); cleanMessage = "Registro exitoso."; ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true); } }