Пример #1
0
        public void ActualizarArticulo(IView_EscribirArticulo view, int idArticuloPK, int tipo)
        {
            ArticuloDBHandler artdbHandler     = new ArticuloDBHandler();
            AutorDBHandler    autdbHandler     = new AutorDBHandler();
            String            nombreAutor      = view.autor;
            String            fechaPublicacion = DateTime.Today.Year.ToString() + "-" + DateTime.Today.Month.ToString() + "-" + DateTime.Today.Day.ToString();

            ArticuloModel      articulo        = new ArticuloModel(idArticuloPK, view.titulo, view.resumen, tipo, view.contenido, fechaPublicacion, nombreAutor, view.username);
            List <TopicoModel> topicosArticulo = new List <TopicoModel>();

            foreach (ListItem item in view.checkBoxList.Items)
            {
                if (item.Selected)
                {
                    topicosArticulo.Add(new TopicoModel(item.Value));
                }
            }
            artdbHandler.UpdateArticulo(articulo, topicosArticulo);
        }
Пример #2
0
        public void ActualizarArticulo(IView_SubirArticulo view, int idArticuloPK)
        {
            ArticuloDBHandler artdbHandler = new ArticuloDBHandler();
            AutorDBHandler    autdbHandler = new AutorDBHandler();


            String nombreCompletoAutor = autdbHandler.GetFullName(view.username);

            string contenidoString = System.Convert.ToBase64String(view.contenido, 0, view.contenido.Length);

            String        fechaPublicacion = DateTime.Today.Year.ToString() + "-" + DateTime.Today.Month.ToString() + "-" + DateTime.Today.Day.ToString();
            ArticuloModel articulo         = new ArticuloModel(idArticuloPK, view.titulo, view.resumen, view.tipo, contenidoString, fechaPublicacion, nombreCompletoAutor, view.username);

            List <TopicoModel> topicosArticulo = new List <TopicoModel>();

            foreach (ListItem item in view.checkBoxList.Items)
            {
                if (item.Selected)
                {
                    topicosArticulo.Add(new TopicoModel(item.Value));
                }
            }
            artdbHandler.UpdateArticulo(articulo, topicosArticulo);
        }