public void putMeetingAgenda(int id, Agendum agenda) { db.Entry(agenda).State = EntityState.Modified; db.SaveChanges(); }
private static string FormatAgendaMsg(Agendum m, NotificationType type, string mTitle) { string t = type.ToString(); string msg; switch (t) { case "Agenda_New": // note is meeting title msg = "<b>A new agendum has been added to the meeting: </b><br><hr>"; msg += "<b>Meeting Details</b><br>"; msg += "Title: " + mTitle + "<br><hr>"; msg += "<b>Agendum Title: </b>" + m.AgendaTitle; return(msg); case "Agenda_Update": // note is agenda title msg = "<b>An update has been made to Meeting Agenda: </b><br><hr>"; msg += "<b>Meeting Title: </b>" + mTitle; return(msg); default: return(""); } }
public ActionResult DeleteConfirmed(int id) { Agendum agendum = db.AGENDA.Find(id); db.AGENDA.Remove(agendum); db.SaveChanges(); return(RedirectToAction("Index")); }
public string DeleteAgenda(int id) { Agendum agenda = db.Agenda.Find(id); db.Agenda.Remove(agenda); db.SaveChanges(); return(id.ToString()); }
public ActionResult Edit([Bind(Include = "ID,NOME,SOBRENOME,TELEFONE_RESIDENCIAL,CELULAR_PRINCIPAL,CELULAR_RECADOS,ENDERECO,NUMERO,BAIRRO,CIDADE,ESTADO")] Agendum agendum) { if (ModelState.IsValid) { db.Entry(agendum).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(agendum)); }
public ActionResult Edit([Bind(Include = "ID,Nombre,Telefono,Direccion,Evento,Lugar,Fecha")] Agendum agendum) { if (ModelState.IsValid) { db.Entry(agendum).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(agendum)); }
public ActionResult Create([Bind(Include = "ID,Nombre,Telefono,Direccion,Evento,Lugar,Fecha")] Agendum agendum) { if (ModelState.IsValid) { db.Agenda.Add(agendum); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(agendum)); }
// GET: Agenda/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Agendum agendum = db.AGENDA.Find(id); if (agendum == null) { return(HttpNotFound()); } return(View(agendum)); }
public static Agendum SaveAgenda(string count, string title, string desc, int meetingID, bool published, int?subagenda) { try { using (boxEntities box = new boxEntities()) { Agendum ag = new Agendum(); ag.AgendaCount = count; ag.AgendaTitle = title; ag.AgendaDesc = desc; ag.MeetingID = meetingID; ag.Published = published; ag.Privacy = AgendaStatus.Public.ToString(); if (subagenda != 0) { ag.SubAgenda = subagenda; } box.Agenda.AddObject(ag); box.SaveChanges(); // get meeting participants and save them in agenda privacy var parti = (from o in box.MeetingParticipants where o.MeetingID == meetingID select o).ToList(); foreach (var p in parti) { AgendaPrivacy pri = new AgendaPrivacy(); pri.AgendaID = ag.AgendaID; pri.PartiID = p.MeetingParti; pri.CanSee = false; if (p.Role == MeetingRoles.Creator.ToString()) { pri.CanSee = true; } box.AgendaPrivacies.AddObject(pri); } box.SaveChanges(); return(ag); } } catch { throw new Exception(); } }
/// <summary> /// Method which creates an Appointment from an Agendum object and calls /// default appointment provider to enable the user to add an appointment. /// </summary> /// <param name="agendum">The agenda event to add to the calendar</param> public async static void CreateAppointmentFromAgendum(Agendum agendum) { if (agendum != null) { Appointment appointment = new Appointment { Subject = agendum.SubjectDescription.NullValueToEmpty(), Details = agendum.Description.NullValueToEmpty(), StartTime = agendum.BeginDateTime, Duration = agendum.EndDateTime - agendum.BeginDateTime, AllDay = agendum.FullDay, Reminder = TimeSpan.FromDays(1) }; await AppointmentManager.ShowEditNewAppointmentAsync(appointment); } }
public static void Not_UpdateAgenda(Agendum agenda, string user) { using (boxEntities box = new boxEntities()) { int uid = Profile.getUserID(user); NotificationHeader notH = new NotificationHeader(); notH.NotType = NotificationType.Agenda_Update.ToString(); notH.NotDate = DateTime.Now; notH.AgendaID = agenda.AgendaID; notH.NotCreator = uid; box.NotificationHeaders.AddObject(notH); box.SaveChanges(); // get parti // get recipients email var re = (from o in box.AgendaPrivacies where o.AgendaID == agenda.AgendaID && o.Agendum.Published == true && o.CanSee == true select o.MeetingParticipant.UserID).ToList(); re.Remove(uid); foreach (var i in re) { NotInfo notI = new NotInfo(); notI.UserID = i; notI.NotHeaderID = notH.NotID; notI.Ack = false; notI.Seen = false; box.NotInfoes.AddObject(notI); } box.SaveChanges(); // get data var mTitle = agenda.Meeting.MeetingTitle; var emails = getEmails(re); var msg = FormatAgendaMsg(agenda, NotificationType.Agenda_Update, mTitle); SendEmail(emails, msg, NotificationType.Agenda_Update); } }
public void PostAgendaOfMeeting(Agendum agenda) { db.Agenda.Add(agenda); db.SaveChanges(); }
public void Update(Agendum entity, int LoggedInUserId, int LoggedInOrganizationId) { base.Update(entity); _unitOfWork.Save(); }
public void Add(Agendum entity, int LoggedInUserId, int LoggedInOrganizationId) { entity.OrganizationID = LoggedInOrganizationId; base.Insert(entity); }