예제 #1
0
        protected void GrdDatos_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            try
            {
                Cnx.BaseDatos(Session["D[BX"].ToString(), Session["$VR"].ToString(), Session["V$U@"].ToString(), Session["P@$"].ToString());
                using (SqlConnection sqlCon = new SqlConnection(Cnx.GetConex()))
                {
                    sqlCon.Open();
                    string     query  = "EXEC SP_ConfiguracionV2_ 11,'','','','','',@id,0,0, @ICC,'01-01-1','02-01-1','03-01-1'";
                    SqlCommand sqlCmd = new SqlCommand(query, sqlCon);
                    sqlCmd.Parameters.AddWithValue("@id", GrdDatos.DataKeys[e.RowIndex].Value.ToString());
                    sqlCmd.Parameters.AddWithValue("@ICC", Session["!dC!@"]);
                    sqlCmd.ExecuteNonQuery();
                    sqlCon.Close();
                    BindData(TxtBusqueda.Text);
                }
            }
            catch (Exception ex)
            {
                ScriptManager.RegisterClientScriptBlock(this.UpPanel, UpPanel.GetType(), "IdntificadorBloqueScript", "alert('Error en el proceso de eliminación')", true);

                ClsConexion ClsUE = new ClsConexion();
                ClsUE.UpdateError(Session["C77U"].ToString(), "FrmSeguPefiles", "DELETE", "0", ex.Message, Session["77Version"].ToString(), Session["77Act"].ToString());
            }
        }
예제 #2
0
        protected void GrdDatos_RowUpdating(object sender, GridViewUpdateEventArgs e)
        {
            try
            {
                Cnx.BaseDatos(Session["D[BX"].ToString(), Session["$VR"].ToString(), Session["V$U@"].ToString(), Session["P@$"].ToString());
                using (SqlConnection sqlCon = new SqlConnection(Cnx.GetConex()))
                {
                    sqlCon.Open();
                    string     query  = "UPDATE TblUsrGrupo SET NombreGrupo = @NombreGrupo WHERE CodIdGrupo = @ID";
                    SqlCommand sqlCmd = new SqlCommand(query, sqlCon);
                    sqlCmd.Parameters.AddWithValue("@NombreGrupo", (GrdDatos.Rows[e.RowIndex].FindControl("TxtNombreGrupo") as TextBox).Text.Trim());
                    sqlCmd.Parameters.AddWithValue("@ID", Convert.ToInt32(GrdDatos.DataKeys[e.RowIndex].Value.ToString()));
                    sqlCmd.ExecuteNonQuery();
                    GrdDatos.EditIndex = -1;
                    BindData(TxtBusqueda.Text);
                }
            }
            catch (Exception ex)
            {
                ScriptManager.RegisterClientScriptBlock(this.UpPanel, UpPanel.GetType(), "IdntificadorBloqueScript", "alert('Error en el proceso de edición')", true);

                ClsConexion ClsUE = new ClsConexion();
                ClsUE.UpdateError(Session["C77U"].ToString(), "FrmSeguPefiles", "Update", "0", ex.Message, Session["77Version"].ToString(), Session["77Act"].ToString());
            }
        }
예제 #3
0
 protected void GrdDatos_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     try
     {
         if (e.CommandName.Equals("AddNew"))
         {
             Cnx.BaseDatos(Session["D[BX"].ToString(), Session["$VR"].ToString(), Session["V$U@"].ToString(), Session["P@$"].ToString());
             using (SqlConnection sqlCon = new SqlConnection(Cnx.GetConex()))
             {
                 string VblDescipc = (GrdDatos.FooterRow.FindControl("TxtNombreGrupoPP") as TextBox).Text.Trim();
                 if (VblDescipc == String.Empty)
                 {
                     ScriptManager.RegisterClientScriptBlock(this.UpPanel, UpPanel.GetType(), "IdntificadorBloqueScript", "alert('Debe ingresar un nombre')", true);
                     return;
                 }
                 sqlCon.Open();
                 string     query  = "INSERT INTO TblUsrGrupo(NombreGrupo) VALUES(@NombreGrupo)";
                 SqlCommand sqlCmd = new SqlCommand(query, sqlCon);
                 sqlCmd.Parameters.AddWithValue("@NombreGrupo", VblDescipc);
                 sqlCmd.ExecuteNonQuery();
                 BindData(TxtBusqueda.Text);
             }
         }
         if (e.CommandName == "Select")
         {
             int index = int.Parse(e.CommandArgument.ToString());
         }
     }
     catch (Exception ex)
     {
         ScriptManager.RegisterClientScriptBlock(this.UpPanel, UpPanel.GetType(), "IdntificadorBloqueScript", "alert('Error en el ingreso')", true);
         ClsConexion ClsUE = new ClsConexion();
         ClsUE.UpdateError(Session["C77U"].ToString(), "FrmSeguPefiles", "INSERT", "0", ex.Message, Session["77Version"].ToString(), Session["77Act"].ToString());
     }
 }
