public EmployeeDetailController(MasterRepository repository, AnnualLogRepository repository02, IHttpContextAccessor httpContextAccessor) : base(httpContextAccessor) { this.Repository = repository; this.aRepository = repository02; this.loginFn = new loginFunction(repository); }
public PipelineRunnerService(MasterRepository masterRepository, IMerchantDetailsLoader merchantDetailsLoader, IServiceProvider serviceProvider, ISchemaLoader schemaLoader) { this.masterRepository = masterRepository; this.merchantDetailsLoader = merchantDetailsLoader; this.serviceProvider = serviceProvider; this.schemaLoader = schemaLoader; }
public TestMasterRepository() { createdDirectories = new List<string>(); updatedDirectories = new List<string>(); deletedDirectories = new List<string>(); movedDirectories = new List<string>(); createdPages = new List<string>(); updatedPages = new List<string>(); deletedPages = new List<string>(); movedPages = new List<string>(); watcher = new TestSourceWatcher(); repository = new MasterRepository(".md"); // setup event handlers repository.DirectoryAdded += (source, args) => { createdDirectories.Add(args.SourcePath); }; repository.DirectoryUpdated += (source, args) => { updatedDirectories.Add(args.SourcePath); }; repository.DirectoryDeleted += (source, args) => { deletedDirectories.Add(args.SourcePath); }; repository.DirectoryMoved += (source, args) => movedDirectories.Add(args.SourcePath); repository.PageAdded += (source, args) => { createdPages.Add(args.SourcePath); }; repository.PageUpdated += (source, args) => { updatedPages.Add(args.SourcePath); }; repository.PageDeleted += (source, args) => { deletedPages.Add(args.SourcePath); }; repository.PageMoved += (source, args) => { movedPages.Add(args.SourcePath); }; // create list of files IList<string> markdownFiles = new List<string> { Path.Combine(".", "index.md"), Path.Combine(".", "subdir1", "subdir2", "index.md") }; // initialise the model (should fire events the same as addition) repository.Init(watcher, ".", Path.Combine(".", "somewikipath"), markdownFiles); }
private List <SelectListItem> GetDeptToList() { List <SelectListItem> SelectGroupListItems = new List <SelectListItem>(); MasterRepository MasterRepository = new MasterRepository(); var colRoleSelectList = MasterRepository.GetDept(); SelectGroupListItems.Add( new SelectListItem { Text = "PILIH DEPARTEMEN", Value = "0" }); foreach (var item in colRoleSelectList) { SelectGroupListItems.Add( new SelectListItem { Text = item.Text.ToString(), Value = item.Value.ToString() }); } return(SelectGroupListItems); }
private List <SelectListItem> GetAllPartnerAsSelectList() { List <SelectListItem> SelectGroupListItems = new List <SelectListItem>(); MasterRepository MasterRepository = new MasterRepository(); var colRoleSelectList = MasterRepository.GetPartner();; SelectGroupListItems.Add( new SelectListItem { Text = "Select", Value = "0" }); foreach (var item in colRoleSelectList) { SelectGroupListItems.Add( new SelectListItem { Text = item.Text.ToString(), Value = item.Value.ToString() }); } return(SelectGroupListItems); }
public ViewModelLocator() { ServiceLocator.SetLocatorProvider(() => SimpleIoc.Default); _master = new MasterRepository(); SimpleIoc.Default.Register(_master.GetRepository <Bank_Account>); SimpleIoc.Default.Register(_master.GetRepository <Contact>); SimpleIoc.Default.Register(_master.GetRepository <Customer>); SimpleIoc.Default.Register(_master.GetRepository <Department>); SimpleIoc.Default.Register(_master.GetRepository <Employee>); SimpleIoc.Default.Register(_master.GetRepository <Event>); SimpleIoc.Default.Register(_master.GetRepository <ID>); SimpleIoc.Default.Register(_master.GetRepository <Inlogdata>); SimpleIoc.Default.Register(_master.GetRepository <Inspector>); SimpleIoc.Default.Register(_master.GetRepository <Inspector_shedule>); SimpleIoc.Default.Register(_master.GetRepository <Invoice>); SimpleIoc.Default.Register(_master.GetRepository <Payment_status>); SimpleIoc.Default.Register(_master.GetRepository <Planning>); SimpleIoc.Default.Register(_master.GetRepository <Question>); SimpleIoc.Default.Register(_master.GetRepository <Questionnaire>); SimpleIoc.Default.Register(_master.GetRepository <Quotation>); SimpleIoc.Default.Register(_master.GetRepository <StandardQuestion>); SimpleIoc.Default.Register(_master.GetRepository <StandardQuestionsList>); SimpleIoc.Default.Register <MainViewModel>(); SimpleIoc.Default.Register <TestViewModel>(); SimpleIoc.Default.Register <TestOtherViewModel>(); }
public UnitOfWork(ApplicationContext context) { _context = context; Masters = new MasterRepository(_context); Regions = new RegionRepository(_context); MasterRegions = new MasterRegionRepository(_context); }
public async Task Get() { var result = await MasterRepository.GetAsync(1, 20); var records = BsonSerializer.Deserialize <IEnumerable <MasterGetViewModel> >(result.Item1.ToJson()); Console.WriteLine($"Output:Total:{result.Item2}\nRecords:{JToken.Parse(JsonConvert.SerializeObject(records)).ToString(Formatting.Indented)}"); }
public AnnualLogController(AnnualLogRepository repository, ExportXlsxRepository repository02, MasterRepository repository03, IHttpContextAccessor httpContextAccessor ) : base(httpContextAccessor) { this.aRepository = repository; this.eRepository = repository02; this.mRepository = repository03; }
public static MasterRepository CreateStubRepo() { var repo = new MasterRepository( SQLiteDatabase.CreateInMemoryRepository(), new SvnRepository(new StubSvnClient()), InMemoryIssueRepository.CreateIssueRepository()); return repo; }
//[TestMethod] public async Task Find() { var builder = Builders <BsonDocument> .Filter; var collectionFilter = builder.Eq("CollectionId", "799ac8f9b9a845568ab77c3dc9a32f6b"); var result = await MasterRepository.FindAsync(collectionFilter); var record = BsonSerializer.Deserialize <MasterGetViewModel>(result.ToJson()); Console.WriteLine($"Output:{JToken.Parse(JsonConvert.SerializeObject(record)).ToString(Formatting.Indented)}"); }
public WikiSite(WikiConfig config, MasterRepository masterRepository, ISourceWatcher sourceWatcher, IPageCache pageCache) { wikiConfig = config; repository = masterRepository; watcher = sourceWatcher; generator = new WikiGenerator(wikiConfig.Convertor, wikiConfig.RootWikiPath, pageCache); siteGeneratorScheduler = new EventLoopScheduler(threadStart => new Thread(threadStart) { Name = "SiteGenerator" }); }
// GET: Home public ActionResult Index() { IngRepository ingRepository = new IngRepository(); LicRepository licRepository = new LicRepository(); MasterRepository masterRepository = new MasterRepository(); TecRepository tecRepository = new TecRepository(); var objMultipleModels = new Tuple <IEnumerable <SelectListItem>, IEnumerable <SelectListItem>, IEnumerable <SelectListItem>, IEnumerable <SelectListItem> >(ingRepository.GetAllIng(), licRepository.GetAllLic(), masterRepository.GetAllMaster(), tecRepository.GetAllTec()); return(View(objMultipleModels)); }
public AdminFnController(AdminFnRepository a_repository, MasterRepository m_repository, PunchCardRepository p_repository, AnnualLeaveRepository al_repository, ApplyOvertimeRepository ap_repository, IHttpContextAccessor httpContextAccessor) : base(httpContextAccessor) { this.aRepository = a_repository; this.mRepository = m_repository; this.pRepository = p_repository; this.chkWarn = new ChkPunchLogWarn(p_repository, httpContextAccessor); this.calTime = new CalWorkTime(p_repository, ap_repository, httpContextAccessor); this.calAnnual = new CalAnnualLeave(al_repository); }
static void Main(string[] args) { var master = new MasterRepository(); var employeeRepository = master.GetRepository <Employee>(); var employeeList = employeeRepository.Get(); var firstEmployee = employeeList.First(); firstEmployee.name = "Kees"; employeeRepository.Update(firstEmployee); }
public NoAdsHereUnit(NoAdsHereContext context) { _context = context; Masters = new MasterRepository(_context); Settings = new SettingsRepository(_context); Blocks = new BlockRepository(_context); Ignores = new IgnoreRepository(_context); Penalties = new PenaltyRepository(_context); Violators = new ViolatorRepository(_context); Statistics = new StatisticRepository(_context); Faqs = new FaqRepository(_context); }
public ActionResult Create(CarDiamention model) { if (ModelState.IsValid) { MasterRepository repo = new MasterRepository(); repo.SaveCarDiamention(model); return(RedirectToAction("Create")); } else { return(View(model)); } }
public JsonResult GetPartner(string Id) { MasterRepository MasterRepository = new MasterRepository(); var result = MasterRepository.GetDetailById(Id); if (result != null) { return(new JsonResult { Data = result[0], JsonRequestBehavior = JsonRequestBehavior.AllowGet }); } return(null); }
public ProvisioningService( MasterRepository masterRepository, PushIdentityDbContext dbContext, IdentityUserManager userManager, IdentityRoleManager roleManager, IPushLogger logger) { _masterRepository = masterRepository; _dbContext = dbContext; _userManager = userManager; _roleManager = roleManager; _logger = logger; }
public async Task GetByKeys() { Dictionary <string, object> keyValuePairs = new Dictionary <string, object> { { "Client", 1 } }; var result = await MasterRepository.GetAsync(1, 20, keyValuePairs); var records = BsonSerializer.Deserialize <IEnumerable <MasterGetViewModel> >(result.Item1.ToJson()); Console.WriteLine($"Output:Total:{result.Item2}\nRecords:{JToken.Parse(JsonConvert.SerializeObject(records)).ToString(Formatting.Indented)}"); }
public ActionResult Create(CarVideos model) { if (ModelState.IsValid) { model.vidURL = model.vidURL.Replace("https://youtu.be/", "https://www.youtube.com/embed/"); MasterRepository repo = new MasterRepository(); repo.SaveCarVideo(model); return(RedirectToAction("Create")); } else { return(View(model)); } }
public async Task GetByDefinition() { var builder = Builders <BsonDocument> .Filter; var clientFilter = builder.Eq("Client", 1); var catererFilter = builder.Eq("Caterer", 1); var filter = clientFilter & catererFilter; var result = await MasterRepository.GetAsync(1, 20, filter); var records = BsonSerializer.Deserialize <IEnumerable <MasterGetViewModel> >(result.Item1.ToJson()); Console.WriteLine($"Output:Total:{result.Item2}\nRecords:{JToken.Parse(JsonConvert.SerializeObject(records)).ToString(Formatting.Indented)}"); }
public HttpResponseMessage Get(string id) { try { iRecruit.Entity.Indent ind = this._repo.GetIndent(id); string user = iRecruit.Security.Extensions.FetchUserFromRequestHeader(this.ActionContext); DepartmentRoles roles = new MasterRepository().GetDepartmentRoles().Where(f => f.BranchID.Equals(ind.BranchID) && f.DepartmentID.Equals(ind.DepartmentID)).FirstOrDefault(); IndentModel model = new IndentModel() { Indent = ind, DisableIndenterAccess = 1, DisableFHAccess = 1, DisableSVPAccess = 1 }; if ((ind.AssignedTo ?? "").Length == 0 && (ind.CreatedBy ?? "").Equals(user)) { model.DisableIndenterAccess = 0; } if (roles != null) { if ((roles.FunctionHead ?? "").Equals(user)) { model.DisableFHAccess = 0; } if ((roles.SVP ?? "").Equals(user)) { model.DisableSVPAccess = 0; } } // build jd path string filePath = ind.UploadFile_Indents ?? ""; if (!string.IsNullOrWhiteSpace(filePath)) { string f = filePath.Substring(filePath.LastIndexOf("\\") + 1); model.JDUrl = "/JobDescriptions/" + ind.IndentNumber + "/" + f; //Request.GetRequestContext().VirtualPathRoot + } HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK, model); return(response); } catch (Exception ex) { _tracer.Error(Request, this.ControllerContext.ControllerDescriptor.ControllerType.FullName, ex.StackTrace); return(new HttpResponseMessage(HttpStatusCode.InternalServerError) { Content = new StringContent(ex.Message) }); } }
public IRepository <TEntity> GetRepository <TEntity>() where TEntity : BaseEntity, IMasterEntity { if (_repositories == null) { _repositories = new Dictionary <Type, object>(); } var type = typeof(TEntity); if (!_repositories.ContainsKey(type)) { _repositories[type] = new MasterRepository <TEntity>(this); } return((IRepository <TEntity>)_repositories[type]); }
public bool TryGetMasterRepository(string siteName, out MasterRepository value) { string safeName = CreateSafeName(siteName); Tuple<WikiConfig, MasterRepository, IPageCache> tuple; if (configMap.TryGetValue(siteName, out tuple)) { value = tuple.Item2; return true; } else { value = null; return false; } }
// Controllers // GET: /User/ //[Authorize(Roles = "Administrator")] #region public ActionResult Index(string searchStringUserNameOrEmail) public ActionResult Index() { try { MasterRepository MasterRepository = new MasterRepository(); var Result = MasterRepository.GetListUsers(""); return(View(Result)); } catch (Exception ex) { ModelState.AddModelError(string.Empty, "Error: " + ex); List <ExpandedUserDTO> Result = new List <ExpandedUserDTO>(); return(View(Result)); } }
public bool TryGetMasterRepository(string siteName, out MasterRepository value) { string safeName = CreateSafeName(siteName); Tuple <WikiConfig, MasterRepository, IPageCache> tuple; if (configMap.TryGetValue(siteName, out tuple)) { value = tuple.Item2; return(true); } else { value = null; return(false); } }
public HttpResponseMessage Get(int id, string search, string type) // type = 3 { try { List <iRecruit.Entity.Indent> res = this._repo.GetIndents(id); if (!string.IsNullOrWhiteSpace(search)) { if (!string.IsNullOrWhiteSpace(type)) { iRecruit.Entity.Type t = new MasterRepository().GetType(7, type); if (!string.IsNullOrWhiteSpace(search)) { res = res.FindAll(f => f.IndentNumber.ToUpper().Contains(search.ToUpper()) && f.Indent_Status == t.TypeID); } } else { res = res.FindAll(f => f.IndentNumber.ToUpper().Contains(search.ToUpper())); } } List <AutoCompleteResults> dic = new List <AutoCompleteResults>(); foreach (iRecruit.Entity.Indent result in res) { dic.Add(new AutoCompleteResults() { value = result.IndentNumber, label = result.IndentID.ToString() }); } HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK, dic); return(response); } catch (Exception ex) { _tracer.Error(Request, this.ControllerContext.ControllerDescriptor.ControllerType.FullName, ex.StackTrace); return(new HttpResponseMessage(HttpStatusCode.InternalServerError) { Content = new StringContent(ex.Message) }); } }
public InstanceContext( MasterRepository systemRepository, ProcessPersistContext processPersistContext, MiscPersistContext miscPersistContext, CredentialsRepository connectionRepository, SettingsRepository settingsRepository, ShopifyHttpContext shopifyHttpContext, StateRepository stateRepository, AcumaticaHttpContext acumaticaHttpContext) { _connectionRepository = connectionRepository; _settingsRepository = settingsRepository; _systemRepository = systemRepository; _processPersistContext = processPersistContext; _miscPersistContext = miscPersistContext; _shopifyHttpContext = shopifyHttpContext; _stateRepository = stateRepository; _acumaticaHttpContext = acumaticaHttpContext; }
public IdentityService( MasterRepository masterRepository, PushIdentityDbContext dbContext, IdentityUserManager userManager, IdentityRoleManager roleManager, IdentitySignInManager signInManager, InstanceContext instanceContext, StateRepository stateRepository, IPushLogger logger, ShopifyUrlService shopifyUrlService) { _masterRepository = masterRepository; _dbContext = dbContext; _userManager = userManager; _roleManager = roleManager; _signInManager = signInManager; _instanceContext = instanceContext; _stateRepository = stateRepository; _logger = logger; _shopifyUrlService = shopifyUrlService; }
// Example for HangFire Recuring Jobs public static async Task RecurringJobTestHangFire_Master() { try { Console.WriteLine("RecurringJobTestHangFire_Master Running.. at " + DateTime.Now.ToString() + " " + TimeZoneInfo.Local.ToString()); var repSync = new MasterRepository(UtilsProvider.HostingEnvironment, UtilsProvider.Config); await repSync.TanonchaiJobSample(); } catch (Exception ex) { while (ex.InnerException != null) { ex = ex.InnerException; } var ilog = UtilsProvider.ApplicationLogging.CreateLogger <Startup>(); ilog.LogError("RecurringJobDaily_Master Error :: " + ex.Message); throw ex; } }
public PropertyRoot LoadStructure(Assembly assembly, Type projectType, Project[] dependencies) { if (!projectType.IsPublic && !projectType.IsNestedPublic) { throw new ArgumentException($"プロジェクト型 {projectType.FullName} がパブリックではありませんでした。", nameof(projectType)); } subtypes = GetSubtypes(assembly.GetTypes()); // マスターの情報を取得 var masterMembers = projectType.GetMembers(); var properties = GetMastersProperties(masterMembers); var masterinfo = properties.Where(x => x.info.PropertyType.IsArray) .Select(GetMasterinfo) .ToArray(); masters = GetReferencableMasters(masterinfo); // 依存関係先のマスター・グローバル情報を取得 var dependencyMasters = from p in dependencies from q in p.Factory.Masters select(key : p.Root.Value.Type.Name + "." + q.Key, value : q.Value); dependencyMasters.ForEach(x => masters[x.key] = x.value); readonlyMasters = new ReadOnlyMasterRepository(masters); isLoaded = true; // グローバルの情報を取得 var globals = from p in properties where !p.info.PropertyType.IsArray select GetMasterinfo(p); var models = globals.Concat(masterinfo).ToArray(); return(new PropertyRoot(projectType, models)); }
public BaseService() { _rep = new MasterRepository(); }
public TasksController(MasterRepository masterRepository) { this.masterRepository = masterRepository; }