protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsCallback)
        {
            Master.nBotonera           = 49;
            Master.Botonera.ItemClick += new ToolBarEventHandler(this.Botonera_Click);

            Master.TituloPagina = "Copia de profesionales asignados";
            Master.FuncionesJavaScript.Add("Javascript/draganddrop.js");
            Master.FuncionesJavaScript.Add("Javascript/boxover.js");
            Master.bFuncionesLocales = true;
            if (!Page.IsPostBack)
            {
                try
                {
                    //if (!(bool)Session["FORANEOS"])
                    //{
                    //    this.imgForaneo.Visible = false;
                    //    this.lblForaneo.Visible = false;
                    //}
                    sNodo = Estructura.getDefCorta(Estructura.sTipoElem.NODO);
                    this.txtIdTarea.Focus();
                }
                catch (Exception ex)
                {
                    Master.sErrores = Errores.mostrarError("Error al obtener los datos", ex);
                }
            }
            string cbRespuesta = Page.ClientScript.GetCallbackEventReference(this, "arg", "RespuestaCallBack", "context", false);
            string cbLlamada   = "function RealizarCallBack(arg, context)" + "{" + cbRespuesta + ";" + "}";
            Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "RealizarCallBack", cbLlamada, true);
        }
    }
Esempio n. 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsCallback)
        {
            if (Session["IDRED"] == null)
            {
                try
                {
                    Response.Redirect("~/SesionCaducadaModal.aspx", true);
                }
                catch (System.Threading.ThreadAbortException) { return; }
            }

            sErrores = "";
            try
            {//Cargo la denominacion del label Nodo
                string sNodo = Estructura.getDefCorta(Estructura.sTipoElem.NODO);
                if (sNodo.Trim() != "")
                {
                    this.lblNodo.InnerText = sNodo + "s a asignar";
                }
                strTablaHtml = ObtenerNodos();
            }
            catch (Exception ex)
            {
                sErrores += Errores.mostrarError("Error al obtener los datos", ex);
            }
            string cbRespuesta = Page.ClientScript.GetCallbackEventReference(this, "arg", "RespuestaCallBack", "context", false);
            string cbLlamada   = "function RealizarCallBack(arg, context)" + "{" + cbRespuesta + ";" + "}";
            Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "RealizarCallBack", cbLlamada, true);
        }
    }
Esempio n. 3
0
    /// <summary>
    /// Crea una estructura en el mapa.
    /// </summary>
    public void AddBuildInMap(int x, int y, Estructura estructura)
    {
        if (x < 0 || y < 0 || x >= totalSize.x || y >= totalSize.y)
        {
            return;
        }

        if (!map[x, y].CreateBuild(estructura))
        {
            Debug.LogWarning("No se ha podido crear la estructura.");
            return;
        }

        //Busca si existe el tipo a crear
        //Si no existe, lo crea
        ESTRUCTURA _tipo = estructura.GetBuildType();

        if (builds.ContainsKey(_tipo))
        {
            if (!builds[_tipo].Contains(estructura))
            {
                builds[_tipo].Add(estructura);
            }
        }
        else
        {
            builds.Add(_tipo, new List <Estructura>());
        }

        IUpdatable[] _update = estructura.GetComponents <IUpdatable>();
        if (_update != null)
        {
            time.AddUpdatable(_update);
        }
    }
Esempio n. 4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsCallback)
        {
            if (Session["IDRED"] == null)
            {
                try
                {
                    Response.Redirect("~/SesionCaducadaModal.aspx", true);
                }
                catch (System.Threading.ThreadAbortException) { return; }
            }
            sErrores = "";
            try
            {
                cboTipoItem.Items.Add(new ListItem("", ""));
                cboTipoItem.Items.Add(new ListItem(Estructura.getDefLarga(Estructura.sTipoElem.SUPERNODO4), "1"));
                cboTipoItem.Items.Add(new ListItem(Estructura.getDefLarga(Estructura.sTipoElem.SUPERNODO3), "2"));
                cboTipoItem.Items.Add(new ListItem(Estructura.getDefLarga(Estructura.sTipoElem.SUPERNODO2), "3"));
                cboTipoItem.Items.Add(new ListItem(Estructura.getDefLarga(Estructura.sTipoElem.SUPERNODO1), "4"));
                cboTipoItem.Items.Add(new ListItem(Estructura.getDefLarga(Estructura.sTipoElem.NODO), "5"));
                cboTipoItem.Items.Add(new ListItem(Estructura.getDefLarga(Estructura.sTipoElem.SUBNODO), "6"));
                cboTipoItem.Items.Add(new ListItem("Proyecto", "7"));
                cboTipoItem.Items.Add(new ListItem("Contrato", "8"));
                cboTipoItem.Items.Add(new ListItem("Horizontal", "9"));
                cboTipoItem.Items.Add(new ListItem("Cliente", "10"));
                cboTipoItem.Items.Add(new ListItem("Oficina Técnica", "11"));
                cboTipoItem.Items.Add(new ListItem("Grupo Funcional", "12"));

                cboTipoItem.Items.Add(new ListItem("Cualificador Qn", "13"));
                if (Utilidades.EstructuraActiva("SN1"))
                {
                    cboTipoItem.Items.Add(new ListItem("Cualificador Q1", "14"));
                }
                if (Utilidades.EstructuraActiva("SN2"))
                {
                    cboTipoItem.Items.Add(new ListItem("Cualificador Q2", "15"));
                }
                if (Utilidades.EstructuraActiva("SN3"))
                {
                    cboTipoItem.Items.Add(new ListItem("Cualificador Q3", "16"));
                }
                if (Utilidades.EstructuraActiva("SN4"))
                {
                    cboTipoItem.Items.Add(new ListItem("Cualificador Q4", "17"));
                }
            }
            catch (Exception ex)
            {
                sErrores += Errores.mostrarError("Error al obtener los datos", ex);
            }

            //1º Se indican (por este orden) la función a la que se va a devolver el resultado
            //   y la función que va a acceder al servidor
            string cbRespuesta = Page.ClientScript.GetCallbackEventReference(this, "arg", "RespuestaCallBack", "context", false);
            string cbLlamada   = "function RealizarCallBack(arg, context)" + "{" + cbRespuesta + ";" + "}";
            //2º Se "registra" la función que va a acceder al servidor.
            Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "RealizarCallBack", cbLlamada, true);
        }
    }
