Пример #1
0
        public CannedText CreateCannedText(CannedTextDetail detail, Staff owner, IPersistenceContext context)
        {
            CannedText newCannedText = new CannedText();

            UpdateCannedText(newCannedText, detail, owner, context);
            return(newCannedText);
        }
Пример #2
0
 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;
 }
Пример #3
0
        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));
        }
Пример #4
0
        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));
        }
Пример #5
0
        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);
                }
            }
        }
Пример #7
0
 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);
        }
Пример #9
0
        public void Commit(CannedText cannedText, ICannedTextLookupHandler handler)
        {
            ClosePopup();

            if (cannedText != null)
            {
                if (cannedText.IsSnippet)
                    _textEditor.SetSelectedText(handler.GetFullText(cannedText));
                else
                    _textEditor.SetSelectedText(cannedText.Text);
            }
        }
Пример #10
0
        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);
        }