예제 #1
0
        //private IAlertaServiceObject aAlertaSO;
        //private IAlertaServiceObject Alerta
        //{ get { return (aAlertaSO == null) ? aAlertaSO = new AlertaServiceObject() : aAlertaSO; } }
        #endregion
        #region Methods

        #region Event Handlers
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack && !Page.IsCallback)
            {
                LAMOSA.SCPP.Server.BusinessEntity.Usuario user = (LAMOSA.SCPP.Server.BusinessEntity.Usuario)Session["UserLogged"];
                if (user != null)
                {
                    svcSCPP.SCPPClient svc = new svcSCPP.SCPPClient();
                    svcTipoAlerta.ITipoAlertaServiceManager     svcTipoAlertaSM   = new svcTipoAlerta.TipoAlertaServiceManagerClient();
                    svcAlerta.IAlertaServiceManager             svcAlertaSM       = new svcAlerta.AlertaServiceManagerClient();
                    svcConfigAlerta.IConfigAlertaServiceManager svcConfigAlertaSM = new  svcConfigAlerta.ConfigAlertaServiceManagerClient();

                    ddlPlanta.Items.AddRange(GetItemsConSeleccioneTodos(svc.ObtenerPlantaCbo(), "DescripcionPlanta", "ClavePlanta"));
                    ddlProceso.Items.AddRange(GetItemsConSeleccioneTodos(svc.ObtenerProcesoCbo(int.Parse(ddlPlanta.SelectedValue)), "DescripcionProceso", "ClaveProceso"));
                    //   Instaciar el servicio.

                    //     ddlTipoAlerta.Items.AddRange(GetItemsConSeleccioneTodos(svc.ObtenerTiposArticuloCbo(), "DesTipoArticulo", "CodTipoArticulo"));
                    // ITipoAlerta i = new TipoAlerta();
                    //IList <ITipoAlerta> Lista = Alerta.ObtenerTipoAlerta(i);

                    // ddlTipoAlerta.Items.AddRange(GetItemsConSeleccioneTodos(Alerta.ObtenerTipoAlerta(i), "DesTipoArticulo", "CodTipoArticulo");

                    //  ddlTipoAlerta.Items.AddRange(GetItemsConSeleccioneObj(svcTipoAlertaSM.Obtener(new svcTipoAlerta.TipoAlerta()), "Descripcion", "Codigo"));
                    ddlTipoAlerta.Items.AddRange(GetItemsConSeleccioneTodosObj(svcTipoAlertaSM.Obtener(new svcTipoAlerta.TipoAlerta()), "Descripcion", "Codigo"));
                    llenarvacio();

/*
 *
 *                  LExport.Visible = true;
 *                  LAddNew.Visible = true;
 *                  bool editar = false;
 *                  foreach (ScreenPermission sp in new Actions().GetActionBySreen(user.CodRol, Request.Url.LocalPath))
 *                  {
 *                      switch (sp.ActionCode)
 *                      {
 *                          case 1: //Buscar
 *
 *                              break;
 *                          case 2: //Exportar
 *                              LExport.Visible = true;
 *                              break;
 *                          case 3: //Nuevo
 *                              LAddNew.Visible = true;
 *                              break;
 *                          case 4: //Editar
 *                              editar = true;
 *                              UltraWebGrid1.DisplayLayout.AllowUpdateDefault = AllowUpdate.RowTemplateOnly;
 *                              break;
 *                      }
 *
 *                  }
 *
 *                  if (editar == false)
 *                  {
 *                      UltraWebGrid1.DisplayLayout.AllowUpdateDefault = AllowUpdate.No;
 *                  }*/
                }
            }
        }
예제 #2
0
 protected void BotonEliminar_click(object sender, EventArgs e)
 {
     svcSCPP.SCPPClient svc = new svcSCPP.SCPPClient();
     LAMOSA.SCPP.Server.BusinessEntity.Usuario u = new LAMOSA.SCPP.Server.BusinessEntity.Usuario();
     try
     {
         u.CodUsuario = int.Parse(hddCodUsuario.Value);
         svc.EliminaUsuario(u);
         llenaGrid();
         WebAsyncRefreshPanel1.DataBind();
     }
     catch (Exception err)
     {
         throw err;
     }
 }
예제 #3
0
        protected void BotonGuardar_click(object sender, EventArgs e)
        {
            svcSCPP.SCPPClient svc = new svcSCPP.SCPPClient();
            LAMOSA.SCPP.Server.BusinessEntity.Usuario u = new LAMOSA.SCPP.Server.BusinessEntity.Usuario();
            try
            {
                u.NombreUsuario = hddNombreUsuario.Value;
                //u.Contrasena= hddContrasena.Value;
                u.Contrasena = "Lamosa06";
                int CodEmpleado = -1;
                int.TryParse(hddCodEmpleado.Value, out CodEmpleado);
                u.CodEmpleado = CodEmpleado;

                int CodRol = -1;
                int.TryParse(hddCodRol.Value, out CodRol);
                u.CodRol = CodRol;

                int Supervisor = -1;
                int.TryParse(hddSupervisor.Value, out Supervisor);
                u.CodSupervisor = Supervisor;

                if (hddBloqueado.Value.ToLower() == @"'true'")
                {
                    u.Bloqueado = true;
                }

                u.Email = hddCorreo.Value;

                int CodUsuario = -1;
                int.TryParse(hddCodUsuario.Value, out CodUsuario);
                u.CodUsuario = CodUsuario;

                u = svc.GuardarUsuario(u);

                WebAsyncRefreshPanel1.DataBind();
                if (u.ExceptionMessage != null && u.ExceptionMessage.Length > 1)
                {
                    throw new Exception(u.ExceptionMessage);
                }
            }
            catch (Exception err)
            {
                CallBackManager.AddScriptBlock(this.Page, WebAsyncRefreshPanel1, "<script type='text/javascript'>alert('" + err.Message + "');</script>");
            }
            llenaGrid();
        }
