示例#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 Page_Load(object sender, EventArgs e)
        {
            //hdnId.Value = "25";
            if (!Page.IsPostBack && !Page.IsCallback)
            {
                Usuario user = (Usuario)Session["UserLogged"];
                if (user != null)
                {
                    if (string.IsNullOrEmpty(Request.Params["config"]))
                    {
                        hdnId.Value = "0";
                    }
                    else
                    {
                        hdnId.Value = Request.Params["config"];
                    }

                    svcSCPP.SCPPClient svc = new svcSCPP.SCPPClient();
                    svcTipoAlerta.ITipoAlertaServiceManager svcTipoAlertaSM = new svcTipoAlerta.TipoAlertaServiceManagerClient();
                    svcFrecuencia.IFrecuenciaServiceManager svcFrecuenciaSM = new svcFrecuencia.FrecuenciaServiceManagerClient();
                    svcAlerta.IAlertaServiceManager         svcAlertaSM     = new svcAlerta.AlertaServiceManagerClient();


                    ddlTipoArticulo.Items.AddRange(GetItemsConSeleccioneTodos(svc.ObtenerTiposArticuloCbo(), "DesTipoArticulo", "CodTipoArticulo"));

                    ddlColor.Items.AddRange(GetItemsConSeleccioneTodos(svc.ObtenerColores(), "ClaveColor", "CodColor"));

                    ddlTurno.Items.AddRange(GetItemsConSeleccioneTodos(svc.ObtenerTurnos(), "DesTurno", "CodTurno"));

                    ddlZonaDefecto.Items.AddRange(GetItemsConSeleccioneTodos(svc.ObtenerZonaDefectoCbo(), "DesZonaDefecto", "CodZonaDefecto"));

                    ddlPlanta.Items.AddRange(GetItemsConSeleccioneTodos(svc.ObtenerPlantaCbo(), "DescripcionPlanta", "ClavePlanta"));

                    ddlDesperdicio.Items.AddRange(GetItemsConSeleccioneTodos(svc.ObtenerTiposDefecto(), "DesTipoDefecto", "CodTipoDefecto"));

                    dllTipoAlerta.DataSource     = svcTipoAlertaSM.Obtener(new svcTipoAlerta.TipoAlerta());
                    dllTipoAlerta.DataTextField  = "Descripcion";
                    dllTipoAlerta.DataValueField = "Codigo";
                    dllTipoAlerta.DataBind();

                    dllFrecuencia.DataSource     = svcFrecuenciaSM.Obtener(new svcFrecuencia.Frecuencia());
                    dllFrecuencia.DataTextField  = "Descripcion";
                    dllFrecuencia.DataValueField = "Codigo";
                    dllFrecuencia.DataBind();

                    if (hdnId.Value != "0")
                    {
                        llenaControles(int.Parse(hdnId.Value));
                    }
                    else
                    {
                        ddlProceso.Items.AddRange(GetItemsConSeleccioneTodos(null, "", ""));
                        ddlMaquina.Items.AddRange(GetItemsConSeleccioneTodos(null, "", ""));
                        ddlModelo.Items.AddRange(GetItemsConSeleccioneTodos(null, "", ""));
                        ddlCalidad.Items.AddRange(GetItemsConSeleccioneTodos(null, "", ""));
                        ddlDefecto.Items.AddRange(GetItemsConSeleccioneTodos(null, "", ""));
                    }

                    LNuevo.Visible      = false;
                    ViewState["nuevo"]  = false;
                    ViewState["editar"] = false;

                    foreach (ScreenPermission sp in new Actions().GetActionBySreen(user.CodRol, Request.Url.LocalPath))
                    {
                        switch (sp.ActionCode)
                        {
                        case 1:     //Buscar
                            break;

                        case 2:     //Exportar
                            break;

                        case 3:     //Nuevo
                            LNuevo.Visible     = true;
                            btnGuardar.Visible = true;
                            ViewState["nuevo"] = true;
                            break;

                        case 4:     //Editar
                            ViewState["editar"] = true;
                            btnGuardar.Visible  = true;
                            break;
                        }
                    }
                }
            }
        }