protected void GridView_Asignaciones_InitNewRow(object sender, DevExpress.Web.Data.ASPxDataInitNewRowEventArgs e) { try { GridView_Asignaciones.CancelEdit(); Session["RegistrarAsignacion"] = "0"; Response.Redirect("RegistrarAsignacion.aspx", true); } catch (Exception Ex) { FG.Controlador_Error(Ex, Page.Response); } }
protected void GridView_Asignaciones_StartRowEditing(object sender, DevExpress.Web.Data.ASPxStartRowEditingEventArgs e) { try { GridView_Asignaciones.CancelEdit(); Session["RegistrarAsignacion"] = e.EditingKeyValue; Response.Redirect("RegistrarAsignacion.aspx", true); } catch (Exception Ex) { FG.Controlador_Error(Ex, Page.Response); } }
protected void GridView_Asignaciones_CustomButtonCallback(object sender, ASPxGridViewCustomButtonCallbackEventArgs e) { try { if (e.ButtonID == "PlanPago") { string IdAsignacion = GridView_Asignaciones.GetRowValues(e.VisibleIndex, "IdAsignacion").ToString(); Session["ReportName"] = "PlanPago"; string host = HttpContext.Current.Request.UrlReferrer.GetLeftPart(UriPartial.Authority) + Request.ApplicationPath + "/Reportes/ReportViewer.aspx?RP=" + IdAsignacion; Response.Redirect(host); } } catch (Exception Ex) { FG.Controlador_Error(Ex, Page.Response); } }
protected void Button_Anular_Click(object sender, EventArgs e) { try { if (Memo_MotivoAnular.Text == "") { ScriptManager.RegisterStartupScript(Page, Page.GetType(), "err_msj", "alert('Ingrese el motivo de anulación.');", true); return; } if (lblIdAnular.Text != "") { int IdAnular = Convert.ToInt32(lblIdAnular.Text.Trim()); FG._NombreUsuario = HttpContext.Current.User.Identity.Name; string IdentityUser = FG.CrearIdentificadorUsuario(FG._NombreUsuario); Neg.AnularAsignacion(IdAnular, Memo_MotivoAnular.Text, IdentityUser); string MsjSQL = FG.Obtener_MensajeSQL(IdentityUser); if (MsjSQL != "") { ScriptManager.RegisterStartupScript(Page, Page.GetType(), "err_msj", "alert('" + MsjSQL + "');", true); return; } else { ASPxPopupControl_Anular.ShowOnPageLoad = false; GridView_Asignaciones.DataBind(); ScriptManager.RegisterStartupScript(Page, Page.GetType(), "err_msj", "alert('Asignacion anulada con éxito.');", true); return; } } else { ASPxPopupControl_Anular.ShowOnPageLoad = false; } } catch (Exception Ex) { FG.Controlador_Error(Ex, Page.Response); } }