Пример #1
0
        //Constructor
        public MeasureController()
        {
            UnitOfWork unitOfWork = new UnitOfWork();

            this._measureRepository = new MeasureRepository(unitOfWork);
            this._caching           = new CacheManagement();
        }
Пример #2
0
        public TraineeController()
        {
            UnitOfWork unitOfWork = new UnitOfWork();

            this._ITrainingScheduleUserRepository = new TrainingScheduleUserRepository(unitOfWork);
            this._caching = new CacheManagement();
        }
Пример #3
0
        public LoginController()
        {
            UnitOfWork _unitOfWork = new UnitOfWork();

            this._IUserRepository             = new UserRepository(_unitOfWork);
            this._ISecurityQuestionRepository = new SecurityQuestionRepository(_unitOfWork);
            this._caching = new CacheManagement();
        }
Пример #4
0
        public TrainingController()
        {
            UnitOfWork unitOfWork = new UnitOfWork();

            this._ITrainingRepository         = new TrainingRepository(unitOfWork);
            this._ITrainingMaterialRepository = new TrainingMaterialRepository(unitOfWork);
            this._caching = new CacheManagement();
        }
Пример #5
0
 public IHttpActionResult Delete(int id)
 {
     if (_iProductsBusiness.Delete(id))
     {
         CacheManagement.RemoveProducts();
         return(Ok());
     }
     return(NotFound());
 }
Пример #6
0
        public AssignmentController()
        {
            UnitOfWork unitOfWork = new UnitOfWork();

            this._IAssignmentQuestionRepository = new AssignmentQuestionRepository(unitOfWork);
            this._IAssignmentRepository         = new AssignmentRepository(unitOfWork);
            // this._IMonitoringMethodRepository = new MonitoringMethodRepository(unitOfWork);
            // this._IDurationUnitRepository = new DurationUnitRepository(unitOfWork);
            this._caching = new CacheManagement();
        }
Пример #7
0
        public RoleResponsibilityController()
        {
            UnitOfWork unitOfWork = new UnitOfWork();

            this._IMasterRoleSectionRepository                = new MasterRoleSectionRepository(unitOfWork);
            this._IRoleResponsibilityRepository               = new RoleResponsibilityRepository(unitOfWork);
            this._IRoleResponsibilityVersionRepository        = new RoleResponsibilityVersionRepository(unitOfWork);
            this._IRoleResponsibilityVersionSectionRepository = new RoleResponsibilityVersionSectionRepository(unitOfWork);
            this._caching = new CacheManagement();
        }
Пример #8
0
        public RiskAssessmentController()
        {
            UnitOfWork unitOfWork = new UnitOfWork();

            this._IRiskAssessmentRepository   = new RiskAssessmentRepository(unitOfWork);
            this._IHazardRepository           = new HazardRepository(unitOfWork);
            this._IMonitoringMethodRepository = new MonitoringMethodRepository(unitOfWork);
            this._IDurationUnitRepository     = new DurationUnitRepository(unitOfWork);
            this._caching = new CacheManagement();
        }
        public IHttpActionResult Get(int id)
        {
            var product = CacheManagement.GetListProductCategories().SingleOrDefault(i => i.Id == id);

            if (product.IsNull())
            {
                return(NotFound());
            }
            return(Ok(product));
        }
Пример #10
0
        public DocumentController()
        {
            UnitOfWork unitOfWork = new UnitOfWork();

            this._IDocumentRepository                  = new DocumentRepository(unitOfWork);
            this._IDocumentVersionRepository           = new DocumentVersionRepository(unitOfWork);
            this._IMasterDocumentTypeRepository        = new MasterDocumentTypeRepository(unitOfWork);
            this._IMasterDocumentFolderRepository      = new MasterDocumentFolderRepository(unitOfWork);
            this._IMasterReviewFrequencyUnitRepository = new MasterReviewFrequencyUnitRepository(unitOfWork);
            this._caching = new CacheManagement();
        }
Пример #11
0
        private void Button1_Click(object sender, EventArgs e)
        {
            FolderBrowserDialog dialog = new FolderBrowserDialog();

            dialog.ShowDialog();
            if (!string.IsNullOrEmpty(dialog.SelectedPath))
            {
                string path = dialog.SelectedPath + @"\";
                CacheManagement.InitialSetting(path);
                textBox1.Text = path;
            }
        }
