//Constructor public MeasureController() { UnitOfWork unitOfWork = new UnitOfWork(); this._measureRepository = new MeasureRepository(unitOfWork); this._caching = new CacheManagement(); }
public TraineeController() { UnitOfWork unitOfWork = new UnitOfWork(); this._ITrainingScheduleUserRepository = new TrainingScheduleUserRepository(unitOfWork); this._caching = new CacheManagement(); }
public LoginController() { UnitOfWork _unitOfWork = new UnitOfWork(); this._IUserRepository = new UserRepository(_unitOfWork); this._ISecurityQuestionRepository = new SecurityQuestionRepository(_unitOfWork); this._caching = new CacheManagement(); }
public TrainingController() { UnitOfWork unitOfWork = new UnitOfWork(); this._ITrainingRepository = new TrainingRepository(unitOfWork); this._ITrainingMaterialRepository = new TrainingMaterialRepository(unitOfWork); this._caching = new CacheManagement(); }
public IHttpActionResult Delete(int id) { if (_iProductsBusiness.Delete(id)) { CacheManagement.RemoveProducts(); return(Ok()); } return(NotFound()); }
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(); }
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(); }
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)); }
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(); }
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; } }
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()); }
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)); }
public IHttpActionResult Post(Products model) { if (ModelState.IsValid) { if (_iProductsBusiness.Insert(model)) { CacheManagement.RemoveProducts(); return(Ok()); } return(NotFound()); } return(BadRequest(ModelState)); }
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)); }
// 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); }
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(); }
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(); } } }
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))); }
public List <Products> Get() { return(CacheManagement.GetListProducts()); }
public CargosBL() { cache = new CacheManagement(); }
public List <ProductCategories> Get() { return(CacheManagement.GetListProductCategories()); }
public EmpleadosBL() { cache = new CacheManagement(); }
public TiposTelefonosBL() { cache = new CacheManagement(); }
public TiposDocumentosBL() { cache = new CacheManagement(); }