protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) { TareaDropDownList.DataSource = Tareas.Listar(" IdTarea, Descripcion ", "1=1"); TareaDropDownList.DataValueField = "IdTarea"; TareaDropDownList.DataTextField = "Descripcion"; TareaDropDownList.DataBind(); }
public ActionResult CrearTarea([Bind(Include = "Titulo_Tarea,Descripcion,Instrucciones,SesionId")] Tareas tarea, int?SesionId) { Random rn = new Random(); int numeroRandom = rn.Next(1, 3); string url = ""; switch (numeroRandom) { case 1: url = "https://image.freepik.com/vector-gratis/personaje-dibujos-animados-chica-hace-tarea_61103-14.jpg"; break; case 2: url = "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBxAPDxAPDxAQEA8QEA8PEBAQEBAPFxAPFRUWFxURFhUYHSggGBolHRUVIjIhJSkrLi4uFx8zODMtNygtLi0BCgoKDg0OGhAQGy0lHyUtLS0tLS8tLy0rLS0tLS0tLy0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLf/AABEIAOAA4QMBEQACEQEDEQH/xAAbAAEAAQUBAAAAAAAAAAAAAAAAAQIDBAUGB//EAEAQAAEDAgIGBQoDCAIDAAAAAAEAAgMEESExBRJBUWFxBhOBkdEVIjJSVJKTobHBB1PwFCMzQkNygvEkYnODwv/EABoBAQADAQEBAAAAAAAAAAAAAAABAgMEBQb/xAAuEQEAAgIBAwMCBQQDAQAAAAAAAQIDERIEITETQVEFYRQiMnGRUoGxwaHR4UL/2gAMAwEAAhEDEQA/APZV8u6BAQEBAQEBAQEBAQQTbNBb/aGeuz3mqdSLjSDljyxUaEoCAgICAgICAgICAgICIESICAgICAgICCzV1UcLDJK9sbG5ueQ0DtKmImZ1A4rTH4jxNu2ljMp/MkuxvMN9I9tl006WZ/U0jH8uTr+mFfNe87o2n+WECK3aPO+a6K4aR7LxSsNLPO+TGRz3ne9xf9StYiI8LrWo31bdngpFcT3MxY4ji0lp7wo1A21D0nrofQqZSB/LKeuHLz72HJU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T8nCvwrbWzD+rJ77j91PO3yjhX4WFVcQEBAQVIhBRKEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQVIh//9k="; break; case 3: url = "https://st3.depositphotos.com/5383684/12819/v/450/depositphotos_128190584-stock-illustration-cute-boy-working-on-homework.jpg"; break; } if (SesionId == null) { return(RedirectToAction("Create", "Sesion")); } ViewBag.listaTareas = db.Tareas.Where(x => x.SesionId == SesionId).ToList(); ViewBag.sesion = db.Sesiones.Where(x => x.SesionId == SesionId).ToList().FirstOrDefault(); tarea.UrlImagen = url; db.Tareas.Add(tarea); db.SaveChanges(); return(RedirectToAction("CrearTarea", "Sesion", new { SesionId = SesionId })); }
// POST: api/Bitacora public string Post([FromBody] Bitacora bitacora) { #region Plantilla Postman -> Abrir para ver. /*{ * "nombreUsuarioAdmin":"IDadminResponsable", * "codigoDelRegistro": "codigoDelRegistroPlaceholder", * "tipo":"tipoBitacoraPlaceholder", * "descripcion":"descripcionPlaceholder", * "registroEnDetalle":"registroEnDetallePlaceholder" * }*/ #endregion string nuevo_id = Tareas.generar_nuevo_id_para_un_registro(); Bitacora bitacora_temp = new Bitacora( nuevo_id , bitacora.nombreUsuarioAdmin , Tareas.obtener_fecha_actual() //Fecha , bitacora.codigoDelRegistro , bitacora.tipo , bitacora.descripcion , bitacora.registroEnDetalle ); bitacora_temp.guardarBitacora(bitacora_temp); return("Bitacora " + nuevo_id + " agregada."); }
/// <summary> /// Permite modificar una entidad en la base de datos /// </summary> /// <param name="tarea">La entidad que se desea modificar</param> private static bool Modificar(Tareas tarea) { bool paso = false; Contexto contexto = new Contexto(); try { //busca la entidad en la base de datos y la elimina contexto.Database.ExecuteSqlRaw($"Delete FROM TareasDetalle Where TareaId={tarea.TareaId}"); foreach (var item in tarea.Detalle) { contexto.Entry(item).State = EntityState.Added; } //marcar la entidad como modificada para que el contexto sepa como proceder contexto.Entry(tarea).State = EntityState.Modified; paso = contexto.SaveChanges() > 0; } catch (Exception) { throw; } finally { contexto.Dispose(); } return(paso); }
// POST: api/Usuario public string Post([FromBody] Usuario usuario) { #region Plantilla Postman -> Abrir para ver. //{ // "nombre":"Antonio", // "primerApellido": "Tenorio", // "segundoApellido":"Parra", // "correoElectronico":"*****@*****.**", // "nombreUsuario":"antonio93", // "contrasenia":"123" //} #endregion string nuevo_id = Tareas.generar_nuevo_id_para_un_registro(); Usuario usuario_temp = new Usuario( nuevo_id , usuario.nombre , usuario.primerApellido , usuario.segundoApellido , usuario.correoElectronico , usuario.nombreUsuario , usuario.contrasenia ); usuario_temp.guardarNuevoUsuario(usuario_temp); return("Usuario " + nuevo_id + " registrado."); }
protected void EliminarButton_Click(object sender, EventArgs e) { Tareas.Eliminar(Util.ObtenerEntero(this.IdtareaTextBox.Text)); { this.VaciarCampos(); } }
public ActionResult Post([FromBody] Tareas value) { IList <Tareas> tareas = new List <Tareas>(); tareas = (System.Collections.Generic.IList <REST_APi.Model.Tareas>)TareasRepository.Posttareas(value); return(this.Ok(tareas)); }
protected void Page_Load(object sender, EventArgs e) { int id = int.Parse(Request.QueryString["id"]); DataSet dsProyecto = p.obtenerPorID(id); if (dsProyecto.Tables[0].Rows.Count > 0) { lblNombreProyecto.Text = dsProyecto.Tables[0].Rows[0]["nombre"].ToString(); lblNombre.Text = dsProyecto.Tables[0].Rows[0]["nombre"].ToString(); lblDesc.Text = dsProyecto.Tables[0].Rows[0]["descripcion"].ToString(); lblInicio.Text = dsProyecto.Tables[0].Rows[0]["fecha_ini"].ToString(); lblFin.Text = dsProyecto.Tables[0].Rows[0]["fecha_fin"].ToString(); int userID = int.Parse(dsProyecto.Tables[0].Rows[0]["usuario_id"].ToString()); DataSet dsUsuario = _u.obtenerPorID(userID); lblResponsable.Text = dsUsuario.Tables[0].Rows[0]["nombre"].ToString() + " " + dsUsuario.Tables[0].Rows[0]["apellido"].ToString(); Tareas t = new Tareas(); lvTareas.DataSource = t.obtenerTareasPorProyecto(id); lvTareas.DataBind(); } }
private void Agregarbutton_Click(object sender, EventArgs e) { if (!ValidarDetalle()) { return; } if (DetallesdataGridView.DataSource != null) { this.Detalle = (List <ProyectosDetalle>)DetallesdataGridView.DataSource; } Tareas tareas = BuscarId(TareacomboBox.Text); this.Detalle.Add(new ProyectosDetalle() { TipoId = tareas.TareaId, TipoTarea = tareas.TipoTarea, Requerimiento = RequerimientotextBox.Text, Tiempo = Convert.ToInt32(TiempotextBox.Text) }); int total = Convert.ToInt32(TotaltextBox.Text); int tiempo = Convert.ToInt32(TiempotextBox.Text); total += tiempo; TotaltextBox.Text = Convert.ToString(total); CargarGrid(); TareacomboBox.Focus(); RequerimientotextBox.Clear(); TiempotextBox.Clear(); ErrorProvider.Clear(); }
public ActionResult Edit(string id, Tareas taskToModify) { DaoAccesos dao = new DaoAccesos(); dao.ModificarTarea(taskToModify); return(RedirectToAction("ListaTareas")); }
public async Task <IActionResult> Edit(int id, [Bind("IdTarea,TituloTarea,DescripcionTarea,FechaTarea,HoraTarea,IdEstadoFk,IdPrioridadFk,IdInstitucionFk")] Tareas tareas) { if (id != tareas.IdTarea) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(tareas); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TareasExists(tareas.IdTarea)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["IdEstadoFk"] = new SelectList(_context.Estados, "IdEstado", "DescripcionEstado", tareas.IdEstadoFk); ViewData["IdInstitucionFk"] = new SelectList(_context.Instituciones, "IdInstitucion", "DescripcionInstitucion", tareas.IdInstitucionFk); ViewData["IdPrioridadFk"] = new SelectList(_context.Prioridades, "IdPrioridad", "DescripcionPrioridad", tareas.IdPrioridadFk); return(View(tareas)); }
public ActionResult Edit(string id) { DaoAccesos dao = new DaoAccesos(); Tareas myTarea = dao.GetTareaById(id); return(View(myTarea)); }
protected void btnAgregarTarea_Click(object sender, EventArgs e) { Tareas _t = new Tareas(); string _checked; if (chkCompletada.Checked) { _checked = "1"; } else { _checked = "0"; } int proyID = int.Parse(Request.QueryString["id"]); bool success = _t.Crear(txtNombreTask.Text, txtDesc.Text, txtFechaFin.Text, _checked, int.Parse(ddlResponsable.SelectedValue), proyID); if (success) { msg.Text = String.Format("El Proyecto: {0} ha sido creado exitosamente", txtNombreTask.Text); msg.CssClass = "alert alert-info"; } else { msg.Text = String.Format("El proyecto: {0} No pudo ser creado", txtNombreTask.Text); msg.CssClass = "alert alert-error"; } }
public void EliminarTarea(Tarea tarea) { if (Tareas.Contains(tarea)) { Tareas.Remove(tarea); } }
public ActionResult Create([Bind(Include = "idTarea,idMateria,descripcionTarea,fechaInicio,fechaFinal,tipoTarea")] Tareas tareas) { try { if (ModelState.IsValid) { db.Tareas.Add(tareas); db.SaveChanges(); return(RedirectToAction("Index")); } } catch (DbEntityValidationException e) { foreach (var eve in e.EntityValidationErrors) { Console.WriteLine("Entity of type \"{0}\" in state \"{1}\" has the following validation errors:", eve.Entry.Entity.GetType().Name, eve.Entry.State); foreach (var ve in eve.ValidationErrors) { Console.WriteLine("- Property: \"{0}\", Error: \"{1}\"", ve.PropertyName, ve.ErrorMessage); } } throw; } ViewBag.idMateria = new SelectList(db.Materias, "idMateria", "nombreMateria", tareas.idMateria); return(View(tareas)); }
public static void PutTareas(Tareas value, int id) { var index = tareas.FindIndex(o => o.id == id); groups[index].Name = value.Name; usuario[index].Estado = value.Estado; }
protected void Page_Load(object sender, EventArgs e) { Semestres semestre = new Semestres(); Asignaturas asignatura = new Asignaturas(); if (!IsPostBack) { Tareas tarea = new Tareas(); if (Request.QueryString["IdTarea"] != null) { tarea.IdTarea = Util.ObtenerEntero(Request.QueryString["IdTarea"]); if (tarea.Buscar()) { this.LLenarCampos(tarea); } } } this.IdsemestreDropDownList.DataSource = semestre.Listar("IdSemestre,Codigo", "1=1"); this.IdsemestreDropDownList.DataValueField = "IdSemestre"; this.IdsemestreDropDownList.DataTextField = "Codigo"; this.IdsemestreDropDownList.DataBind(); this.IdasignaturaDropDownList.DataSource = Asignaturas.Lista("IdAsignatura,Nombre", "1=1"); this.IdasignaturaDropDownList.DataValueField = "IdAsignatura"; this.IdasignaturaDropDownList.DataTextField = "Nombre"; this.IdasignaturaDropDownList.DataBind(); }
async Task ExecuteLoadItemsCommand() { if (IsBusy) { return; } IsBusy = true; try { Tareas.Clear(); var items = await DataStore.GetItemsAsync(true); foreach (var item in items) { Tareas.Add(item); } } catch (Exception ex) { Debug.WriteLine(ex); } finally { IsBusy = false; } }
protected void Page_Load(object sender, EventArgs e) { string email = Convert.ToString(Session.Contents["email"]); if (!Page.IsPostBack) { //CARGAR EL DROPDOWNLIST DataView aDV = Tareas.CargarAsignaturas(email); dropAsignaturas.DataSource = aDV; dropAsignaturas.DataTextField = "codigoasig"; dropAsignaturas.DataValueField = "codigoasig"; dropAsignaturas.DataBind(); try { dropAsignaturas.SelectedValue = dropAsignaturas.Items[0].Value; //CARGAR EL GRINDVIEW SIN FILTROS DataView dv = Tareas.BuscarTareasGenericas(email, dropAsignaturas.SelectedValue); gridTareas.DataSource = dv; gridTareas.DataBind(); } catch (Exception) { } } }
public Tareas create(Tareas entity) { Tareas tarea1 = new Tareas(); tarea1 = TareasRepository.Posttareas(entity); return(tarea1); }
public void DeleteTareas(int id) { Tareas t = new Tareas(); t.id = id; TareasRepository.Deletetarea(t); }
public Tareas update(Tareas entity) { Tareas tarea2 = new Tareas(); //tarea2 = TareasRepository.PutTareas(id); return(tarea2); }
private BLL.Objeto.EasyPay contruirObjetoEasyPay() { BLL.Objeto.EasyPay EasyPay_temporal = new BLL.Objeto.EasyPay(); // Capturamos los datos. string id = Tareas.generar_nuevo_id_para_un_registro(); string id_usuario = Memoria.sesionUsuarioDatos.id; string id_tarjeta = Textbox_idTarjeta.Text; string codigoSeguridad = EasyPay_temporal.generarCodigoDeSeguridad(); string contrasenia = TextBox_contraseniaNueva.Text; string monto = "NA"; // Creamos el EasyPay a guardar. BLL.Objeto.EasyPay EasyPay_return = new BLL.Objeto.EasyPay( id , id_usuario , id_tarjeta , codigoSeguridad , contrasenia , monto); // Una vez establecido su tarjeta asociada podemos obtener el monto // reflejo de dicha tarjeta. monto = EasyPay_return.obtenerMontoActual(); EasyPay_return.monto = monto; return(EasyPay_return); }
public Tareas delete(Tareas entity) { Tareas tarea3 = new Tareas(); tarea3 = TareasRepository.Deletetarea(entity); return(tarea3); }
public ActionResult Create(CrearTareaViewModel vmCrearTarea) { try { if (ModelState.IsValid) { var prof = db.Profesiones.Find(vmCrearTarea.ProfesionID); var tarea = new Tareas { Desc_Tarea = vmCrearTarea.tarea, Profesiones = prof }; if (ValidaTarea(tarea.Desc_Tarea.ToString(), tarea.Profesiones.Id_Profesion) == false) { db.Tareas.Add(tarea); db.SaveChanges(); return(RedirectToAction("Index")); } } ViewBag.ProfesionID = new SelectList(db.Profesiones.ToList(), "Id_Profesion", "Desc_Profesion"); return(View()); } catch { return(RedirectToAction("Index")); } }
public void ConsultarTareas() { foreach (var tarea in Tareas.ToList()) { Console.WriteLine($"Id: {tarea.Id} Titulo: {tarea.Titulo} Vencimiento: {tarea.Vencimiento} Estimacion: {tarea.Estimacion} Estado: {tarea.Estado}"); } }
public TasksPageViewModel() { InitializeCommand = new Command(async() => { Tareas = await Locator.Database.GetTareas(); if (Tareas.Count() > 0) { AnyTask = true; } else { AnyTask = false; } }); CreateCommand = new Command(async() => { CreateTaskPage createTaskPage = new CreateTaskPage(); createTaskPage.BindingContext = Locator.StaticCreateTaskPageViewModel; await Application.Current.MainPage.Navigation.PushAsync(createTaskPage); }); SelectTaskCommand = new Command <Tarea>(async(Tarea tarea) => { SelectTask SelectTask = new SelectTask(); SelectTask.BindingContext = Locator.StaticSelectTaskPageViewModel; Locator.StaticSelectTaskPageViewModel.Tarea = tarea; await PopupNavigation.Instance.PushAsync(SelectTask); }); }
void RemoveTaskExecute() { if (SelectedIndex > -1) { Tareas.RemoveAt(SelectedIndex); } }
// PUT: api/Bitacora/5 public string Put([FromBody] Bitacora bitacora) { #region Plantilla Postman -> Abrir para ver. //{ // "ID":"IDBitacoraPlaceholder", // "nombreUsuarioAdmin":"editado", // "codigoDelRegistro": "editado", // "tipo":"editado", // "descripcion":"editado", // "registroEnDetalle":"editado" //} #endregion Bitacora bitacora_temp = new Bitacora( bitacora.id , bitacora.nombreUsuarioAdmin , Tareas.obtener_fecha_actual() , bitacora.codigoDelRegistro , bitacora.tipo , bitacora.descripcion , bitacora.registroEnDetalle ); bitacora_temp.actualizarBitacora(bitacora_temp); return("Bitacora " + bitacora.id + " actualizada."); }
public async Task <bool> SaveItemTarea(Tareas model, bool esNuevo = false) { bool ejecucionCorrecta = false; try { HttpClient client = new HttpClient(); client.MaxResponseContentBufferSize = 256000; var uri = new Uri(urlapi + (esNuevo == true ? string.Empty : "/" + model.Id)); var json = JsonConvert.SerializeObject(model); var content = new StringContent(json, Encoding.UTF8, "application/json"); HttpResponseMessage response = null; if (esNuevo) { response = await client.PostAsync(uri, content); } else { response = await client.PutAsync(uri, content); } if (response.IsSuccessStatusCode) { ejecucionCorrecta = true; } } catch (Exception ex) { } return(ejecucionCorrecta); }