private void AddNewLetter(DP_DataView dataItem)
        {
            var initializer = new LetterAreaInitializer();

            initializer.DataInstance = dataItem;
            var editLetterArea = new EditLetterArea(initializer);

            editLetterArea.LetterUpdated += EditLetterArea_LetterUpdated;
            AgentUICoreMediator.GetAgentUICoreMediator.UIManager.GetDialogWindow().ShowDialog(editLetterArea.View, "نامه", Enum_WindowSize.Big);
        }
        private void EditMenu_Clicked(object sender, EventArgs e, LetterDTO letter)
        {
            var initializer = new LetterAreaInitializer();

            initializer.LetterID = letter.ID;
            var editLetterArea = new EditLetterArea(initializer);

            editLetterArea.LetterUpdated += EditLetterArea_LetterUpdated;
            AgentUICoreMediator.GetAgentUICoreMediator.UIManager.GetDialogWindow().ShowDialog(editLetterArea.View, "نامه", Enum_WindowSize.Big);
        }
Ejemplo n.º 3
0
        public EditLetterArea(LetterAreaInitializer areaInitializer)
        {
            AreaInitializer = areaInitializer;
            //EntityID = entityId;
            if (AreaInitializer.LetterID != 0)
            {
                LetterMessage = AgentUICoreMediator.GetAgentUICoreMediator.LetterManager.GetLetter(AgentUICoreMediator.GetAgentUICoreMediator.GetRequester(), AreaInitializer.LetterID, true);
                AreaInitializer.DataInstance = LetterMessage.DataItem;
            }
            else
            {
                LetterMessage = new LetterDTO();
            }
            var permissions = AgentUICoreMediator.GetAgentUICoreMediator.tableDrivedEntityManagerService.GetEntityAssignedPermissions(AgentUICoreMediator.GetAgentUICoreMediator.GetRequester(), areaInitializer.DataInstance.TargetEntityID, false);

            if (!permissions.GrantedActions.Any(x => x == SecurityAction.LetterEdit))
            {
                return;
            }
            View = AgentUICoreMediator.GetAgentUICoreMediator.UIManager.GenerateViewOfLetterArea();
            SetExtensions();
            View.GenerateFileClicked                      += View_GenerateFileClicked;
            View.LetterConfirmed                          += View_LetterConfirmed;
            View.NewClicked                               += View_NewClicked;
            View.ShowExternalFileClicked                  += View_ShowExternalFileClicked;
            View.ShowFileClicked                          += View_ShowFileClicked;
            View.DownloadFileClicked                      += View_DownloadFileClicked;
            View.ConvertToExternalClicked                 += View_ConvertToExternalClicked;
            View.GenerateOrSelectClicked                  += View_GenerateOrSelectClicked;
            View.ExternalOrInternalClicked                += View_ExternalOrInternalClicked;
            View.ExternalInfoRequested                    += View_ExternalInfoRequested;
            View.ShowGeneratedFileClicked                 += View_ShowGeneratedFileClicked;
            relatedLetterSearchLookup                      = new MySearchLookup();
            relatedLetterSearchLookup.DisplayMember        = "Title";
            relatedLetterSearchLookup.SelectedValueMember  = "ID";
            relatedLetterSearchLookup.SearchFilterChanged += RelatedLetterSearchLookup_SearchFilterChanged;
            relatedLetterSearchLookup.SelectionChanged    += RelatedLetterSearchLookup_SelectionChanged;
            View.AddRelatedLetterSelector(relatedLetterSearchLookup);


            ShowLetter();
            var letterTemplates = AgentUICoreMediator.GetAgentUICoreMediator.LetterManager.GetMainLetterTemplates(AgentUICoreMediator.GetAgentUICoreMediator.GetRequester(), AreaInitializer.DataInstance.TargetEntityID);

            View.LetterTemplates = letterTemplates;

            View.LetterTypes = AgentUICoreMediator.GetAgentUICoreMediator.LetterManager.GetLetterTypes();
            LetterSetting    = AgentUICoreMediator.GetAgentUICoreMediator.LetterManager.GetLetterSettings();
            //if(LetterSetting==null||LetterSetting.LetterExternalInfoCode==null)
        }