Esempio n. 5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsCallback)
        {
            try
            {
                if (Session["IDRED"] == null)
                {
                    try
                    {
                        Response.Redirect("~/SesionCaducadaModal.aspx", true);
                    }
                    catch (System.Threading.ThreadAbortException) { return; }
                }

                if (Request.QueryString["cl"] != null)
                {//Código de cliente
                    this.hdnCli.Value = Utilidades.decodpar(Request.QueryString["cl"].ToString());
                }
                lblNodo2.InnerText = Estructura.getDefCorta(Estructura.sTipoElem.NODO);
                strHTML            = PROYECTO.GetProyectosExperienciaProfesional(null, int.Parse(this.hdnCli.Value));
            }
            catch (Exception ex)
            {
                sErrores += Errores.mostrarError("Error al obtener los datos", ex);
            }
            //1º Se indican (por este orden) la función a la que se va a devolver el resultado
            //   y la función que va a acceder al servidor
            string cbRespuesta = Page.ClientScript.GetCallbackEventReference(this, "arg", "RespuestaCallBack", "context", false);
            string cbLlamada   = "function RealizarCallBack(arg, context)" + "{" + cbRespuesta + ";" + "}";

            //2º Se "registra" la función que va a acceder al servidor.
            Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "RealizarCallBack", cbLlamada, true);
        }
    }
Esempio n. 6
0
    protected string ObtenerTecnicos(string strOpcion, string strValor1, string strValor2, string strValor3, string t305_idProyectoSubnodo, string sTiposProfesional, string sSoloActivos)
    {
        string        sResul = "", sV1, sV2, sV3;
        bool          bSoloActivos = true;
        StringBuilder sb           = new StringBuilder();

        try
        {
            sV1 = Utilidades.unescape(strValor1);
            sV2 = Utilidades.unescape(strValor2);
            sV3 = Utilidades.unescape(strValor3);

            if (sSoloActivos == "N")
            {
                bSoloActivos = false;
            }

            //SqlDataReader dr = Recurso.ObtenerRelacionProfesionalesTarifa(strOpcion, sV1, sV2, sV3, sCodUne, t305_idProyectoSubnodo, sCualidad, "", true);
            SqlDataReader dr = Recurso.GetProfesionales(strOpcion, sV1, sV2, sV3, t305_idProyectoSubnodo, sTiposProfesional, bSoloActivos);
            sb.Append("<table id='tblOpciones2' class='texto MAM' style='WIDTH: 440px;'>");
            sb.Append("<colgroup><col style='width:20px;' /><col style='width:420px;' /></colgroup>");
            sb.Append("<tbody>");
            while (dr.Read())
            {
                sb.Append("<tr style='height:20px;noWrap:true;' ");
                sb.Append("title=\"cssbody=[dvbdy] cssheader=[dvhdr] header=[<img src='../../../../images/info.gif' style='vertical-align:middle'> ");
                sb.Append("Información] body=[<label style='width:60px'>Profesional:&nbsp;</label>");
                sb.Append(dr["profesional"].ToString().Replace((char)34, (char)39) + "<br>");

                sb.Append("<label style='width:60px'>Usuario:&nbsp;</label>");
                sb.Append(int.Parse(dr["t314_idusuario"].ToString()).ToString("#,###"));
                sb.Append("<br><label style='width:60px'>");

                sb.Append(Estructura.getDefCorta(Estructura.sTipoElem.NODO) + "&nbsp;:</label>");
                //sb.Append(dr["t303_denominacion"].ToString().Replace((char)34, (char)39) + "<br><label style='width:60px'>Empresa&nbsp;:</label>");
                //sb.Append(dr["EMPRESA"].ToString().Replace((char)34, (char)39) + "] hideselects=[off]\"");
                sb.Append(dr["t303_denominacion"].ToString().Replace((char)34, (char)39) + "] hideselects=[off]\"");
                sb.Append("sexo='" + dr["t001_sexo"].ToString() + "' ");
                sb.Append("baja='" + dr["baja"].ToString() + "' ");

                //if (dr["t303_idnodo"].ToString() == "") sb.Append("tipo='E' ");
                //else sb.Append("tipo='P' ");
                sb.Append("tipo='" + dr["tipo"].ToString() + "' ");

                sb.Append(" id='" + dr["t314_idusuario"].ToString() + "' onclick='mm(event);' ondblclick='insertarRecurso(this);' onmousedown='DD(event)'>");
                sb.Append("<td></td><td><nobr class='NBR' style='width:410px;'>" + dr["Profesional"].ToString() + "</nobr></td></tr>");
            }
            dr.Close();
            dr.Dispose();
            sb.Append("</tbody>");
            sb.Append("</table>");
            sResul = "OK@#@" + sb.ToString();
        }
        catch (Exception ex)
        {
            sResul = "Error@#@" + Errores.mostrarError("Error al obtener la relación de profesionales.", ex);
        }

        return(sResul);
    }
