Beispiel #1
0
        private bool ExecuteTransaction(string procedureName)
        {
            DBTransaction       db = new DBTransaction();
            List <SqlParameter> ps = new List <SqlParameter>();

            ps.Add(new SqlParameter("Usuario", Usuario));
            ps.Add(new SqlParameter("Password", Password));
            ps.Add(new SqlParameter("OficinaId", OficinaId));
            ps.Add(new SqlParameter("IsActivo", IsActivo));
            ps.Add(new SqlParameter("PersonaId", PersonaId));

            if (procedureName == "pSMInsertUsuario")
            {
                db.ExecStoreProcedure(procedureName, ps);
            }

            if ((procedureName == "pSMUpdateUsuario") ||
                (procedureName == "pSMDeleteUsuario"))
            {
                ps.Add(new SqlParameter("UsuarioId", UsuarioId));
                db.ExecStoreProcedure(procedureName, ps);
            }

            return(db.RowAffected > 0);
        }
Beispiel #2
0
        public bool SaveCronograma()
        {
            DataTable           dt = new DataTable();
            DBTransaction       db = new DBTransaction();
            List <SqlParameter> ls = new List <SqlParameter>();

            ls.Add(new SqlParameter("EventoId", this.EventoId));
            ls.Add(new SqlParameter("DeporteId", this.DeporteId));
            ls.Add(new SqlParameter("PruebaId", this.PruebaId));
            ls.Add(new SqlParameter("ParametroRamaId", this.ParametroRamaId));
            ls.Add(new SqlParameter("ParametroFaseId", this.ParametroFaseId));
            ls.Add(new SqlParameter("InstalacionId", this.InstalacionId));
            ls.Add(new SqlParameter("Fecha", this.Fecha));
            ls.Add(new SqlParameter("HoraProgramada", this.HoraProgramada));
            // ls.Add(new SqlParameter("FaseId", this.FaseId));
            ls.Add(new SqlParameter("ParametroTipoId", this.ParametroTipoId));
            ls.Add(new SqlParameter("AreaInstalacionId", this.AreaInstalacionId));
            ls.Add(new SqlParameter("Descripcion", this.Descripcion));

            if (this.CronogramaId == 0)
            {
                db.ExecStoreProcedure("prog.pInsCronograma", ls);
            }
            else
            {
                ls.Add(new SqlParameter("CronogramaId", this.CronogramaId));
                db.ExecStoreProcedure("[prog].[pUpCronograma]", ls);
            }


            return(db.RowAffected > 1 ? true: false);
        }
Beispiel #3
0
        public bool SaveEquipo()
        {
            DataTable           dt = new DataTable();
            DBTransaction       db = new DBTransaction();
            List <SqlParameter> lp = new List <SqlParameter>();

            lp.Add(new SqlParameter("Equipo", Equipo.ToUpper()));
            lp.Add(new SqlParameter("DelegacionId", DelegacionId));
            lp.Add(new SqlParameter("PruebaId", PruebaId));
            lp.Add(new SqlParameter("ParametroRamaId", ParametroRamaId));
            lp.Add(new SqlParameter("EventoId", EventoId));

            if (this.EquipoId == 0)
            {
                db.ExecStoreProcedure("[acre].[pInsEquipo]", lp);
            }
            else
            {
                lp.Clear();
                lp.Add(new SqlParameter("EquipoId", this.EquipoId));
                lp.Add(new SqlParameter("Equipo", Equipo.ToUpper()));
                lp.Add(new SqlParameter("DelegacionId", DelegacionId));
                lp.Add(new SqlParameter("PruebaEventoId", PruebaEventoId));

                db.ExecStoreProcedure("[acre].[pUpdEquipos]", lp);
            }


            return(db.RowAffected > 1 ? true : false);
        }
Beispiel #4
0
        private bool ExecuteTransaction(string procedureName, List <SqlParameter> ps)
        {
            DBTransaction db = new DBTransaction();

            db.ExecStoreProcedure(procedureName, ps);
            return(db.RowAffected > 0);
        }
