Exemplo n.º 1
0
        public Tuple <bool, string> UpdateSeccion(dtoSeccion Seccion)
        {
            Tuple <bool, string> _result = new Tuple <bool, string>(false, ConstantesComunes.ERROR_GENERICO);

            try
            {
                string conexion = ConfigurationManager.ConnectionStrings["WDXAdminConnection"].ToString();
                using (SqlConnection Conn = new SqlConnection(conexion))
                {
                    Conn.Open();
                    SqlCommand Cmd = Conn.CreateCommand();
                    Cmd.CommandType = System.Data.CommandType.StoredProcedure;
                    Cmd.CommandText = ConstantesSecciones.SP_ACTUALIZA_SECCIONES;
                    Cmd.Parameters.AddWithValue("@IdSeccion", Seccion.IdSeccion);
                    Cmd.Parameters.Add("@TextoSeccion", SqlDbType.VarChar, 4000).Value = Seccion.Texto;
                    Cmd.Parameters.Add("@Result", SqlDbType.VarChar, -1).Direction     = ParameterDirection.Output;
                    Cmd.ExecuteNonQuery();
                    if (String.IsNullOrEmpty(Cmd.Parameters[2].Value.ToString()))
                    {
                        _result = new Tuple <bool, string>(true, ConstantesComunes.EXITO_GENERICO);
                    }
                }
            }
            catch (Exception ex)
            {
            }
            return(_result);
        }
Exemplo n.º 2
0
            private void GuardaSeccionDoWork(object sender, DoWorkEventArgs e)
            {
                dtoSeccion SeccionNueva = new dtoSeccion
                {
                    IdSeccion = this.viewModelPadre.SeccionElegida.IdSeccion,
                    Texto     = this.viewModelPadre.SeccionElegida.TextoSeccion
                };

                e.Result = new BALSecciones().UpdateSeccion(SeccionNueva);
                Tuple <bool, string> _resultado = e.Result as Tuple <bool, string>;

                if (_resultado.Item1 == false)
                {
                    throw new Exception(_resultado.Item2);
                }
            }
Exemplo n.º 3
0
 public Tuple <bool, string> UpdateSeccion(dtoSeccion Seccion)
 {
     return(new DALSecciones().UpdateSeccion(Seccion));
 }