Esempio n. 7
0
 private void cargarNodos()
 {
     try
     {
         bool bSeleccionado = false;
         //Cargo la denominacion del label Nodo
         this.lblNodo.InnerText = Estructura.getDefCorta(Estructura.sTipoElem.NODO);
         this.lblNodo.Attributes.Add("title", Estructura.getDefLarga(Estructura.sTipoElem.NODO));
         //Cargar el combo de nodos accesibles
         ListItem      oLI = null;
         SqlDataReader dr  = NODO.ObtenerNodosUsuarioSegunVisionProyectosTEC(null, (int)Session["UsuarioActual"], false, false);
         while (dr.Read())
         {
             //oLI = new ListItem(dr["Denominacion"].ToString(), dr["ID"].ToString());
             oLI = new ListItem(dr["denominacion"].ToString(), dr["identificador"].ToString());
             if (!bSeleccionado)
             {
                 oLI.Selected  = true;
                 bSeleccionado = true;
                 listaFunciones(dr["identificador"].ToString());
             }
             cboCR.Items.Add(oLI);
         }
         dr.Close();
         dr.Dispose();
     }
     catch (Exception ex)
     {
         sErrores += Errores.mostrarError("Error al cargar los nodos", ex);
     }
 }
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            if (!Page.IsCallback)
            {
                Master.bFuncionesLocales = true;
                Master.TituloPagina      = "Resumen Gráfico";
                Master.FuncionesJavaScript.Add("Javascript/FusionCharts.js");

                try
                {
                    this.lblNodo.InnerText = Estructura.getDefLarga(Estructura.sTipoElem.NODO);
                    this.txtAnno.Text      = DateTime.Now.Year.ToString();
                    cargarNodos();
                }
                catch (Exception ex)
                {
                    Master.sErrores = Errores.mostrarError("Error al obtener los datos", ex);
                }

                //1º Se indican (por este orden) la función a la que se va a devolver el resultado
                //   y la función que va a acceder al servidor
                string cbRespuesta = Page.ClientScript.GetCallbackEventReference(this, "arg", "RespuestaCallBack", "context", false);
                string cbLlamada   = "function RealizarCallBack(arg, context)" + "{" + cbRespuesta + ";" + "}";
                //2º Se "registra" la función que va a acceder al servidor.
                Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "RealizarCallBack", cbLlamada, true);
            }
        }
        catch (Exception ex)
        {
            Master.sErrores = Errores.mostrarError("Error al cargar los datos", ex);
        }
    }
Esempio n. 9
0
    /// <summary>
    /// Craftea el objeto que estuviera en cola.
    /// </summary>
    public void Craftear(Estructura build, GameAction action)
    {
        if (ComprobarAcceso(action) || build == null)
        {
            return;
        }

        Crafteable craftTable = build.GetComponent <Crafteable>();

        if (craftTable == null)
        {
            Debug.LogWarning("Craftear::ActionMethods error: Eso no es mesa de crafteo...");
            return;
        }

        Craft crafteo = craftTable.GetThisCraft();

        if (crafteo == null)
        {
            return;
        }

        foreach (ResourceInfo info in crafteo.requisitos)
        {
            action.worker.inventario.RemoveResource(info.type, info.quantity);
        }
        action.worker.inventario.AddResource(crafteo.obtencion.type, crafteo.obtencion.quantity);

        craftTable.FinishCraft();

        if (craftTable.HasMoreCrafts())
        {
            actions.CreateAction(action, action.worker, true, action.prioridad, craftTable.GetThisCraft().requisitos);
        }
    }