Beispiel #5
0
        public bool DeleteInscrito(int CompetidorId)
        {
            DBTransaction       db = new DBTransaction();
            List <SqlParameter> ps = new List <SqlParameter>();

            ps.Add(new SqlParameter("CompetidorId", CompetidorId));
            db.ExecStoreProcedure("[golf].[pDeleteCompetidor]", ps);
            return(db.RowAffected > 0);
        }
Beispiel #6
0
        //eliminar usuario
        public bool DeleteU(int usuarioId)
        {
            DBTransaction       db = new DBTransaction();
            List <SqlParameter> ps = new List <SqlParameter>();

            ps.Add(new SqlParameter("usuarioId", usuarioId));
            db.ExecStoreProcedure("[erp].[pDelUsuario]", ps);
            return(db.RowAffected > 0);
        }
Beispiel #7
0
        public bool Delete(int competidorId)
        {
            DBTransaction       db = new DBTransaction();
            List <SqlParameter> ps = new List <SqlParameter>();

            ps.Add(new SqlParameter("CompetidorId", competidorId));
            db.ExecStoreProcedure("pDelCompetidor", ps);
            return(db.RowAffected > 0);
        }
Beispiel #8
0
        public bool Delete(int jornadaId)
        {
            DBTransaction       db = new DBTransaction();
            List <SqlParameter> ps = new List <SqlParameter>();

            ps.Add(new SqlParameter("JornadaId", jornadaId));
            db.ExecStoreProcedure("[golf].[pDeleteJornada]", ps);
            return(db.RowAffected > 0);
        }
Beispiel #9
0
        public static bool DeletePuntaje(int competidorJornadaId)
        {
            DBTransaction       db = new DBTransaction();
            List <SqlParameter> ps = new List <SqlParameter>();

            ps.Add(new SqlParameter("CompetidorJornadaId", competidorJornadaId));
            db.ExecStoreProcedure("[golf].[pDeleteJugadas]", ps);
            return(db.RowAffected > 0);
        }
Beispiel #10
0
        public bool Insert()
        {
            DBTransaction       db = new DBTransaction();
            List <SqlParameter> ps = new List <SqlParameter>();

            ps = SetParameters(ps);
            db.ExecStoreProcedure("[golf].[pInsCompetidor]", ps);
            return(db.RowAffected > 0);
        }
Beispiel #11
0
        public static bool DeleteEquipo(int equipoId)
        {
            DBTransaction       db = new DBTransaction();
            List <SqlParameter> ls = new List <SqlParameter>();

            ls.Add(new SqlParameter("EquipoId", equipoId));
            db.ExecStoreProcedure("[acre].[pDelEquipos]", ls);
            return(db.RowAffected > 0);
        }
Beispiel #12
0
        public bool UpdateEstado()
        {
            DBTransaction       db = new DBTransaction();
            List <SqlParameter> ps = new List <SqlParameter>();

            ps = SetParameters(ps);
            db.ExecStoreProcedure("[golf].[pUpdEstadoTarjeta]", ps);
            return(db.RowAffected > 0);
        }
Beispiel #13
0
        public static bool Delete(int grupoId)
        {
            DBTransaction       db = new DBTransaction();
            List <SqlParameter> ps = new List <SqlParameter>();

            ps.Add(new SqlParameter("GrupoId", grupoId));
            db.ExecStoreProcedure("[golf].[pDeleteGrupo]", ps);
            return(db.RowAffected > 0);
        }
Beispiel #14
0
        public static bool CambiarEstado(int competidorJornadaId)
        {
            DBTransaction       db = new DBTransaction();
            List <SqlParameter> ps = new List <SqlParameter>();

            ps.Add(new SqlParameter("CompetidorJornadaId", competidorJornadaId));
            db.ExecStoreProcedure("[golf].[pEstadoCompetidorJornada]", ps);
            return(db.RowAffected > 0);
        }
Beispiel #15
0
        public static bool DeleteCronograma(int cronogramaId)
        {
            DBTransaction       db = new DBTransaction();
            List <SqlParameter> ls = new List <SqlParameter>();

            ls.Add(new SqlParameter("CronogramaId", cronogramaId));
            db.ExecStoreProcedure("[prog].[pDelCronograma]", ls);
            return(db.RowAffected > 0);
        }
