Exemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!ValidarConexionYUsuarioLogueado(sender))
            {
                return;
            }
            if (Session["connectionString"] == null || Session["USER"] == null)
            {
                ScriptManager.RegisterStartupScript(this, GetType(), "Logoff", "LogOff();", true);
                UiVistaTareasSinGestion.JSProperties.Add("cpLocation", "Enable");
                return;
            }
            if (!IsPostBack)
            {
                UiFechaInicio.Value = DateTime.Today;
                UiFechaFinal.Value  = DateTime.Today;
                UsuarioDeseaObtenerTareasSinGestion?.Invoke(sender, new  TareaArgumento {
                    Data = new Tarea {
                        START_DATE = DateTime.Today, END_DATE = DateTime.Today
                    }
                });
            }

            if (Session["UiVistaTareasSinGestion"] != null)
            {
                UiVistaTareasSinGestion.DataSource = Session["UiVistaTareasSinGestion"];
                UiVistaTareasSinGestion.DataBind();
                GenerarReporteVistaGeneral();
            }
        }
Exemplo n.º 2
0
 protected void UiVistaTareasSinGestion_CustomCallback(object sender, DevExpress.Web.ASPxGridViewCustomCallbackEventArgs e)
 {
     if (!ValidarConexionYUsuarioLogueado(sender))
     {
         return;
     }
     switch (e.Parameters.Split('|')[0])
     {
     case "ObtenerTareasSinGestion":
         var tarea = new Tarea();
         tarea.START_DATE = DateTime.Parse(UiFechaInicio.Value.ToString());
         tarea.END_DATE   = DateTime.Parse(UiFechaFinal.Value.ToString());
         if (tarea.START_DATE > tarea.END_DATE)
         {
             UiVistaTareasSinGestion.JSProperties.Add("cpError", "La fecha inicio es mayor a la fecha final");
         }
         else
         {
             UsuarioDeseaObtenerTareasSinGestion?.Invoke(sender, new  TareaArgumento {
                 Data = tarea
             });
         }
         break;
     }
 }