Esempio n. 10
0
        public bool Guardar(Estructura entidad)
        {
            bool respuesta = false;

            try
            {
                using (var cmd = CreateCommand())
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.CommandText = "usp_Estructura_Guardar";

                    cmd.Parameters.AddWithValue("@padreid", entidad.PadreId ?? Convert.DBNull);
                    cmd.Parameters.AddWithValue("@codigo", entidad.Codigo?.ToUpper() ?? Convert.DBNull);
                    cmd.Parameters.AddWithValue("@descripcion", entidad.Descripcion.ToUpper());
                    cmd.Parameters.AddWithValue("@tablero", entidad.Tablero);

                    entidad.Id = int.Parse(cmd.ExecuteScalar().ToString());
                    respuesta  = entidad.Id > 0;
                }
                return(respuesta);
            }
            catch (Exception)
            {
                throw new Exception("Ocurrió un problema al guardar una estructura.");
            }
        }
Esempio n. 11
0
        public bool Actualizar(Estructura entidad)
        {
            bool respuesta = false;

            try
            {
                using (var cmd = CreateCommand())
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.CommandText = "usp_Estructura_Actualizar";

                    cmd.Parameters.AddWithValue("@id", entidad.Id);
                    cmd.Parameters.AddWithValue("@codigo", entidad.Codigo?.ToUpper() ?? Convert.DBNull);
                    cmd.Parameters.AddWithValue("@descripcion", entidad.Descripcion.ToUpper());
                    cmd.Parameters.AddWithValue("@tablero", entidad.Tablero);

                    respuesta = cmd.ExecuteNonQuery() > 0;
                }
                return(respuesta);
            }
            catch (Exception)
            {
                throw new Exception("Ocurrió un problema al actualizar una estructura.");
            }
        }
Esempio n. 12
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            try
            {
                if (Session["IDRED"] == null)
                {
                    try
                    {
                        Response.Redirect("~/SesionCaducadaModal.aspx", true);
                    }
                    catch (System.Threading.ThreadAbortException) { return; }
                }


                if (SUPER.Capa_Negocio.Utilidades.EsAdminProduccion())
                {
                    txtDesNodo.Visible   = true;
                    this.lblNodo.Visible = true;
                    gomaNodo.Visible     = true;
                    sNodo = Estructura.getDefCorta(Estructura.sTipoElem.NODO);
                    this.lblNodo.InnerText = Estructura.getDefCorta(Estructura.sTipoElem.NODO);
                }

                string sCR = Request.QueryString["nCR"].ToString();
                listaGF(sCR);
            }
            catch (Exception ex)
            {
                strErrores = Errores.mostrarError("Error al obtener los grupos funcionales", ex);
            }
        }
Esempio n. 13
0
        //Método para verificar existencia de credencial

        public int ChecarUsuario(string usr, string pwd)
        {
            Credencial objCredential = new Credencial(usr, pwd); //Create new Credential object with override method and encapsulate password
            Estructura objElements   = new Estructura();         //Create new Estructura object

            //Query to select user level, username and password from database
            objElements.Sentencia = "proc_getCountAdmin";

            //Create new SqlParameters
            objElements.Parametros = new SqlParameter[] {
                new SqlParameter("usr", SqlDbType.VarChar, 50),
                new SqlParameter("pwd", SqlDbType.VarChar, 50)
            };

            //Don't really understand this line
            objElements.Valores = new List <object>()
            {
                objCredential.usuario, objCredential.Password
            };

            Operaciones objOperaciones = new Operaciones();

            objOperaciones.Elemento = objElements;
            return(objOperaciones.ObtenerScalar());
        }
Esempio n. 14
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //this.Head.PreCss = Session["strServer"].ToString() + "Capa_Presentacion/IAP30/css/IAP30.css";
        IB.SUPER.APP.BLL.Parametro oPar = new IB.SUPER.APP.BLL.Parametro();
        try
        {
            //Variables de sesión
            string script1 = "IB.vars.superEditor = '" + Utilidades.EsAdminProduccion() + "';";
            string sNodo   = Estructura.getDefCorta(Estructura.sTipoElem.NODO);
            script1 += "IB.vars.denNodoCorta='" + sNodo + "';";

            IB.SUPER.APP.Models.Parametro mResponsableContrato = oPar.GetDatos(5);
            script1 += "IB.vars.codResponsable='" + mResponsableContrato.valor.ToString() + "';";
            script1 += "IB.vars.denResponsable='" + mResponsableContrato.denominacion + "';";


            Page.ClientScript.RegisterClientScriptBlock(Page.GetType(), "script1", script1, true);
        }
        catch (Exception ex)
        {
            LogError.LogearError("Parámetros incorrectos en la carga de la pantalla", ex);
            string script2 = "IB.vars['error'] = 'Parámetros incorrectos en la carga de la pantalla';";
            Page.ClientScript.RegisterClientScriptBlock(Page.GetType(), "script2", script2, true);
        }
        finally
        {
            oPar.Dispose();
        }
    }