예제 #4
0
        protected void BtnEliminar_Click(object sender, EventArgs e)
        {
            Idioma = (DataTable)ViewState["TablaIdioma"];
            try
            {
                string VBQuery, VbCod;
                VbCod = TxtCod.Text;

                Cnx.SelecBD();
                using (SqlConnection sqlCon = new SqlConnection(Cnx.GetConex()))
                {
                    sqlCon.Open();
                    VBQuery = "EXEC SP_Pantalla_Parametros 11,'" + VbCod + "','','','','VALIDA',0,0,0,0,'01-01-1','02-01-1','03-01-1'";
                    SqlCommand    Comando  = new SqlCommand(VBQuery, sqlCon);
                    SqlDataReader registro = Comando.ExecuteReader();
                    if (registro.Read())
                    {
                        string    Mensj  = registro["Mensj"].ToString().Trim();
                        DataRow[] Result = Idioma.Select("Objeto= '" + Mensj.ToString().Trim() + "'");
                        foreach (DataRow row in Result)
                        {
                            Mensj = row["Texto"].ToString().Trim();
                        }

                        ScriptManager.RegisterClientScriptBlock(this.UpPanel, UpPanel.GetType(), "IdntificadorBloqueScript", "alert('" + Mensj + "')", true);
                        return;
                    }
                }
                using (SqlConnection sqlCon = new SqlConnection(Cnx.GetConex()))
                {
                    sqlCon.Open();
                    string     query  = "EXEC SP_Pantalla_Parametros 11, " + VbCod + ",'','','','ELIMINA',0,0,0,0,'01-01-1','02-01-1','03-01-1'";
                    SqlCommand sqlCmd = new SqlCommand(query, sqlCon);
                    sqlCmd.ExecuteNonQuery();
                    LimpiarCampos();
                    ActivarBotones(true, false, false, false, false);
                    BindDataDdlCntr("UPD");
                }
            }
            catch (Exception ex)
            {
                DataRow[] Result = Idioma.Select("Objeto= 'MensErrEli'");
                foreach (DataRow row in Result)
                {
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('" + row["Texto"].ToString() + "');", true);
                }                                                                                                                                       //Error en el proceso de eliminación')", true);
                Cnx.UpdateErrorV2(Session["C77U"].ToString(), "FrmContador", "DELETE", ex.StackTrace.Substring(ex.StackTrace.Length - 300, 300), ex.Message, Session["77Version"].ToString(), Session["77Act"].ToString());
            }
        }
예제 #5
0
 protected void GrdDatos_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     try
     {
         if (e.CommandName == "Select")
         {
             int index = int.Parse(e.CommandArgument.ToString());
             Session["IdUsrGruRP"] = int.Parse(GrdDatos.DataKeys[index].Value.ToString());
         }
     }
     catch (Exception ex)
     {
         ScriptManager.RegisterClientScriptBlock(this.UpPanel, UpPanel.GetType(), "IdntificadorBloqueScript", "alert('" + ex.Message + "')", true);
     }
 }
예제 #6
0
        private void Awake()
        {
            _m_coins  = _start_coins;
            _m_health = _start_healph;

            ManagerPool.Instance.AddPool(PoolType.Box);
            ManagerPool.Instance.AddPool(PoolType.Trap);
            ManagerPool.Instance.AddPool(PoolType.Ui);
            upPanel = GameObject.Find("UpPanel").GetComponent <UpPanel>();
            if (upPanel)
            {
                upPanel.LifePanel.Create(_m_health);
            }
            upPanel.CoinsPanel.Add((_m_coins).ToString());

            map          = GameObject.Find("Map").GetComponent <MapGenerator>();
            isGameActive = true;
        }
