protected void Page_Load(object sender, EventArgs e) { GM_PlanCampania DatosAux = new GM_PlanCampania { Conexion = Comun.Conexion, IDUsuario = Comun.IDUsuario }; GM_PlanCampaniaNegocio FN = new GM_PlanCampaniaNegocio(); if (Request.QueryString["op"] != null && Request.QueryString["op"] == "3") { if (Request.QueryString["id"] != null) { string AuxID = Request.QueryString["id"].ToString(); DatosAux.IDPElectoral = AuxID; FN.EliminarIdCampania(DatosAux); if (DatosAux.Completado) { string ScriptError = DialogMessage.Show(TipoMensaje.Success, "Registro eliminado correctamente.", "Información", ShowMethod.FadeIn, HideMethod.FadeOut, ToastPosition.TopFullWidth, true); ScriptManager.RegisterStartupScript(this, typeof(Page), "popup", ScriptError, true); } else { string ScriptError = DialogMessage.Show(TipoMensaje.Error, "Error al eliminar el registro.", "Error", ShowMethod.FadeIn, HideMethod.FadeOut, ToastPosition.TopFullWidth, true); ScriptManager.RegisterStartupScript(this, typeof(Page), "popup", ScriptError, true); } } } ListaC = FN.ObtenerListCampania(DatosAux); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Request.QueryString["op"] != null) { if (Request.QueryString["op"] == "2") { if (Request.QueryString["id"] != null) { string ID = Request.QueryString["id"].ToString(); GM_PlanCampania Datos = new GM_PlanCampania { Conexion = Comun.Conexion, IDPElectoral = ID }; GM_PlanCampaniaNegocio AWN = new GM_PlanCampaniaNegocio(); Lista = AWN.ObtenerListCampania1(Datos); CargarProyectos(); } else { } } else { } } else { } } else { } }
public void CargarProyectos() { GM_PlanCampania Datos = new GM_PlanCampania { Conexion = Comun.Conexion }; GM_PlanCampaniaNegocio PCN = new GM_PlanCampaniaNegocio(); ListaB = PCN.ObtenerListCampaniaMas(Datos); }
public void CargarProyectosMas() { try { GM_PlanCampania Datos = new GM_PlanCampania { Conexion = Comun.Conexion }; GM_PlanCampaniaNegocio GN = new GM_PlanCampaniaNegocio(); ListaM = GN.ObtenerListCampaniaMas(Datos); } catch (Exception ex) { throw ex; } }
protected void Page_Load(object sender, EventArgs e) { string IDFoto = ""; GM_PlanCampania FN = new GM_PlanCampania { Conexion = Comun.Conexion, IDUsuario = Comun.IDUsuario }; GM_PlanCampaniaNegocio PN = new GM_PlanCampaniaNegocio(); if (Request.QueryString["op"] != null && Request.QueryString["op"] == "3") { if (Request.QueryString["id"] != null) { IDFoto = Request.QueryString["id"].ToString(); if (Request.QueryString["id"].ToString() == IDFoto) { FN.IDPElectoral = Request.QueryString["id2"].ToString(); FN.IDFoto = IDFoto; PN.CargarFotoPlanCampania(FN); if (FN.Completado) { Response.Redirect("frmProyectoCampania.aspx", false); string ScriptError = DialogMessage.Show(TipoMensaje.Success, "Registro agregado a la página correctamente.", "Información", ShowMethod.FadeIn, HideMethod.FadeOut, ToastPosition.TopFullWidth, true); } else { string ScriptError = DialogMessage.Show(TipoMensaje.Error, "No se puede agregar el registro a la página registro.", "Error", ShowMethod.FadeIn, HideMethod.FadeOut, ToastPosition.TopFullWidth, true); ScriptManager.RegisterStartupScript(this, typeof(Page), "popup", ScriptError, true); } } } } else if (Request.QueryString["op"] != null && Request.QueryString["op"] == "4") { if (Request.QueryString["id"] != null) { IDProyecto = Request.QueryString["id"].ToString(); FN.IDPElectoral = IDProyecto; Lista = PN.ObtenerCatalogoFotos(FN); } } }
private void Save(bool NuevoRegistro, string IDPElectoral, string titulo, string proyec1, string proyec2, string proyec3, string proyecp) { try { GM_PlanCampania Data = new GM_PlanCampania { NuevoRegistro = NuevoRegistro, IDPElectoral = IDPElectoral, TituloProyecto = titulo, Proyecto1 = proyec1, Proyecto2 = proyec2, Proyecto3 = proyec3, ProyectoP = proyecp, Conexion = Comun.Conexion, IDUsuario = User.Identity.Name }; GM_PlanCampaniaNegocio CN = new GM_PlanCampaniaNegocio(); CN.AGPlanCampania(Data); if (Data.Completado) { string ScripSucces = DialogMessage.Show(TipoMensaje.Success, "Los datos se han guardado.", "Correctamente", ShowMethod.FadeIn, HideMethod.FadeOut, ToastPosition.TopFullWidth, true); ScriptManager.RegisterStartupScript(this, typeof(Type), "popup", ScripSucces, true); Response.Redirect("frmViewProyectoCampania.aspx", false); } else { string ScriptError = DialogMessage.Show(TipoMensaje.Error, "Error al guardar los datos.", "Error", ShowMethod.FadeIn, HideMethod.FadeOut, ToastPosition.TopFullWidth, true); ScriptManager.RegisterStartupScript(this, typeof(Page), "popup", ScriptError, true); Response.Redirect("frmViewProyectoCampania.aspx", false); } } catch (Exception ex) { throw ex; // Response.Redirect("frmPlanCampania.aspx", false); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Request.QueryString["op"] != null) { if (Request.QueryString["op"] == "2") { if (Request.QueryString["id"] != null) { string ID = Request.QueryString["id"].ToString(); if (Request.QueryString["id"].ToString() == ID) { GM_PlanCampania DatosAux = new GM_PlanCampania { Conexion = Comun.Conexion, IDPElectoral = ID }; GM_PlanCampaniaNegocio CN = new GM_PlanCampaniaNegocio(); CN.ObtenerIdPlanCampania(DatosAux); if (DatosAux.Completado) { this.LoadData(DatosAux); } else { Response.Redirect("frmProyectoCampania.aspx?error=" + "Error al cargar los datos&nError=1"); } } else { Response.Redirect("frmProyectoCampania.aspx"); } } else { Response.Redirect("frmProyectoCampania.aspx"); } } else { Response.Redirect("frmProyectoCampania.aspx"); } } else { //this.runC(); } } else { string txtTitulo = Request.Form["ctl00$cph_MasterBody$txtNombreProyecto"].ToString(); string txtProy1 = Request.Form["ctl00$cph_MasterBody$txtNombreProyecto"].ToString(); string txtProy2 = Request.Form["ctl00$cph_MasterBody$txtNombreProyecto"].ToString(); string txtProy3 = Request.Form["ctl00$cph_MasterBody$txtNombreProyecto"].ToString(); string txtProyP = Request.Form["ctl00$cph_MasterBody$txtNombreProyecto"].ToString(); string IDPElectoral = ""; try { string AuxID = Request.Form["ctl00$cph_MasterBody$hf"].ToString(); IDPElectoral = AuxID; bool NuevoRegistro = string.IsNullOrEmpty(IDPElectoral); this.Save(NuevoRegistro, IDPElectoral, txtTitulo, txtProy1, txtProy2, txtProy3, txtProyP); } catch (Exception ex) { Response.Redirect("ErrorPage.aspx?msjError=" + ex.Message); } } }