예제 #1
0
 public ActionsUI(IOrganization org)
 {
     Get         = org as IRetrieve;
     Workers     = org as IWorkersActions;
     Departments = org as IDepartmentsActions;
     Json        = new JsonUI();
 }
예제 #2
0
        /// <summary>
        /// Opens dialog to specify JSON file name where organization will be serialized,
        /// and serializes organization
        /// </summary>
        /// <param name="org">Organization to serialize</param>
        public void Serialize(IOrganization org)
        {
            IRetrieve Get = org as IRetrieve;

            // Configure save file dialog box
            Microsoft.Win32.SaveFileDialog dlg = new Microsoft.Win32.SaveFileDialog();
            dlg.FileName   = Get.RootDepartment().DeptName;   // Default file name
            dlg.DefaultExt = ".json";                         // Default file extension
            dlg.Filter     = "JSON documents (.json)|*.json"; // Filter files by extension

            // Show save file dialog box
            bool?result = dlg.ShowDialog();

            // Process save file dialog box results
            if (result != true)
            {
                return;
            }

            // Save document
            JsonBE.Serialize(dlg.FileName, org);
        }
 public LoadAndSaveLastData(ISave save, IRetrieve ret)
 {
     providers = new LoadExchangeProviders("plugins");
     this.save = save;
     this.ret  = ret;
 }
예제 #4
0
 /// <summary>
 /// ctor
 /// </summary>
 /// <param name="ret"></param>
 public FromDBController(IRetrieve ret)
 {
     this.retrieve = ret;
 }
예제 #5
0
        public EntityReferenceHandler(string entityLogicalName, IRetrieveAll retrieveAllService, IRetrieve retrieveService)
        {
            if (string.IsNullOrEmpty(entityLogicalName))
            {
                throw new ArgumentException("message", nameof(entityLogicalName));
            }

            EntityLogicalName  = entityLogicalName;
            RetrieveAllService = retrieveAllService ?? throw new ArgumentNullException(nameof(retrieveAllService));
            RetrieveService    = retrieveService ?? throw new ArgumentNullException(nameof(retrieveService));
        }