protected void btnGuardar_Click(object sender, EventArgs e) { BL_MOD_REQUERIMIENTO obj = new BL_MOD_REQUERIMIENTO(); DataTable dtResultado = new DataTable(); string cleanMessage = string.Empty; if (ddlPersonal.Text.Trim() == string.Empty) { cleanMessage = "Ingresar nombre de personal"; ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true); } else { BE_MOD_REQUERIMIENTO oBESol = new BE_MOD_REQUERIMIENTO(); oBESol.IDE_MOD = Convert.ToInt32(string.IsNullOrEmpty(lblCodigo.Text) ? "0" : lblCodigo.Text); oBESol.CODIGO = string.Empty; oBESol.FECHA_REQUERIMIENTO = txtFecha.Text.Trim(); oBESol.IP_CENTRO = ddlcentro.SelectedValue.ToString(); oBESol.CENTRO = ddlcentro.SelectedValue.ToString(); oBESol.USER_REGISTRO = Session["IDE_USUARIO"].ToString(); int dtrpta = 0; dtrpta = new BL_MOD_REQUERIMIENTO().uspINS_MOD_REQUERIMIENTO(oBESol); if (dtrpta > 0) { lblCodigo.Text = dtrpta.ToString(); dtResultado = obj.uspUPD_MOD_REQUERIMIENTO_RESPONSABLE(Convert.ToInt32(lblCodigo.Text), ddlPersonal.SelectedValue.ToString(), Convert.ToInt32(ddlResponsable.SelectedValue)); CartaDatos(dtrpta.ToString()); cleanMessage = "Registro exitoso."; ddlPersonal.Text = string.Empty; ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true); } } }
protected void btnAgregar_Click(object sender, EventArgs e) { string cleanMessage = string.Empty; if (txtCantidad.Text == string.Empty) { cleanMessage = "Ingresar cantidad"; ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true); } else { BE_MOD_REQUERIMIENTO oBESol = new BE_MOD_REQUERIMIENTO(); oBESol.IDE_MOD = Convert.ToInt32(string.IsNullOrEmpty(lblCodigo.Text) ? "0" : lblCodigo.Text); oBESol.CODIGO = string.Empty; oBESol.FECHA_REQUERIMIENTO = txtFecha.Text.Trim(); oBESol.IP_CENTRO = ddlcentro.SelectedValue.ToString(); oBESol.CENTRO = ddlcentro.SelectedValue.ToString(); oBESol.USER_REGISTRO = Session["IDE_USUARIO"].ToString(); int dtrpta = 0; dtrpta = new BL_MOD_REQUERIMIENTO().uspINS_MOD_REQUERIMIENTO(oBESol); if (dtrpta > 0) { lblCodigo.Text = dtrpta.ToString(); BE_MOD_REQUERIMIENTO_DETALLE oBESolD = new BE_MOD_REQUERIMIENTO_DETALLE(); oBESolD.IDE_REQUERIMIENTO = 0; oBESolD.IDE_MOD = dtrpta; oBESolD.IDE_CATEGORIA = Convert.ToInt32(ddlCategoria.SelectedValue); oBESolD.IDE_ESPECIALIDAD = Convert.ToInt32(ddlespecialidad.SelectedValue); oBESolD.CANTIDAD = Convert.ToInt32(string.IsNullOrEmpty(txtCantidad.Text) ? "0" : txtCantidad.Text); oBESolD.IP_CENTRO = ddlcentro.SelectedValue.ToString(); oBESolD.USER_REGISTRO = Session["IDE_USUARIO"].ToString(); int dtrpta2 = 0; dtrpta2 = new BL_MOD_REQUERIMIENTO().uspINS_MOD_REQUERIMIENTO_DETALLE(oBESolD); cleanMessage = "Registro exitoso."; ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true); //lblCodigo.Text = string.Empty; Listar(); } } }