Esempio n. 15
0
        public ActionResult Nuevo(Estructura model)
        {
            try
            {
                _estructuraLogica = new EstructuraLogica();

                Validar(model);
                if (ModelState.IsValid)
                {
                    if (model.Tablero && model.PadreId.HasValue && _estructuraLogica.TieneTablero(model.PadreId.Value))
                    {
                        ModelState.AddModelError("Tablero", "No puede agregar un tablero dentro de otro.");
                    }
                }
                if (ModelState.IsValid)
                {
                    _estructuraLogica.Guardar(model);
                    return(Content(model.Id.ToString()));
                }
                else
                {
                    Response.StatusCode = (int)HttpStatusCode.BadRequest;
                    return(PartialView("_Error"));
                }
            }
            catch (Exception ex)
            {
                Response.StatusCode = (int)HttpStatusCode.BadRequest;
                ViewBag.Message     = ex.Message;
                return(PartialView("_Error"));
            }
        }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsCallback)
        {
            try
            {
                //Cargo la denominacion del label Nodo
                string sAux = Estructura.getDefCorta(Estructura.sTipoElem.NODO);
                if (sAux.Trim() != "")
                {
                    this.lblNodo.InnerText = sAux;
                    this.lblNodo.Attributes.Add("title", Estructura.getDefLarga(Estructura.sTipoElem.NODO));
                    this.gomaNodo.Attributes.Add("title", "Borra el " + Estructura.getDefLarga(Estructura.sTipoElem.NODO));
                    this.lblNodo2.InnerText = sAux;
                    this.lblNodo2.Attributes.Add("title", Estructura.getDefLarga(Estructura.sTipoElem.NODO));
                }

                rdbTipoBusqueda.Items[1].Selected = true;
            }
            catch (Exception ex)
            {
                sErrores += Errores.mostrarError("Error al obtener los datos", ex);
            }


            //1º Se indican (por este orden) la función a la que se va a devolver el resultado
            //   y la función que va a acceder al servidor
            string cbRespuesta = Page.ClientScript.GetCallbackEventReference(this, "arg", "RespuestaCallBack", "context", false);
            string cbLlamada   = "function RealizarCallBack(arg, context)" + "{" + cbRespuesta + ";" + "}";

            //2º Se "registra" la función que va a acceder al servidor.
            Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "RealizarCallBack", cbLlamada, true);
        }
    }
Esempio n. 17
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsCallback)
        {
            Master.nBotonera           = 38;
            Master.Botonera.ItemClick += new ToolBarEventHandler(this.Botonera_Click);

            Master.TituloPagina      = "Borrado de Proyecto Económico";
            Master.bFuncionesLocales = true;
            if (!Page.IsPostBack)
            {
                try
                {
                    this.lblNodo2.InnerText = Estructura.getDefLarga(Estructura.sTipoElem.NODO);
                }
                catch (Exception ex)
                {
                    Master.sErrores = Errores.mostrarError("Error al obtener los datos", ex);
                }
            }
            //1º Se indican (por este orden) la función a la que se va a devolver el resultado
            //   y la función que va a acceder al servidor
            string cbRespuesta = Page.ClientScript.GetCallbackEventReference(this, "arg", "RespuestaCallBack", "context", false);
            string cbLlamada   = "function RealizarCallBack(arg, context)" + "{" + cbRespuesta + ";" + "}";

            //2º Se "registra" la función que va a acceder al servidor.
            Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "RealizarCallBack", cbLlamada, true);
        }
    }
Esempio n. 18
0
        //Llamar invitados
        public void GuardarInvitados()
        {
            Estructura  objElementos   = new Estructura();
            Operaciones objOperaciones = new Operaciones();

            if (!ReciboClase.nuevo)
            {
                objElementos.Sentencia  = "proc_deleteInvitados";
                objElementos.Parametros = new SqlParameter[] {
                    new SqlParameter("folio", SqlDbType.Int)
                };
                objElementos.Valores = new List <object>()
                {
                    EventoClase.Evento.FolioEvento
                };
                objOperaciones.Elemento = objElementos;
                objOperaciones.AgregarInfo();
            }
            for (int i = 0; i < lstInvitados.Count; i++)
            {
                objElementos.Sentencia  = "proc_setInvitados";
                objElementos.Parametros = new SqlParameter[] {
                    new SqlParameter("folio", SqlDbType.Int),
                    new SqlParameter("nombre", SqlDbType.NVarChar, 50),
                    new SqlParameter("email", SqlDbType.NVarChar, 50)
                };
                objElementos.Valores = new List <object>()
                {
                    EventoClase.Evento.FolioEvento, lstInvitados[i].Nombre, lstInvitados[i].Email
                };

                objOperaciones.Elemento = objElementos;
                objOperaciones.AgregarInfo();
            }
        }