예제 #7
0
        private async void SetCompaction()
        {
            if (isCompacted)
            {
                StateIcon.Glyph = "\uE2B3";
                ViewModePreferences compactOptions = ViewModePreferences.CreateDefault(ApplicationViewMode.CompactOverlay);
                compactOptions.CustomSize = new Size(200, this.ActualHeight - 200);
                await ApplicationView.GetForCurrentView().TryEnterViewModeAsync(ApplicationViewMode.CompactOverlay, compactOptions);

                await UpPanel.Fade(0).StartAsync();

                UpPanel.Visibility = Visibility.Collapsed;
            }
            else
            {
                UpPanel.Visibility = Visibility.Visible;
                await UpPanel.Fade(1).StartAsync();

                StateIcon.Glyph = "\uE2B4";
                await ApplicationView.GetForCurrentView().TryEnterViewModeAsync(ApplicationViewMode.Default);
            }
        }
예제 #8
0
        protected void BtnModificar_Click(object sender, EventArgs e)
        {
            if ((int)Session["IdForm"] > 0)
            {
                if (TxtDescripcion.Text != string.Empty)
                {
                    if (BtnModificar.Text == "Modificar")
                    {
                        BtnModificar.Text = "Aceptar";
                        ActivarCampos(true);
                        BtnModificar.OnClientClick = "return confirm('¿Desea realizar la actualización?');";
                    }
                    else
                    {
                        try
                        {
                            Cnx.BaseDatos(Session["D[BX"].ToString(), Session["$VR"].ToString(), Session["V$U@"].ToString(), Session["P@$"].ToString());
                            using (SqlConnection sqlCon = new SqlConnection(Cnx.GetConex()))
                            {
                                sqlCon.Open();
                                int Ppal = 0, ing = 0, Mod = 0, Cons = 0, Impr = 0, Elim = 0;

                                if (CkbPpl.Checked == true)
                                {
                                    Ppal = 1;
                                }
                                if (CkbIng.Checked == true)
                                {
                                    ing = 1;
                                }
                                if (CkbMod.Checked == true)
                                {
                                    Mod = 1;
                                }
                                if (CkbCons.Checked == true)
                                {
                                    Cons = 1;
                                }
                                if (CkbImpr.Checked == true)
                                {
                                    Impr = 1;
                                }
                                if (CkbElim.Checked == true)
                                {
                                    Elim = 1;
                                }
                                string Txtsql = "UPDATE TblUsrFormulario SET IngresarF=@ing, ModificarF=@Mod, ConsultarF=@Cons, ImprimirF=@Impr, EliminarF=@Elim, CasoEspeciaLF1=@CE1," +
                                                "CasoEspeciaLF2=@CE2,CasoEspeciaLF3 =@CE3, CasoEspeciaLF4=@CE4, CasoEspeciaLF5=@CE5, CasoEspeciaLF6=@CE6, Principal=@Ppal  WHERE CodIdFormulario=@ID";
                                SqlCommand sqlCmd = new SqlCommand(Txtsql, sqlCon);
                                sqlCmd.Parameters.AddWithValue("@Ppal", Ppal);
                                sqlCmd.Parameters.AddWithValue("@ing", ing);
                                sqlCmd.Parameters.AddWithValue("@Mod", Mod);
                                sqlCmd.Parameters.AddWithValue("@Cons", Cons);
                                sqlCmd.Parameters.AddWithValue("@Impr", Impr);
                                sqlCmd.Parameters.AddWithValue("@Elim", Elim);
                                sqlCmd.Parameters.AddWithValue("@CE1", TxtCE1.Text.ToString());
                                sqlCmd.Parameters.AddWithValue("@CE2", TxtCE2.Text.ToString());
                                sqlCmd.Parameters.AddWithValue("@CE3", TxtCE3.Text.ToString());
                                sqlCmd.Parameters.AddWithValue("@CE4", TxtCE4.Text.ToString());
                                sqlCmd.Parameters.AddWithValue("@CE5", TxtCE5.Text.ToString());
                                sqlCmd.Parameters.AddWithValue("@CE6", TxtCE6.Text.ToString());
                                sqlCmd.Parameters.AddWithValue("@ID", Session["IdForm"].ToString());

                                sqlCmd.ExecuteNonQuery();
                                sqlCon.Close();
                                BtnModificar.Text = "Modificar";
                                ActivarCampos(false);
                                LimparCampos();
                                BtnModificar.OnClientClick = "";
                                BindData(TxtBusqueda.Text);
                            }
                        }
                        catch (Exception ex)
                        {
                            ScriptManager.RegisterClientScriptBlock(this.UpPanel, UpPanel.GetType(), "IdntificadorBloqueScript", "alert('Error en el proceso de edición')", true);

                            ClsConexion ClsUE = new ClsConexion();
                            ClsUE.UpdateError(Session["C77U"].ToString(), "FrmConfigPantalla", "Update", "0", ex.Message, Session["77Version"].ToString(), Session["77Act"].ToString());
                        }
                    }
                }
            }
        }
