/// <summary> /// Speichern Button Klick Event /// </summary> /// <param name="button"></param> private void SaveButton_Click(Button button) { if (ValidateUserInput()) { var name = NameTextBox.Text; var description = SafeStringParser.safeParseToStr(DescriptionTextBox.Text); var noteId = Note.Add(name, description); if (noteId > 0) { KPage pageNoteAdmin = new KöTaf.WPFApplication.Views.pNoteAdministration();; SinglePage singlePage = new SinglePage(IniParser.GetSetting("NOTES", "notes"), pageNoteAdmin); } } }
public virtual ActionResult Edit(long?id, Note note) { if (note.Title.Length < 1 || note.Body.Length < 10) { Message = ("请输入正确的日志内容"); return(View(note)); } note.UserId = WebUser.UserId; if (id.HasValue) { note.Id = id.Value; Note.Edit(note); } else { note.Type = (int)NoteType.Note; note.Username = WebUser.Name; note.ParentId = WebUser.UserId; Note.Add(note, WebUser); } return(RedirectToAction("Index")); }
public virtual ActionResult Post(long?id, Note note) { using (var ts = new TransactionScope()) { if (note.Title.Length < 1 || note.Body.Length < 1) { Message = "请输入正确的日志内容"; return(this.RedirectToReferrer()); } note.Type = (int)NoteType.GroupPost; note.UserId = WebContext.User.UserId; if (id.HasValue) { note.Id = id.Value; Note.Edit(note); } else { Note.Add(note, WebUser); } ts.Complete(); return(this.RedirectToReferrer()); } }
public void AddData(IEntity data, EntityType entityType) { switch (entityType) { case EntityType.Person: { Persons.Add((Person)data); break; } case EntityType.Death: { Deaths.Add((Death)data); break; } case EntityType.PayerPlanPeriod: { PayerPlanPeriods.Add((PayerPlanPeriod)data); break; } case EntityType.ConditionOccurrence: { ConditionOccurrences.Add((ConditionOccurrence)data); break; } case EntityType.DrugExposure: { DrugExposures.Add((DrugExposure)data); break; } case EntityType.ProcedureOccurrence: { ProcedureOccurrences.Add((ProcedureOccurrence)data); break; } case EntityType.Observation: { Observations.Add((Observation)data); break; } case EntityType.VisitOccurrence: { VisitOccurrences.Add((VisitOccurrence)data); break; } case EntityType.VisitDetail: { VisitDetails.Add((VisitDetail)data); break; } case EntityType.Cohort: { Cohort.Add((Cohort)data); break; } case EntityType.Measurement: { Measurements.Add((Measurement)data); break; } case EntityType.DeviceExposure: { DeviceExposure.Add((DeviceExposure)data); break; } case EntityType.ObservationPeriod: { ObservationPeriods.Add((ObservationPeriod)data); break; } case EntityType.DrugEra: { DrugEra.Add((EraEntity)data); break; } case EntityType.ConditionEra: { ConditionEra.Add((EraEntity)data); break; } case EntityType.Note: { Note.Add((Note)data); break; } } }
/// <summary> /// Adds the specified note. /// </summary> /// <param name="noteDTO">The note dto.</param> public void Add(NoteDTO noteDTO) { Note.Add(context, noteDTO); }