Esempio n. 19
0
        /*Obtener información de un evento de la base de datos*/
        public void ObtenerEvento(int folio)
        {
            string     tabla = "Eventos";
            Estructura est   = new Estructura();

            est.Sentencia  = "proc_getEvento";
            est.Parametros = new SqlParameter[] {
                new SqlParameter("@folio", SqlDbType.Int)
            };
            est.Valores = new List <object>()
            {
                folio
            };
            Operaciones op = new Operaciones();

            op.Elemento = est;
            DataTable data = op.ObtenerDataTable(tabla);

            Evento.folioEvento  = folio;
            Evento.nombreEvento = data.Rows[0]["nombre"].ToString();
            Evento.fechaEvento  = Convert.ToDateTime(data.Rows[0]["fechaEvento"]);
            Evento.horaEvento   = data.Rows[0]["hora"].ToString();
            Evento.calle        = data.Rows[0]["calle"].ToString();
            Evento.colonia      = data.Rows[0]["colonia"].ToString();
            Evento.numero       = data.Rows[0]["numero"].ToString();
            Evento.cp           = data.Rows[0]["cp"].ToString();
            Evento.comentario   = data.Rows[0]["comentario"].ToString();
        }
Esempio n. 20
0
        public void ObtenerInvitados(int folio)
        {
            string     tabla       = "Invitados";
            Estructura objElements = new Estructura();

            objElements.Sentencia  = "proc_getInvitados";
            objElements.Parametros = new SqlParameter[] {
                new SqlParameter("@folio", SqlDbType.Int)
            };
            objElements.Valores = new List <object>()
            {
                folio
            };
            Operaciones objOperaciones = new Operaciones();

            objOperaciones.Elemento = objElements;
            DataTable data = objOperaciones.ObtenerDataTable(tabla);

            lstInvitados.Clear();
            if (data.Rows.Count > 0)
            {
                for (int i = 0; i < data.Rows.Count; i++)
                {
                    InvitadoClase invitado = new InvitadoClase();
                    invitado.nombre = data.Rows[i]["nombre"].ToString();
                    invitado.email  = data.Rows[i]["email"].ToString();
                    lstInvitados.Add(invitado);
                }
            }
        }
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            if (!Page.IsCallback)
            {
                //Master.nBotonera = 58;
                Master.bFuncionesLocales = true;
                Master.bEstilosLocales   = true;
                Master.TituloPagina      = "Catálogo de diálogos bajo mi gestión";
                Master.FicherosCSS.Add("PopCalendar/css/Classic.css");
                Master.FuncionesJavaScript.Add("Javascript/funcionesPestVertical.js");
                Master.FuncionesJavaScript.Add("Javascript/dhtmltooltip.js");
                Master.FuncionesJavaScript.Add("PopCalendar/PopCalendar.js");

                lblNodo.InnerText = Estructura.getDefCorta(Estructura.sTipoElem.NODO);

                CargarGrupos();
                CargarAlertas();
                CargarEstados();
                CargarGestores();

                //1º Se indican (por este orden) la función a la que se va a devolver el resultado
                //   y la función que va a acceder al servidor
                string cbRespuesta = Page.ClientScript.GetCallbackEventReference(this, "arg", "RespuestaCallBack", "context", false);
                string cbLlamada   = "function RealizarCallBack(arg, context)" + "{" + cbRespuesta + ";" + "}";
                //2º Se "registra" la función que va a acceder al servidor.
                Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "RealizarCallBack", cbLlamada, true);
            }
        }
        catch (Exception ex)
        {
            Master.sErrores = Errores.mostrarError("Error al cargar los datos", ex);
        }
    }
        private void cargarNodos()
        {
            try
            {
                //Cargo la denominacion del label Nodo
                this.lblNodo.InnerText = Estructura.getDefCorta(Estructura.sTipoElem.NODO);
                this.lblNodo.Attributes.Add("title", Estructura.getDefLarga(Estructura.sTipoElem.NODO));

                //Cargar el combo de todos los nodos (estoy en administración)
                ListItem      oLI = null;
                SqlDataReader dr;
                if (Session["ADMINISTRADOR_PC_ACTUAL"].ToString() == "")
                {
                    dr = NODO.ObtenerNodosCalendario((int)Session["UsuarioActual"]);
                }
                else
                {
                    dr = NODO.Catalogo(false);
                }
                while (dr.Read())
                {
                    oLI = new ListItem(dr["t303_denominacion"].ToString(), dr["t303_idnodo"].ToString());
                    cboCR.Items.Add(oLI);
                }
                dr.Close();
                dr.Dispose();
            }
            catch (Exception ex)
            {
                sErrores += Errores.mostrarError("Error al cargar los nodos", ex);
            }
        }
