Exemplo n.º 1
0
        public DtoSede Usp_Sede_Delete(DtoSede objSede)
        {
            var cr  = new ClassResultV();
            var dto = (DtoSede)objSede;
            var pr  = new SqlParameter[7];

            try
            {
                pr[0]       = new SqlParameter("@idSede", SqlDbType.Int);
                pr[0].Value = dto.IdSede;
                pr[1]       = new SqlParameter("@nombre", SqlDbType.VarChar, 250);
                pr[1].Value = dto.Nombre;
                pr[2]       = new SqlParameter("@direccion", SqlDbType.VarChar, 250);
                pr[2].Value = dto.Direccion;
                pr[3]       = new SqlParameter("@referencia", SqlDbType.VarChar, 250);
                pr[3].Value = dto.Referencia;
                pr[4]       = new SqlParameter("@fechainicio", SqlDbType.Date);
                pr[4].Value = dto.FechaIncio;
                pr[5]       = new SqlParameter("@fechafin", SqlDbType.Date);
                pr[5].Value = dto.FechaFin;
                pr[6]       = new SqlParameter("@costo", SqlDbType.Float);
                pr[6].Value = dto.Costo;

                SqlDataReader reader = SqlHelper.ExecuteReader(objCn, CommandType.StoredProcedure, "sp_EliminarSede", pr);
            }
            catch (Exception ex)
            {
                cr.LugarError = ex.StackTrace;
                cr.ErrorEx    = ex.Message;
                cr.ErrorMsj   = "Error al eliminar sede";
            }
            objCn.Close();
            return(dto);
        }
Exemplo n.º 2
0
        public ClassResultV Consultar_Sede()
        {
            ClassResultV cr = new ClassResultV();

            try
            {
                SqlDataReader reader = SqlHelper.ExecuteReader(objCn, CommandType.StoredProcedure, "sp_Consultar_Jugadores");
                cr.List = new List <DtoB>();
                while (reader.Read())
                {
                    DtoSede dtoS = new DtoSede();
                    dtoS.IdSede = getValue("idSede", reader).Value_Int32;
                    dtoS.Nombre = getValue("nombre", reader).Value_String;
                    cr.List.Add(dtoS);
                }
            }
            catch (Exception ex)
            {
                cr.DT         = null;
                cr.LugarError = ex.StackTrace;
                cr.ErrorEx    = ex.Message;
                cr.ErrorMsj   = "Error al consultar las Personas";
            }
            objCn.Close();
            return(cr);
        }
Exemplo n.º 3
0
        public bool SelectBuscarSede(DtoSede objSe)
        {
            String     cone      = "Select * from T_Sede where idSede = " + objSe.IdSede;
            SqlCommand unComando = new SqlCommand(cone, conexion);

            conexion.Open();
            SqlDataReader reader = unComando.ExecuteReader();

            bool HayRegistros = reader.Read();

            if (HayRegistros)
            {
                objSe.Nombre     = (string)reader[1];
                objSe.Direccion  = (string)reader[2];
                objSe.Referencia = (string)reader[3];
                objSe.FechaIncio = (DateTime)reader[4];
                objSe.FechaFin   = (DateTime)reader[5];
                objSe.Costo      = float.Parse(reader[6].ToString());
                objSe.Estado     = 99;
            }
            else
            {
                objSe.Estado = 1;
            }

            conexion.Close();

            return(HayRegistros);
        }
Exemplo n.º 4
0
        protected void btnActualizar_Click(object sender, EventArgs e)
        {
            string mensaje = "";

            try
            {
                if (string.IsNullOrWhiteSpace(txtnombre.Text))
                {
                    mensaje += "--Nombre Vacio--/";
                }
                if (string.IsNullOrWhiteSpace(txtdireccion.Text))
                {
                    mensaje += "--Direccion Vacia--/";
                }
                if (string.IsNullOrWhiteSpace(txtreferencia.Text))
                {
                    mensaje += "--Referencia Vacia--/";
                }
                if (string.IsNullOrWhiteSpace(txtfechainicio.Text))
                {
                    mensaje += "--Fecha Incio Vacia--/";
                }
                if (string.IsNullOrWhiteSpace(txtfechafin.Text))
                {
                    mensaje += "--Fecha Fin Vacia--/";
                }
                if (string.IsNullOrWhiteSpace(txtcosto.Text))
                {
                    mensaje += "--Costo Vacio--";
                }
                if (!comprobarFloat(txtcosto.Text))
                {
                    mensaje += "--Costo No es un Numero Valido--";
                }
                LabelMensaje.Text = "" + mensaje;
                DateTime fechaini = Convert.ToDateTime(txtfechainicio.Text);
                DateTime fechafin = Convert.ToDateTime(txtfechafin.Text);
                float    costo    = float.Parse(txtcosto.Text);
                int      idCod    = int.Parse(txtid.Text);
                objSede = new DtoSede(idCod, txtnombre.Text, txtdireccion.Text, txtreferencia.Text, fechaini, fechafin, costo);
                objCtrSede.Usp_Sede_Update(objSede);
                Response.Redirect("Sede2.aspx");
            }
            catch (Exception ex)
            {
                mensaje = "Sede Actualizada Correctamente";
            }
        }
Exemplo n.º 5
0
        protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            Int32 num = Convert.ToInt32(e.CommandArgument);

            if (e.CommandName == "Modificar")
            {
                string re;
                re = GridView1.Rows[num].Cells[0].Text;
                int id = int.Parse(re);

                mostrarPanelModificar();
                objSede        = new DtoSede();
                objSede.IdSede = id;
                objCtrSede.BuscarSede(objSede);
                cargarDatosSede();
            }
            else
            {
                if (e.CommandName == "Eliminar")
                {
                    string re;
                    re = GridView1.Rows[num].Cells[0].Text;
                    int id;
                    id = int.Parse(re);

                    mostrarPanelModificar();
                    objSede        = new DtoSede();
                    objSede.IdSede = id;
                    objCtrSede.BuscarSede(objSede);
                    //Page.ClientScript.RegisterStartupScript(this.GetType(), "Scripts", "<script>confirm('Eiminar Sede?')</script>");
                    //Response.Write("<script>confirm('Eiminar Sede?')</script>");
                    objCtrSede.Usp_Sede_Delete(objSede);
                    Response.Redirect("Sede2.aspx");
                }
            }
        }
Exemplo n.º 6
0
 public bool BuscarSede(DtoSede objSedeBE)
 {
     return(objSedeDao.SelectBuscarSede(objSedeBE));
 }
Exemplo n.º 7
0
 public void Usp_Sede_Delete(DtoSede dto)
 {
     objSedeDto = new DtoSede();
     objSedeDao.Usp_Sede_Delete(dto);
 }
Exemplo n.º 8
0
 public void Usp_Sede_Insert(DtoSede dto)
 {
     objSedeDto = new DtoSede();
     objSedeDao.Usp_Sede_Insert(dto);
 }