예제 #9
0
        protected void GrdSinAsig_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            try
            {
                if ((int)Session["IdGrupoRP"] != 0)
                {
                    if (e.CommandName == "Select")
                    {
                        ActivarControles();
                        int index = int.Parse(e.CommandArgument.ToString());
                        ViewState["IdFormRP"] = int.Parse(GrdSinAsig.DataKeys[index].Value.ToString());

                        DSTDdl = (DataSet)ViewState["DSTDdl"];
                        DataTable DT = new DataTable();
                        DT = DSTDdl.Tables[5].Clone();
                        DataRow[] Result = DSTDdl.Tables[5].Select("CodIdFormulario = " + ViewState["IdFormRP"].ToString());
                        foreach (DataRow tbl in Result)
                        {
                            DT.ImportRow(tbl);
                            LblNombrePantalla.Text = tbl["NomFormWeb"].ToString();
                            string VblNomPant = tbl["NomFormWeb"].ToString();
                            CkbIng.Checked           = Convert.ToBoolean(tbl["IngresarF"]);
                            CkbMod.Checked           = Convert.ToBoolean(tbl["ModificarF"]);
                            CkbCons.Checked          = Convert.ToBoolean(tbl["ConsultarF"]);
                            CkbImpr.Checked          = Convert.ToBoolean(tbl["ImprimirF"]);
                            CkbElim.Checked          = Convert.ToBoolean(tbl["EliminarF"]);
                            CkbIng.Visible           = true;
                            CkbMod.Visible           = true;
                            CkbCons.Visible          = true;
                            CkbImpr.Visible          = true;
                            CkbElim.Visible          = true;
                            CkbCE1.Visible           = false;
                            CkbCE2.Visible           = false;
                            CkbCE3.Visible           = false;
                            CkbCE4.Visible           = false;
                            CkbCE5.Visible           = false;
                            CkbCE6.Visible           = false;
                            IbtAsignarPerfil.Visible = false;
                            if (VblNomPant != string.Empty)
                            {
                                IbtAsignarPerfil.Visible = true;
                            }
                            if (Convert.ToBoolean(tbl["IngresarF"]).Equals(false))
                            {
                                CkbIng.Visible = false;
                            }
                            if (Convert.ToBoolean(tbl["ModificarF"]).Equals(false))
                            {
                                CkbMod.Visible = false;
                            }
                            if (Convert.ToBoolean(tbl["ConsultarF"]).Equals(false))
                            {
                                CkbCons.Visible = false;
                            }
                            if (Convert.ToBoolean(tbl["ImprimirF"]).Equals(false))
                            {
                                CkbImpr.Visible = false;
                            }
                            if (Convert.ToBoolean(tbl["EliminarF"]).Equals(false))
                            {
                                CkbElim.Visible = false;
                            }
                            if (Convert.ToBoolean(tbl["CEF1"]).Equals(true))
                            {
                                CkbCE1.Visible = true;
                                CkbCE1.Text    = tbl["CasoEspeciaLF1"].ToString();
                            }
                            if (Convert.ToBoolean(tbl["CEF2"]).Equals(true))
                            {
                                CkbCE2.Visible = true;
                                CkbCE2.Text    = tbl["CasoEspeciaLF2"].ToString();
                            }
                            if (Convert.ToBoolean(tbl["CEF3"]).Equals(true))
                            {
                                CkbCE3.Visible = true;
                                CkbCE3.Text    = tbl["CasoEspeciaLF3"].ToString();
                            }
                            if (Convert.ToBoolean(tbl["CEF4"]).Equals(true))
                            {
                                CkbCE4.Visible = true;
                                CkbCE4.Text    = tbl["CasoEspeciaLF4"].ToString();
                            }
                            if (Convert.ToBoolean(tbl["CEF5"]).Equals(true))
                            {
                                CkbCE5.Visible = true;
                                CkbCE5.Text    = tbl["CasoEspeciaLF5"].ToString();
                            }
                            if (Convert.ToBoolean(tbl["CEF6"]).Equals(true))
                            {
                                CkbCE6.Visible = true;
                                CkbCE6.Text    = tbl["CasoEspeciaLF6"].ToString();
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                ScriptManager.RegisterClientScriptBlock(this.UpPanel, UpPanel.GetType(), "IdntificadorBloqueScript", "alert('" + ex.Message + "')", true);
            }
        }
예제 #10
0
        protected void GrdPerfilAsig_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                if ((int)Session["IdGrupoRP"] != 0)
                {
                    DSTDdl = (DataSet)ViewState["DSTDdl"];
                    DataTable DT = new DataTable();
                    DT = DSTDdl.Tables[6].Clone();
                    DataRow[] Result = DSTDdl.Tables[6].Select("CodidUsrPerfil = " + ViewState["CodidUsrPerfil"].ToString().Trim());
                    foreach (DataRow tbl in Result)
                    {
                        LblNombrePantalla.Text = tbl["NomFormWeb"].ToString();
                        string VblNomPant = tbl["NomFormWeb"].ToString();
                        CkbIng.Checked           = Convert.ToBoolean(tbl["IngresarF"]);
                        CkbMod.Checked           = Convert.ToBoolean(tbl["ModificarF"]);
                        CkbCons.Checked          = Convert.ToBoolean(tbl["ConsultarF"]);
                        CkbImpr.Checked          = Convert.ToBoolean(tbl["ImprimirF"]);
                        CkbElim.Checked          = Convert.ToBoolean(tbl["EliminarF"]);
                        CkbCE1.Checked           = Convert.ToBoolean(tbl["CEF1"]);
                        CkbCE2.Checked           = Convert.ToBoolean(tbl["CEF2"]);
                        CkbCE3.Checked           = Convert.ToBoolean(tbl["CEF3"]);
                        CkbCE4.Checked           = Convert.ToBoolean(tbl["CEF4"]);
                        CkbCE5.Checked           = Convert.ToBoolean(tbl["CEF5"]);
                        CkbCE6.Checked           = Convert.ToBoolean(tbl["CEF6"]);
                        CkbIng.Visible           = true;
                        CkbMod.Visible           = true;
                        CkbCons.Visible          = true;
                        CkbImpr.Visible          = true;
                        CkbElim.Visible          = true;
                        CkbCE1.Visible           = false;
                        CkbCE2.Visible           = false;
                        CkbCE3.Visible           = false;
                        CkbCE4.Visible           = false;
                        CkbCE5.Visible           = false;
                        CkbCE6.Visible           = false;
                        IbtAsignarPerfil.Visible = false;

                        if (Convert.ToBoolean(tbl["IngresarF"]).Equals(false))
                        {
                            CkbIng.Visible = false;
                        }
                        if (Convert.ToBoolean(tbl["ModificarF"]).Equals(false))
                        {
                            CkbMod.Visible = false;
                        }
                        if (Convert.ToBoolean(tbl["ConsultarF"]).Equals(false))
                        {
                            CkbCons.Visible = false;
                        }
                        if (Convert.ToBoolean(tbl["ImprimirF"]).Equals(false))
                        {
                            CkbImpr.Visible = false;
                        }
                        if (Convert.ToBoolean(tbl["EliminarF"]).Equals(false))
                        {
                            CkbElim.Visible = false;
                        }
                        if (Convert.ToBoolean(tbl["CEF1"]).Equals(true))
                        {
                            CkbCE1.Visible = true;
                            CkbCE1.Text    = tbl["CasoEspeciaLF1"].ToString();
                        }
                        if (Convert.ToBoolean(tbl["CEF2"]).Equals(true))
                        {
                            CkbCE2.Visible = true;
                            CkbCE2.Text    = tbl["CasoEspeciaLF2"].ToString();
                        }
                        if (Convert.ToBoolean(tbl["CEF3"]).Equals(true))
                        {
                            CkbCE3.Visible = true;
                            CkbCE3.Text    = tbl["CasoEspeciaLF3"].ToString();
                        }
                        if (Convert.ToBoolean(tbl["CEF4"]).Equals(true))
                        {
                            CkbCE4.Visible = true;
                            CkbCE4.Text    = tbl["CasoEspeciaLF4"].ToString();
                        }
                        if (Convert.ToBoolean(tbl["CEF5"]).Equals(true))
                        {
                            CkbCE5.Visible = true;
                            CkbCE5.Text    = tbl["CasoEspeciaLF5"].ToString();
                        }
                        if (Convert.ToBoolean(tbl["CEF6"]).Equals(true))
                        {
                            CkbCE6.Visible = true;
                            CkbCE6.Text    = tbl["CasoEspeciaLF6"].ToString();
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                ScriptManager.RegisterClientScriptBlock(this.UpPanel, UpPanel.GetType(), "IdntificadorBloqueScript", "alert('" + ex.Message + "')", true);
            }
        }