public AccountController( UserManager <ApplicationUser> userManager, SignInManager <ApplicationUser> signInManager, ILoggerFactory loggerFactory, ApplicationDbContext db, WebNutContext context) { _userManager = userManager; _signInManager = signInManager; _logger = loggerFactory.CreateLogger <AccountController>(); _db = db; _context = context; }
public ImplementerController(WebNutContext context) { _context = context; }
public hfstatusController(WebNutContext context) { _context = context; }
public ChecksController(WebNutContext db, ApplicationDbContext App) { _db = db; _app = App; }
public msForm(WebNutContext context, UserManager <ApplicationUser> userManager) { _context = context; _userManager = userManager; }
public ImportController(IHostingEnvironment env, WebNutContext context) { this.hostingEnv = env; _context = context; }
public FacilityTypesController(WebNutContext context) { _context = context; }
public DashboardController(WebNutContext db) { _db = db; }
public ProvinceController(WebNutContext context) { _context = context; }
public TlkpIycfsController(WebNutContext context) { _context = context; }
public FeedbackController(WebNutContext context) { _context = context; }
public TlkpOtptfusController(WebNutContext context) { _context = context; }
public mamViewController(WebNutContext context) { _context = context; }
public BnaqController(WebNutContext context) { _context = context; }
public async static void Initialize(WebNutContext db, RoleManager <IdentityRole> _roleManager, UserManager <ApplicationUser> _userManager) { db.Database.EnsureCreated(); // Look for any students. if (db.TblkpStatus.Any() || db.LkpHfstatus.Any() || _roleManager.Roles.Any() || _userManager.Users.Any()) { return; // DB has been seeded } var stats = new TblkpStatus[] { new TblkpStatus { StatusId = 1, StatusDescription = "Insert" }, new TblkpStatus { StatusId = 2, StatusDescription = "Update" }, new TblkpStatus { StatusId = 3, StatusDescription = "Accept" }, new TblkpStatus { StatusId = 4, StatusDescription = "Reject" }, }; foreach (TblkpStatus s in stats) { db.TblkpStatus.Add(s); } db.SaveChanges(); var hfstats = new LkpHfstatus[] { new LkpHfstatus { HfactiveStatusId = 1, HfstatusDescription = "Open" }, new LkpHfstatus { HfactiveStatusId = 2, HfstatusDescription = "Close" }, new LkpHfstatus { HfactiveStatusId = 3, HfstatusDescription = "Closed-no supply" }, new LkpHfstatus { HfactiveStatusId = 4, HfstatusDescription = "Closed-Security" }, }; foreach (LkpHfstatus s in hfstats) { db.LkpHfstatus.Add(s); } db.SaveChanges(); var AgeGroups = new TlkpOtptfu[] { new TlkpOtptfu { Active = true, AgeGroup = "<6 month" }, new TlkpOtptfu { Active = true, AgeGroup = "6-23 Months" }, new TlkpOtptfu { Active = true, AgeGroup = "24-59 Months" }, new TlkpOtptfu { Active = true, AgeGroup = "total" }, }; foreach (TlkpOtptfu s in AgeGroups) { db.TlkpOtptfu.Add(s); } db.SaveChanges(); var MamAgeGroups = new TlkpSfp[] { new TlkpSfp { Active = true, AgeGroup = "Children 6-23 months" }, new TlkpSfp { Active = true, AgeGroup = "Children 24-59 months" }, new TlkpSfp { Active = true, AgeGroup = "Lactating women" }, new TlkpSfp { Active = true, AgeGroup = "Pregnant women" }, new TlkpSfp { Active = true, AgeGroup = "total children" }, new TlkpSfp { Active = true, AgeGroup = "total women" }, }; foreach (TlkpSfp s in MamAgeGroups) { db.TlkpSfp.Add(s); } db.SaveChanges(); var mnItems = new TlkpMn[] { new TlkpMn { Mnid = 1, Active = true, Mnitems = "Vit A Capsule (200000,100000 or 50000IU)" }, new TlkpMn { Mnid = 2, Active = true, Mnitems = "IFA (60mg Iron, 400Micogram Folic) Tab" }, new TlkpMn { Mnid = 3, Active = true, Mnitems = "Ferrous Sulfate drop/syrop " }, new TlkpMn { Mnid = 4, Active = true, Mnitems = "Ferrous Sulfate 200mg(base 60mg)" }, new TlkpMn { Mnid = 5, Active = true, Mnitems = "Folic Acid 1 mg Tab" }, new TlkpMn { Mnid = 6, Active = true, Mnitems = "Multiple Micronutrients Tablet" }, new TlkpMn { Mnid = 7, Active = true, Mnitems = "Multiple Micronutrients Powder" }, new TlkpMn { Mnid = 8, Active = true, Mnitems = "Zinc Tab or Syrup/Drop + ORS" }, new TlkpMn { Mnid = 9, Active = true, Mnitems = "Mebendasol Tab" }, }; foreach (TlkpMn s in mnItems) { db.TlkpMn.Add(s); } db.SaveChanges(); IdentityRole Role = new IdentityRole(); Role.NormalizedName = "ADMINISTRATOR"; Role.Name = "administrator"; await _roleManager.CreateAsync(Role); IdentityRole Role2 = new IdentityRole(); Role2.NormalizedName = "DATAENTRY"; Role2.Name = "dataentry"; await _roleManager.CreateAsync(Role2); IdentityRole Role3 = new IdentityRole(); Role3.NormalizedName = "GUEST"; Role3.Name = "guest"; await _roleManager.CreateAsync(Role3); var user = new ApplicationUser { UserName = "******", PhoneNumber = "99999999", FirstName = "admin", LastName = "admin", Email = "*****@*****.**", Position = "admin", Active = true, TenantId = 1 }; var result = await _userManager.CreateAsync(user, "159*951-Aa"); if (result.Succeeded) { await _userManager.AddClaimAsync(user, new System.Security.Claims.Claim("super_admin", "1")); await _userManager.AddToRoleAsync(user, "administrator"); } }
public SamoutController(WebNutContext context) { _context = context; }
public NmrController(WebNutContext context, ILoggerFactory loggerFactory, UserManager <ApplicationUser> userManager) { _logger = loggerFactory.CreateLogger <NmrController>(); _context = context; _userManager = userManager; }
public TlkpFstocksController(WebNutContext context) { _context = context; }
public samoutformController(WebNutContext context, IMapper mapper, UserManager <ApplicationUser> userManager) { _context = context; _mapper = mapper; _userManager = userManager; }
public FacilityInfoController(WebNutContext context) { _context = context; }
public TblMnsController(WebNutContext context) { _context = context; }
public TenantsController(WebNutContext context) { _context = context; }
public TlkpSfpsController(WebNutContext context) { _context = context; }
public ExportController(WebNutContext context, UserManager <ApplicationUser> userManager) { _context = context; _userManager = userManager; }
public DistrictsController(WebNutContext context) { _context = context; }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, WebNutContext context, RoleManager <IdentityRole> _roleManager, UserManager <ApplicationUser> _userManager) { loggerFactory.AddConsole(Configuration.GetSection("Logging")); loggerFactory.AddDebug(); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); app.UseDatabaseErrorPage(); app.UseBrowserLink(); } else { app.UseExceptionHandler("/Home/Error"); } app.UseStatusCodePagesWithReExecute("/StatusCode/{0}"); app.UseStaticFiles(); app.UseIdentity(); app.UseSession(); // Add external authentication middleware below. To configure them please see http://go.microsoft.com/fwlink/?LinkID=532715 app.UseMvc(routes => { routes.MapRoute( name: "default", template: "{controller=Checks}/{action=Index}/{id?}"); }); DbInitializer.Initialize(context, _roleManager, _userManager); }