Beispiel #16
0
        public static bool DeleteCronogramaCompetidor(int cronogramaId, int competidorId)
        {
            DBTransaction       db = new DBTransaction();
            List <SqlParameter> ps = new List <SqlParameter>();

            ps.Add(new SqlParameter("CronogramaId", cronogramaId));
            ps.Add(new SqlParameter("CompetidorId", competidorId));
            db.ExecStoreProcedure("[indv].[pDelCronogramaCompetidor]", ps);
            return(db.RowAffected > 0);
        }
Beispiel #17
0
        public static bool DeleteGrupo(int GrupoId)
        {
            DBTransaction       db = new DBTransaction();
            List <SqlParameter> ls = new List <SqlParameter> {
                new SqlParameter("GrupoId", GrupoId)
            };

            db.ExecStoreProcedure("[prog].[pDelGrupos]", ls);
            return(db.RowAffected > 0);
        }
Beispiel #18
0
        public bool Update()
        {
            DBTransaction       db = new DBTransaction();
            List <SqlParameter> ps = new List <SqlParameter>();

            ps = SetParameters(ps);
            ps.Add(new SqlParameter("Estado", Estado));
            db.ExecStoreProcedure("pgolfUpCompetidorJornada", ps);
            return(db.RowAffected > 0);
        }
Beispiel #19
0
        public static bool UpdateCronogramaEstado(int cronogramaId, int estadoId)
        {
            DBTransaction       db = new DBTransaction();
            List <SqlParameter> ls = new List <SqlParameter>();

            ls.Add(new SqlParameter("CronogramaId", cronogramaId));
            ls.Add(new SqlParameter("Estado", estadoId));
            db.ExecStoreProcedure("[prog].[pUpEstadoCronograma]", ls);
            return(db.RowAffected > 0);
        }
Beispiel #20
0
        public bool ActualizarPassword()
        {
            DBTransaction       db = new DBTransaction();
            List <SqlParameter> ps = new List <SqlParameter>();

            ps.Add(new SqlParameter("Password", Password));
            ps.Add(new SqlParameter("UsuarioId", UsuarioId));

            db.ExecStoreProcedure("erp.pUpPassword", ps);
            return(db.RowAffected > 0);
        }
Beispiel #21
0
        public int UpdateEstado()
        {
            List <SqlParameter> ps = new List <SqlParameter>();

            ps.Add(new SqlParameter("CompetidorId", CompetidorId));
            ps.Add(new SqlParameter("Activo", Activo));
            DBTransaction db = new DBTransaction();

            db.ExecStoreProcedure("indv.pUpEstadoCompetidor", ps);
            return(db.RowAffected);
        }
Beispiel #22
0
        public int SaveEquipoGrupo()
        {
            List <SqlParameter> lp = new List <SqlParameter>();

            lp.Add(new SqlParameter("GrupoId", GrupoId));
            lp.Add(new SqlParameter("EquipoId", EquipoId));
            lp.Add(new SqlParameter("Orden", Orden));
            DBTransaction db = new DBTransaction();

            db.ExecStoreProcedure("prog.pUpEquipoGrupo", lp);
            return(db.RowAffected);
        }
Beispiel #23
0
        public static bool CreateFixture(int eventoId, int deporteId, int parametroRamaId)
        {
            List <SqlParameter> ls = new List <SqlParameter>();

            ls.Add(new SqlParameter("EventoId", eventoId));
            ls.Add(new SqlParameter("DeporteId", deporteId));
            ls.Add(new SqlParameter("ParametroRamaId", parametroRamaId));
            DBTransaction db = new DBTransaction();

            db.ExecStoreProcedure("[prog].[pCreacionFixture]", ls);
            return(db.RowAffected > 0);
        }
Beispiel #24
0
        // actualizar Usuarios
        public bool Guardar()
        {
            DBTransaction       db = new DBTransaction();
            List <SqlParameter> ps = new List <SqlParameter>();

            ps.Add(new SqlParameter("UsuarioId", UsuarioId));
            ps.Add(new SqlParameter("Usuario", Username));
            ps.Add(new SqlParameter("contraseña", DBSecurity.Encriptar(Password)));
            ps.Add(new SqlParameter("IsActivo", IsActivo));

            db.ExecStoreProcedure("[erp].[pUpUsuarios]", ps);
            return(db.RowAffected > 0);
        }
