public void Guardar(bool NuevoRegistro, string ID, string Url, string Alt, string Title, string Description) { try { GM_VideosLoad Datos = new GM_VideosLoad() { NuevoVideo = NuevoRegistro, IDVideo = ID, Url = Url, Alt = Alt, Title = Title, Description = Description, Conexion = Comun.Conexion, IDUsuario = Comun.IDUsuario }; GM_VideoNegocio VN = new GM_VideoNegocio(); VN.ACStatuVideo(Datos); if (Datos.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("frmVideosView.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("frmVideosView.aspx", false); } } catch (Exception ex) { throw ex; } }
public void CargarView() { try { GM_VideosLoad Datos = new GM_VideosLoad() { Conexion = Comun.Conexion }; GM_VideoNegocio GV = new GM_VideoNegocio(); Lista = GV.ObtenerListStatusVideoPagina(Datos); } catch (Exception ex) { throw ex; } }
protected void Page_Load(object sender, EventArgs e) { try { if (Request.QueryString["op"] != null && Request.QueryString["op"] == "3") { ID = Request.QueryString["id"]; GM_VideosLoad DatosAux = new GM_VideosLoad { Conexion = Comun.Conexion, IDVideo = ID, IDUsuario = Comun.IDUsuario }; GM_VideoNegocio CN = new GM_VideoNegocio(); CN.EliminarSVideo(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 guardar los datos.", "Error", ShowMethod.FadeIn, HideMethod.FadeOut, ToastPosition.TopFullWidth, true); ScriptManager.RegisterStartupScript(this, typeof(Page), "popup", ScriptError, true); } } if (!IsPostBack) { //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); } else { } this.CargarView(); if (Request.QueryString["errorMessage"] != null) { string ScriptError = DialogMessage.Show(TipoMensaje.Error, "Error al cargar los datos. Intenté nuevamente", "Error", ShowMethod.FadeIn, HideMethod.FadeOut, ToastPosition.TopFullWidth, true); ScriptManager.RegisterStartupScript(this, typeof(Page), "popup", ScriptError, true); } } catch (Exception ex) { Response.Redirect("PageError.aspx?errorNumber=" + ex.HResult); } }
protected void Page_Load(object sender, EventArgs e) { GM_VideosLoad DatosAux = new GM_VideosLoad { Conexion = Comun.Conexion, IDUsuario = Comun.IDUsuario }; GM_VideoNegocio CN = new GM_VideoNegocio(); RR_AdministradorWebNegocio RN = new RR_AdministradorWebNegocio(); try { if (Request.QueryString["op"] != null && Request.QueryString["op"] == "3") { if (Request.QueryString["id"] != null) { string ID = Request.QueryString["id"].ToString(); if (Request.QueryString["id"].ToString() == ID) { DatosAux.NuevoVideo = true; DatosAux.IDVideo = ID; RN.CargaVideoXID(DatosAux); if (DatosAux.Completado) { string ScriptError = DialogMessage.Show(TipoMensaje.Success, "Registro agregado a la página 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, "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); } } } } } catch (Exception ex) { Response.Redirect("PageError.aspx?errorNumber=" + ex.HResult); } Lista = CN.ObtenerListStatusVideo(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) { ID = Request.QueryString["id"]; GM_VideosLoad DatosAux = new GM_VideosLoad { Conexion = Comun.Conexion, IDVideo = ID }; GM_VideoNegocio CN = new GM_VideoNegocio(); CN.ObtenerDetalleVideo(DatosAux); if (DatosAux.Completado) { this.CargarDatos(DatosAux); } else { Response.Redirect("frmVideosLoad.aspx?errorMessage=" + DatosAux.Resultado); } } else { Response.Redirect("frmVideosLoad.aspx?errorMessage=2"); } } else { Response.Redirect("frmVideosLoad.aspx?errorMessage=3"); } } else { this.IniciarDatos(); } } else { string txtUrl = Request.Form["ctl00$cph_MasterBody$txtUrl"].ToString(); string txtAlt = Request.Form["ctl00$cph_MasterBody$txtAlt"].ToString(); string txtTitle = Request.Form["ctl00$cph_MasterBody$txtTitle"].ToString(); string txtDescription = Request.Form["ctl00$cph_MasterBody$txtDescription"].ToString(); string IDVideo = ""; try { string AuxID = Request.Form["ctl00$cph_MasterBody$hf"].ToString(); IDVideo = AuxID; bool NuevoRegistro = string.IsNullOrEmpty(IDVideo); this.Guardar(NuevoRegistro, IDVideo, txtUrl, txtAlt, txtTitle, txtDescription); } catch (Exception ex) { Response.Redirect("ErrorPage.aspx?msjError=" + ex.Message); } } }