protected void btnAprobar_Click(object sender, EventArgs e) { DBConn oConn = new DBConn(); if (oConn.Open()) { cContratos oContratos = new cContratos(ref oConn); oContratos.IsNullFacturadoAdvance = true; DataTable dtContratos = oContratos.GetForInvoceAdvance(); if (dtContratos != null) { foreach (DataRow oRow in dtContratos.Rows) { putAprobarAdvanceAll(oRow["num_contrato"].ToString(), oRow["no_contrato"].ToString()); } StringBuilder js = new StringBuilder(); js.Append("function LgRespuesta() {"); js.Append(" window.radalert('Todas las facturas han sido emitidas con éxito.', 330, 210); "); js.Append(" Sys.Application.remove_load(LgRespuesta); "); js.Append("};"); js.Append("Sys.Application.add_load(LgRespuesta);"); Page.ClientScript.RegisterStartupScript(this.GetType(), "radalert", js.ToString(), true); rdGridLicen.Rebind(); } dtContratos = null; } oConn.Close(); }
protected void rdGridLicen_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e) { DBConn oConn = new DBConn(); if (oConn.Open()) { cContratos oContratos = new cContratos(ref oConn); oContratos.IsNullFacturadoAdvance = true; oContratos.Aprobado = true; DataTable dtContratos = oContratos.GetForInvoceAdvance(); rdGridLicen.DataSource = dtContratos; } oConn.Close(); }