//   public DP_DataView DataItem { set; get; }
        //public bool SecurityNoAccess { set; get; }
        //public bool SecurityReadonly { set; get; }
        //public bool SecurityEdit { set; get; }
        //public bool SecurityEditAndDelete { set; get; }
        public EntityLettersArea(LettersAreaInitializer areaInitializer)
        {
            AreaInitializer = areaInitializer;
            //DataItem = dataInstance;
            //var keyColumns = dataInstance.KeyProperties;
            //AgentUICoreMediator.GetAgentUICoreMediator.DataItemManager.SetDataItemDTO(dataInstance);
            //EntityID = entityId;
            LetterView = AgentUICoreMediator.GetAgentUICoreMediator.UIManager.GenerateViewOfEntityLettersArea();
            LetterView.NewLetterClicked  += View_NewLetterClicked;
            LetterView.EnableAdd          = false;
            LetterView.DataTreeRequested += View_DataTreeRequested;

            LetterView.ContextMenuLoaded += LetterView_ContextMenuLoaded;
            MyUILibraryInterfaces.EntityArea.EntitySelectAreaInitializer selectAreaInitializer = new MyUILibraryInterfaces.EntityArea.EntitySelectAreaInitializer();
            selectAreaInitializer.ExternalView = LetterView;
            if (areaInitializer.EntityID != 0)
            {
                selectAreaInitializer.LockEntitySelector = true;
            }
            selectAreaInitializer.EntityID        = areaInitializer.EntityID;
            selectAreaInitializer.SpecificActions = new List <SecurityAction>()
            {
                SecurityAction.LetterView, SecurityAction.LetterEdit
            };
            EntitySelectArea = new EntitySelectArea.EntitySelectArea(selectAreaInitializer);
            EntitySelectArea.EntitySelected   += EntitySelectArea_EntitySelected;
            EntitySelectArea.DataItemSelected += SelectArea_DataItemSelected;
            MainView = EntitySelectArea.View;

            if (areaInitializer.DataInstance != null)
            {
                EntitySelectArea.EnableDisableSelectArea(false);
                EntitySelectArea.SelectData(areaInitializer.DataInstance);
            }
        }
Beispiel #2
0
 public DirectReportArea(DirectReportAreaInitializer areaInitializer)
 {
     //بهتره اکسترنال ویو ست بشه .. یعنی یک فرم و کنترل که مثل مرورگر باشد
     AreaInitializer    = areaInitializer;
     EntityDirectReport = AgentUICoreMediator.GetAgentUICoreMediator.ReportManager.GetEntityDirectReport(AgentUICoreMediator.GetAgentUICoreMediator.GetRequester(), areaInitializer.ReportID);
     if (EntityDirectReport == null)
     {
         AgentUICoreMediator.GetAgentUICoreMediator.UIManager.ShowInfo("دسترسی به گزارش به شناسه" + " " + areaInitializer.ReportID + " " + "امکانپذیر نمی باشد", "", Temp.InfoColor.Red);
         return;
     }
     MyUILibraryInterfaces.EntityArea.EntitySelectAreaInitializer selectAreaInitializer = new MyUILibraryInterfaces.EntityArea.EntitySelectAreaInitializer();
     selectAreaInitializer.EntityID           = EntityDirectReport.TableDrivedEntityID;
     selectAreaInitializer.LockEntitySelector = true;
     EntitySelectArea = new EntitySelectArea.EntitySelectArea(selectAreaInitializer);
     EntitySelectArea.DataItemSelected += EntitySelectArea_DataItemSelected;
     MainView = EntitySelectArea.View;
     if (areaInitializer.DataInstance != null)
     {
         EntitySelectArea.EnableDisableSelectArea(false);
         EntitySelectArea.SelectData(areaInitializer.DataInstance);
     }
 }