public CannedText CreateCannedText(CannedTextDetail detail, Staff owner, IPersistenceContext context) { CannedText newCannedText = new CannedText(); UpdateCannedText(newCannedText, detail, owner, context); return(newCannedText); }
public void UpdateCannedText(CannedText cannedText, CannedTextDetail detail, Staff owner, IPersistenceContext context) { cannedText.Name = detail.Name; cannedText.Category = detail.Category; cannedText.Staff = detail.IsPersonal ? owner : null; cannedText.StaffGroup = detail.IsGroup ? context.Load <StaffGroup>(detail.StaffGroup.StaffGroupRef, EntityLoadFlags.Proxy) : null; cannedText.Text = detail.Text; }
public CannedTextDetail GetCannedTextDetail(CannedText cannedText, IPersistenceContext context) { StaffGroupAssembler groupAssembler = new StaffGroupAssembler(); return(new CannedTextDetail( cannedText.Name, cannedText.Category, cannedText.StaffGroup == null ? null : groupAssembler.CreateSummary(cannedText.StaffGroup), cannedText.Text)); }
public CannedTextSummary GetCannedTextSummary(CannedText cannedText, IPersistenceContext context) { StaffAssembler staffAssembler = new StaffAssembler(); StaffGroupAssembler groupAssembler = new StaffGroupAssembler(); return(new CannedTextSummary( cannedText.GetRef(), cannedText.Name, cannedText.Category, cannedText.Staff == null ? null : staffAssembler.CreateStaffSummary(cannedText.Staff, context), cannedText.StaffGroup == null ? null : groupAssembler.CreateSummary(cannedText.StaffGroup), cannedText.Text)); }
public void Insert(Guid Guid, string Label, string Category, string TextX) { var item = new CannedText(); item.Guid = Guid; item.Label = Label; item.Category = Category; item.TextX = TextX; item.Save(UserName); }
public void Commit(CannedText cannedText, ICannedTextLookupHandler handler) { ClosePopup(); if (cannedText != null) { if (cannedText.IsSnippet) { _textEditor.SetSelectedText(handler.GetFullText(cannedText)); } else { _textEditor.SetSelectedText(cannedText.Text); } } }
private static void CheckCannedTextWriteAccess(CannedText cannedText) { CheckCannedTextWriteAccess(cannedText.StaffGroup == null); }
private void _lookup_Committed(object sender, EventArgs e) { CannedText cannedText = (CannedText)_lookup.Value; Commit(cannedText, _handlerInUse); }
public void Commit(CannedText cannedText, ICannedTextLookupHandler handler) { ClosePopup(); if (cannedText != null) { if (cannedText.IsSnippet) _textEditor.SetSelectedText(handler.GetFullText(cannedText)); else _textEditor.SetSelectedText(cannedText.Text); } }
public void Update(Guid Guid, string Label, string Category, string TextX) { var item = new CannedText(); item.MarkOld(); item.IsLoaded = true; item.Guid = Guid; item.Label = Label; item.Category = Category; item.TextX = TextX; item.Save(UserName); }