Пример #12
0
 protected override void OnStart(string[] args)
 {
     try
     {
         CacheManagement.Start();
     }
     catch (Exception e)
     {
         System.IO.File.WriteAllText("c:\\t.txt", e.Message + e.StackTrace);
     }
     Stop();
 }
        public IEnumerable <ApplicationLanguage> GetAllActive()
        {
            var cache = (IEnumerable <ApplicationLanguage>)CacheManagement.Get(_avaiableCulturesCacheKey);

            if (cache == null)
            {
                cache = Entities.ApplicationLanguage.Where(x => !x.IsDisabled).ToList();
                CacheManagement.Add(_avaiableCulturesCacheKey, cache);
            }

            return(cache);
        }
 public IHttpActionResult Delete(int id)
 {
     if (CacheManagement.GetListProducts().Where(pd => pd.CategoryID == id).Count() > 0)
     {
         return(Json(new { error = true, errormessage = MessageContant.Recordisused }));
     }
     if (_iProductCategoriesBusiness.Delete(id))
     {
         CacheManagement.RemoveProducts();
         return(Ok(1));
     }
     return(NotFound());
 }
Пример #15
0
 public IHttpActionResult Put(int id, Products model)
 {
     if (ModelState.IsValid && id != model.Id)
     {
         if (_iProductsBusiness.Edit(model))
         {
             CacheManagement.RemoveProducts();
             return(Ok());
         }
         return(NotFound());
     }
     return(BadRequest(ModelState));
 }
Пример #16
0
 public IHttpActionResult Post(Products model)
 {
     if (ModelState.IsValid)
     {
         if (_iProductsBusiness.Insert(model))
         {
             CacheManagement.RemoveProducts();
             return(Ok());
         }
         return(NotFound());
     }
     return(BadRequest(ModelState));
 }
Пример #17
0
 static void Main(string[] args)
 {
     if (args.Contains("/auto"))
     {
         CacheManagement.Start();
     }
     else
     {
         Application.EnableVisualStyles();
         Application.SetCompatibleTextRenderingDefault(false);
         Application.Run(new Form1());
     }
 }
 public IHttpActionResult Put(ProductCategories model)
 {
     if (ModelState.IsValid)
     {
         if (_iProductCategoriesBusiness.Edit(model))
         {
             CacheManagement.RemoveProducts();
             return(Ok(1));
         }
         return(NotFound());
     }
     return(BadRequest(ModelState));
 }
Пример #19
0
        // Search or create cache and return its value
        private IEnumerable <TEntity> GetCache()
        {
            var key = this.GetType().FullName;

            IEnumerable <TEntity> entity = (IEnumerable <TEntity>)CacheManagement.Get(key);

            if (entity == null)
            {
                entity = GetAll();
                CacheManagement.Add(key, entity);
            }

            return(entity);
        }
Пример #20
0
        public Form1()
        {
            InitializeComponent();

            foreach (string path in CacheManagement.FindChromeFolder())
            {
                listView1.Items.Add(path);
            }
            Config config = new Config();

            if (config.Contains("path"))
            {
                textBox1.Text = config.Values["path"];
            }

            StateUpdate();
        }
Пример #21
0
        private void Button4_Click(object sender, EventArgs e)
        {
            CacheManagement.Start();

            string message = "Temporary folder is changed.\n\n" +
                             "But the temporary folder will be deleted when you restart.\n" +
                             "So, we recommend scheduler registration that works automatically at system startup.\n\n" +
                             "Would you like to register?";

            if (Scheduler.isRegistered == false)
            {
                if (MessageBox.Show(message, "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
                {
                    Scheduler.Register();
                    StateUpdate();
                }
            }
        }
Пример #22
0
        public JsonResult SaveTempFile(HttpPostedFileBase file, string configUniqueName)
        {
            DateTime?lastCheck = (DateTime?)CacheManagement.Get(_cacheName);

            if (!lastCheck.HasValue || DateTime.UtcNow > lastCheck.Value.AddDays(1))
            {
                CacheManagement.Add(_cacheName, DateTime.UtcNow, DateTime.UtcNow.AddDays(1));
                FileHelper.DeleteOldFilesFromTempFolder();
            }

            var config = FileUploadDefinitions.GetByUniqueName(configUniqueName);

            if (config == null)
            {
                throw new HttpException(400, "Invalid config");
            }

            FileWriterResponse response = FileHelper.SaveFileToTempFolder(config, file);

            return(Json(FileUploadResponseModel.FromFileWriterResponse(response)));
        }
Пример #23
0
 public List <Products> Get()
 {
     return(CacheManagement.GetListProducts());
 }
Пример #24
0
 public CargosBL()
 {
     cache = new CacheManagement();
 }
 public List <ProductCategories> Get()
 {
     return(CacheManagement.GetListProductCategories());
 }
Пример #26
0
 public EmpleadosBL()
 {
     cache = new CacheManagement();
 }
Пример #27
0
 public TiposTelefonosBL()
 {
     cache = new CacheManagement();
 }
Пример #28
0
 public TiposDocumentosBL()
 {
     cache = new CacheManagement();
 }