Esempio n. 23
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            if (!Page.IsCallback)
            {
                Master.nBotonera         = 39;
                Master.bFuncionesLocales = true;
                Master.FuncionesJavaScript.Add("Capa_Presentacion/ECO/TraspasoIAP/Functions/PSN.js");
                Master.TituloPagina = "Traspaso de IAP";

                try
                {
                    //if (!(bool)Session["FORANEOS"])
                    //{
                    //    this.imgForaneo.Visible = false;
                    //    this.lblForaneo.Visible = false;
                    //}
                    sNodo = Estructura.getDefCorta(Estructura.sTipoElem.NODO);

                    string[] aDatosPref = Regex.Split(getPreferencia(""), "@#@");
                    if (bHayPreferencia && aDatosPref[0] == "OK")
                    {
                        chkSobreescribir.Checked = (aDatosPref[1] == "1") ? true : false;
                        chkRPCCR.Checked         = (aDatosPref[2] == "1") ? true : false;
                        chkProfCon.Checked       = (aDatosPref[3] == "1") ? true : false;
                    }
                    else if (aDatosPref[0] == "Error")
                    {
                        Master.sErrores += Errores.mostrarError(aDatosPref[1]);
                    }

                    int?nPSN = null;
                    if (Request.QueryString["nPSN"] != null)
                    {
                        nPSN = (int?)int.Parse(Utilidades.decodpar(Request.QueryString["nPSN"].ToString()));
                        this.chkRPCCR.Checked  = false;
                        this.chkRPCCR.Disabled = true;
                    }

                    ObtenerPSNs(nPSN);
                }
                catch (Exception ex)
                {
                    Master.sErrores += Errores.mostrarError("Error al cargar los datos", ex);
                }

                //1º Se indican (por este orden) la función a la que se va a devolver el resultado
                //   y la función que va a acceder al servidor
                string cbRespuesta = Page.ClientScript.GetCallbackEventReference(this, "arg", "RespuestaCallBack", "context", false);
                string cbLlamada   = "function RealizarCallBack(arg, context)" + "{" + cbRespuesta + ";" + "}";
                //2º Se "registra" la función que va a acceder al servidor.
                Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "RealizarCallBack", cbLlamada, true);
            }
        }
        catch (Exception ex)
        {
            Master.sErrores = Errores.mostrarError("Error al cargar los datos", ex);
        }
    }
Esempio n. 24
0
        public void definirEstructura(){

            if (EsActividadComisionistaoAgenciaDeViaje){
              
                int i = 0;

                for (int j  =  0; j  < 4; j++) {

                    if (CantidadPersonal >= Actividad.CantidadPersonalMax[i]){
                        
                        i++;
                    }
                }
                
                Estructura = definirTamaño(i);
            }
            else {
                int i = 0;
                for (int j = 0; j  < 4; j++) {

                    if (CantidadPersonal >= Actividad.CantidadPersonalMax[i] ||
                        PromedioVentasAnuales >= Actividad.PromedioVentasMax[i]){
                       
                        i++;
                    }
                }
                
                Estructura = definirTamaño(i);
            }
		}
Esempio n. 25
0
        /*Obtener menú del cliente de la base de datos*/
        public void ObtenerMenuCliente(int folio)
        {
            string     tabla       = "Menu";
            Estructura objElements = new Estructura();

            objElements.Sentencia  = "proc_getMenu";
            objElements.Parametros = new SqlParameter[] {
                new SqlParameter("id", SqlDbType.Int)
            };
            objElements.Valores = new List <object>()
            {
                folio
            };
            Operaciones objOperaciones = new Operaciones();

            objOperaciones.Elemento = objElements;
            DataTable data = objOperaciones.ObtenerDataTable(tabla);

            lstMenuCliente.Clear();
            if (data.Rows.Count > 0)
            {
                for (int i = 0; i < data.Rows.Count; i++)
                {
                    MenuClase entrada = new MenuClase();
                    entrada.idEntrada = Convert.ToInt32(data.Rows[i]["idEntrada"]);
                    entrada.porciones = Convert.ToInt32(data.Rows[i]["porciones"]);
                    lstMenuCliente.Add(entrada);
                }
            }
        }
Esempio n. 26
0
        public ActionResult ModelarTablero(int id, string callBack = "SetModelarTablero")
        {
            try
            {
                _estructuraAreaLogica      = new EstructuraAreaLogica();
                _estructuraInstanciaLogica = new EstructuraInstanciaLogica();

                Estructura model = new Estructura {
                    Id = id
                };
                model.Areas      = _estructuraAreaLogica.Listar(id) ?? new List <EstructuraArea>();
                model.Instancias = _estructuraInstanciaLogica.Listar(id) ?? new List <EstructuraInstancia>();

                _instanciaLogica   = new InstanciaLogica();
                ViewBag.Instancias = _instanciaLogica.Listar() ?? new List <Instancia>();

                _areaLogica   = new AreaLogica();
                ViewBag.Areas = _areaLogica.Listar() ?? new List <Area>();

                ViewBag.CallBack = callBack;

                return(PartialView("_ModelarTablero", model));
            }
            catch (Exception ex)
            {
                Response.StatusCode = (int)HttpStatusCode.BadRequest;
                ViewBag.Message     = ex.Message;
                return(PartialView("_Error"));
            }
        }
