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); }
public void GuardarArticulo(IView_SubirArticulo view) { 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(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.SaveArticulo(articulo, topicosArticulo); }
public void GuardarArticulo(IView_EscribirArticulo view) { 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(view.titulo, view.resumen, view.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)); } } if (topicosArticulo.Count == 0) { Utilidades.SetErrorMsg((Page)view, "Debe elegir al menos un topico", "~/EscribirArticulo.aspx"); } artdbHandler.SaveArticulo(articulo, topicosArticulo); }
public EnviarEmailController() { AutorDBHandler autorHandler = new AutorDBHandler(); listaAutores = autorHandler.getListaAutores(); }