コード例 #1
0
        public Boolean UpdateInfoPalestrante(Interface_has_Palestrante_InfoPalestrante_Titulos_Estados pite)
        {
            bool   r     = false;
            string query = "UPDATE infopalestrante " +
                           "SET " +
                           "telefoneFixo=@telefoneFixo," +
                           "celular=@celular," +
                           "email=@email," +
                           "cidade=@cidade," +
                           "estados_idestados=@estados_idestados " +
                           "where palestrante_idpalestrante=@palestrante_idpalestrante";

            try
            {
                this.SetCMD(query);
                this.CMD.Parameters.Add("@telefoneFixo", DbType.String).Value             = pite.InfoPalestrante.TelefoneFixo;
                this.CMD.Parameters.Add("@celular", DbType.String).Value                  = pite.InfoPalestrante.Celular;
                this.CMD.Parameters.Add("@email", DbType.String).Value                    = pite.InfoPalestrante.Email;
                this.CMD.Parameters.Add("@cidade", DbType.String).Value                   = pite.InfoPalestrante.Cidade;
                this.CMD.Parameters.Add("@estados_idestados", DbType.Int32).Value         = pite.InfoPalestrante.Estados_idEstados;
                this.CMD.Parameters.Add("@palestrante_idpalestrante", DbType.Int32).Value = pite.Palestrante.IdPalestrante;
                this.SetWriter();
                r = true;
            }
            catch (InvalidCastException e)
            {
                r = false;
            }
            this.CloseConnection();
            return(r);
        }
コード例 #2
0
        public Boolean UpdatePalestrante(Interface_has_Palestrante_InfoPalestrante_Titulos_Estados pite)
        {
            bool   r     = false;
            string query = "UPDATE palestrante " +
                           "SET " +
                           "nomePalestrante=@nomePalestrante " +
                           "where idpalestrante=@idPalestrante;";

            try
            {
                this.SetCMD(query);
                this.CMD.Parameters.Add("@nomePalestrante", DbType.String).Value = pite.Palestrante.NomePalestrante;
                this.CMD.Parameters.Add("@idPalestrante", DbType.String).Value   = pite.Palestrante.IdPalestrante;
                this.SetWriter();
                r = true;
            }
            catch (InvalidCastException e)
            {
                r = false;
            }
            this.CloseConnection();
            return(r);
        }