Esempio n. 27
0
    /// <summary>
    /// Crea un saco con objetos proximo
    /// Este saco no sirve para almacenar de manera persistente los objetos
    /// Cuando se hace de noche este saco desaparece (Por lo que necesita ser almacenado
    /// en un baul antes de que eso ocurra).
    /// </summary>
    public void  CrearSaco(IntVector2 pos, int maxSteps, ResourceInfo[] inventario)
    {
        int count = 0;

        for (int i = 0; i < inventario.Length; i++)
        {
            count += inventario[i].quantity;
        }

        if (count == 0)
        {
            return;
        }

        pos = path.PathFind(pos, maxSteps, new PathSetting(PATHTYPE.huecoLibre)).GetFinalPosition();

        Estructura estructura = CreateBuild(pos, sackPrefab);

        if (estructura != null)
        {
            Recurso _recurso = estructura.GetComponent <Recurso>();
            _recurso.CreateResource(inventario);
            _recurso.transform.localScale = Vector3.Lerp(new Vector3(0.25f, 0.25f, 1), Vector3.one, ((float)_recurso.actualQuantity) / 250);
        }
    }
Esempio n. 28
0
        public ActionResult ModelarTablero(Estructura model)
        {
            try
            {
                Validar(model.Instancias, model.Areas);
                if (ModelState.IsValid)
                {
                    if (model.Areas != null)
                    {
                        model.Areas.ForEach(x => x.EstructuraId = model.Id);
                    }
                    if (model.Instancias != null)
                    {
                        model.Instancias.ForEach(x => x.EstructuraId = model.Id);
                    }

                    _estructuraLogica = new EstructuraLogica();
                    _estructuraLogica.Guardar(model.Id, model.Instancias, model.Areas);

                    return(Content("Se guardaron los cambios."));
                }
                else
                {
                    Response.StatusCode = (int)HttpStatusCode.BadRequest;
                    return(PartialView("_Error"));
                }
            }
            catch (Exception ex)
            {
                Response.StatusCode = (int)HttpStatusCode.BadRequest;
                ViewBag.Message     = ex.Message;
                return(PartialView("_Error"));
            }
        }
Esempio n. 29
0
    private void cargarNodos()
    {
        try
        {
            //Obtener los datos necesarios
            //Cargo la denominacion del label Nodo
            this.lblNodo.InnerText = Estructura.getDefCorta(Estructura.sTipoElem.NODO);
            this.lblNodo.Attributes.Add("title", Estructura.getDefLarga(Estructura.sTipoElem.NODO));

            //Cargar el combo de nodos accesibles
            ListItem      oLI = null;
            SqlDataReader dr  = NODO.ObtenerNodosUsuarioSegunVisionProyectosECO(null, (int)Session["UsuarioActual"], false);
            while (dr.Read())
            {
                oLI = new ListItem(dr["DENOMINACION"].ToString(), dr["IDENTIFICADOR"].ToString());
                cboCR.Items.Add(oLI);
            }
            dr.Close();
            dr.Dispose();
        }
        catch (Exception ex)
        {
            Master.sErrores += Errores.mostrarError("Error al cargar los nodos", ex);
        }
    }
Esempio n. 30
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsCallback)
        {
            Master.nBotonera           = 9;
            Master.Botonera.ItemClick += new ToolBarEventHandler(this.Botonera_Click);

            Master.TituloPagina      = "Apertura / Cierre de meses de un Proyecto Económico";
            Master.bFuncionesLocales = true;
            if (!Page.IsPostBack)
            {
                try
                {
                    strTablaHtml = "<table id='tblDatos'></table>";//<tbody id='tbodyDatos'></tbody>
                    //strTablaHtml = "<table id='tblDatos' class='texto MANO' style='WIDTH: 260px; BORDER-COLLAPSE: collapse; ' cellSpacing='0' border='0' mantenimiento='1'><colgroup><col style='width:10px;' /><col style='width:190px;' /><col style='width:60px;' /></colgroup><tbody><tr id='1242' bd='' estado='A'><td><img src='../../../../images/imgFN.gif'></td><td>Noviembre 2008</td><td class='MA'><img src='../../../../images/imgFN.gif' ondblclick='setEstado(this)'></td></tr><tr id='18547' bd='' estado='A'><td><img src='../../../../images/imgFN.gif'></td><td>Octubre 2009</td><td class='MA'><img src='../../../../images/imgFN.gif' ondblclick='setEstado(this)'></td></tr></tbody></table>";
                    this.lblNodo.InnerText = Estructura.getDefCorta(Estructura.sTipoElem.NODO);
                    this.lblNodo.Attributes.Add("title", Estructura.getDefLarga(Estructura.sTipoElem.NODO));
                }
                catch (Exception ex)
                {
                    Master.sErrores = Errores.mostrarError("Error al obtener los datos", ex);
                }
            }
            //1º Se indican (por este orden) la función a la que se va a devolver el resultado
            //   y la función que va a acceder al servidor
            string cbRespuesta = Page.ClientScript.GetCallbackEventReference(this, "arg", "RespuestaCallBack", "context", false);
            string cbLlamada   = "function RealizarCallBack(arg, context)" + "{" + cbRespuesta + ";" + "}";

            //2º Se "registra" la función que va a acceder al servidor.
            Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "RealizarCallBack", cbLlamada, true);
        }
    }