Beispiel #25
0
        public static int Llamado(int IDticket)
        {
            string procedimiento;
            List <SqlParameter> ps = new List <SqlParameter>();

            ps.Add(new SqlParameter("TicketId", IDticket));
            procedimiento = "erp.pUpTicket";

            DBTransaction db = new DBTransaction();

            db.ExecStoreProcedure(procedimiento, ps);
            return(db.RowAffected);
        }
Beispiel #26
0
        public bool AddUsuario()
        {
            DBTransaction       db = new DBTransaction();
            List <SqlParameter> ps = new List <SqlParameter>();

            ps.Add(new SqlParameter("Username", Username));
            ps.Add(new SqlParameter("Password", Password));
            ps.Add(new SqlParameter("OficinaId", OficinaId));
            ps.Add(new SqlParameter("IsActivo", IsActivo));
            ps.Add(new SqlParameter("PersonaId", PersonaId));

            db.ExecStoreProcedure("dbo.pInsUsuarios", ps);
            return(db.RowAffected > 0);
        }
Beispiel #27
0
        public bool SaveEquipoPersona()
        {
            DataTable           dt = new DataTable();
            DBTransaction       db = new DBTransaction();
            List <SqlParameter> lp = new List <SqlParameter>();

            lp.Add(new SqlParameter("EquipoId", EquipoId));
            lp.Add(new SqlParameter("PersonaId", PersonaId));
            lp.Add(new SqlParameter("Posicion", Posicion));
            lp.Add(new SqlParameter("NroCamiseta", NroCamiseta));

            db.ExecStoreProcedure("[acre].[pInsEquipoPersona]", lp);

            return(db.RowAffected > 0);
        }
Beispiel #28
0
        public static int Cerrar(Ticket tt)
        {
            string procedimiento;
            List <SqlParameter> ps = new List <SqlParameter>();

            ps.Add(new SqlParameter("tickeId", tt.Id));
            ps.Add(new SqlParameter("tiempo", tt.tiempo));
            ps.Add(new SqlParameter("servi", tt.servicio));
            procedimiento = "erp.pUpCerrar";

            DBTransaction db = new DBTransaction();

            db.ExecStoreProcedure(procedimiento, ps);
            return(db.RowAffected);
        }
Beispiel #29
0
        public static int SetTicket(string f, string h, int n)
        {
            string procedimiento;
            List <SqlParameter> ps = new List <SqlParameter>();

            ps.Add(new SqlParameter("Fecha", DateTime.Now));
            ps.Add(new SqlParameter("Hora", DateTime.Now));
            ps.Add(new SqlParameter("Numero", n));
            ps.Add(new SqlParameter("Estado", "0"));
            procedimiento = "erp.pInsTicket";

            DBTransaction db = new DBTransaction();

            db.ExecStoreProcedure(procedimiento, ps);
            return(db.RowAffected);
        }
Beispiel #30
0
        public static bool UpdateCronograma(int cronogramaId, int competidorId, string posicion, int parametromedallaId, int Sembrado, decimal marca, int esGanador, bool esRecord, string tiempo)
        {
            DBTransaction       db = new DBTransaction();
            List <SqlParameter> ls = new List <SqlParameter>();

            ls.Add(new SqlParameter("CronogramaId", cronogramaId));
            ls.Add(new SqlParameter("CompetidorId", competidorId));
            ls.Add(new SqlParameter("Posicion", posicion));
            ls.Add(new SqlParameter("ParametroMedallaId", parametromedallaId));
            ls.Add(new SqlParameter("Sembrado", Sembrado));
            ls.Add(new SqlParameter("Tiempo", tiempo));
            ls.Add(new SqlParameter("Marca", marca));
            ls.Add(new SqlParameter("EsGanador", esGanador));
            ls.Add(new SqlParameter("EsRecord", esRecord));
            db.ExecStoreProcedure("[indv].[pUpCronogramaCompetidor]", ls);
            return(db.RowAffected > 0);
        }