예제 #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack && !Page.IsCallback)
            {
                LAMOSA.SCPP.Server.BusinessEntity.Usuario user = (LAMOSA.SCPP.Server.BusinessEntity.Usuario)Session["UserLogged"];
                if (user != null)
                {
                    svcSCPP.SCPPClient svc = new svcSCPP.SCPPClient();
                    ddlPlanta.Items.AddRange(GetItemsConSeleccioneTodos(svc.ObtenerPlantaCbo(), "DescripcionPlanta", "ClavePlanta"));
                    ddlProceso.Items.AddRange(GetItemsConSeleccioneTodos(svc.ObtenerProcesoCbo(int.Parse(ddlPlanta.SelectedValue)), "DescripcionProceso", "ClaveProceso"));
                    //   Instaciar el servicio.

                    //     ddlTipoAlerta.Items.AddRange(GetItemsConSeleccioneTodos(svc.ObtenerTiposArticuloCbo(), "DesTipoArticulo", "CodTipoArticulo"));
                    //  ITipoAlerta i = new TipoAlerta();
                    //IList <ITipoAlerta> Lista = Alerta.ObtenerTipoAlerta(i);

                    // ddlTipoAlerta.Items.AddRange(GetItemsConSeleccioneTodos(Alerta.ObtenerTipoAlerta(i), "DesTipoArticulo", "CodTipoArticulo");

                    //ddlTipoAlerta.DataSource = Alerta.ObtenerTipoAlerta(i);
                    //ddlTipoAlerta.DataTextField = "DescripcionTipoAlerta";
                    //ddlTipoAlerta.DataValueField = "ClaveTipoAlerta";
                    //ddlTipoAlerta.DataBind();
                    //ddlTipoAlerta.Items.Insert(0, new System.Web.UI.WebControls.ListItem("Seleccione...", "0"));
                    //ddlTipoAlerta.Items.Insert(1, new System.Web.UI.WebControls.ListItem("Todos", "-1"));

/*
 *                  ddlPlanta.DataSource = new Combos().Get_Planta_RolCbo(user.CodRol);
 *                  ddlPlanta.DataTextField = "descripcionPlanta";
 *                  ddlPlanta.DataValueField = "ClavePlanta";
 *                  ddlPlanta.DataBind();
 *                  ddlPlanta.Items.Insert(0, new System.Web.UI.WebControls.ListItem("Seleccione...", "0"));
 *                  ddlPlanta.Items.Insert(1, new System.Web.UI.WebControls.ListItem("Todos", "-1"));
 *                  llenaGrid();*/

                    /*
                     * ddlProceso.DataSource = new Combos().Get_ProcesoCbo();
                     * ddlProceso.DataTextField = "DescripcionProceso";
                     * ddlProceso.DataValueField = "ClaveProceso";
                     * ddlProceso.DataBind();
                     * ddlProceso.Items.Insert(0, new System.Web.UI.WebControls.ListItem("Seleccione...", "0"));
                     * ddlProceso.Items.Insert(1, new System.Web.UI.WebControls.ListItem("Todos", "-1"));
                     * ddlProceso.Items.AddRange(GetItemsConSeleccioneTodos(svc.ObtenerProcesoCbo(int.Parse(ddlPlanta.SelectedValue)), "DescripcionProceso", "ClaveProceso"));
                     * LExport.Visible = true;
                     * LAddNew.Visible = true;
                     * bool editar = false;
                     * foreach (ScreenPermission sp in new Actions().GetActionBySreen(user.CodRol, Request.Url.LocalPath))
                     * {
                     *  switch (sp.ActionCode)
                     *  {
                     *      case 1: //Buscar
                     *
                     *          break;
                     *      case 2: //Exportar
                     *          LExport.Visible = true;
                     *          break;
                     *      case 3: //Nuevo
                     *          LAddNew.Visible = true;
                     *          break;
                     *      case 4: //Editar
                     *          editar = true;
                     *          UltraWebGrid1.DisplayLayout.AllowUpdateDefault = AllowUpdate.RowTemplateOnly;
                     *          break;
                     *  }
                     *
                     * }
                     *
                     * if (editar == false)
                     * {
                     *  UltraWebGrid1.DisplayLayout.AllowUpdateDefault = AllowUpdate.No;
                     * }*/
                }
            }
        }