Example #1
0
 public AllowancesController(CygateWMSContext context, UserManager <ApplicationUser> userManager, IEmailService emailService, IConfiguration Configuration)
 {
     this.userManager   = userManager;
     _context           = context;
     this.emailService  = emailService;
     this.Configuration = Configuration;
 }
Example #2
0
 public RosterController(CygateWMSContext context, UserManager <ApplicationUser> userManager,
                         IConfiguration configuration, IEmailService emailService)
 {
     this.userManager   = userManager;
     this.context       = context;
     this.emailService  = emailService;
     this.configuration = configuration;
 }
Example #3
0
 public ApplicationUserController(CygateWMSContext context, SignInManager <ApplicationUser> signInManager,
                                  UserManager <ApplicationUser> userManager, RoleManager <ApplicationRole> roleManager, IEmailService emailService)
 {
     this._context      = context;
     this.signInManager = signInManager;
     this.userManager   = userManager;
     this.roleManager   = roleManager;
     this.emailService  = emailService;
 }
Example #4
0
 public AllowanceTypesController(CygateWMSContext context)
 {
     _context = context;
 }
Example #5
0
 public ReportsController(CygateWMSContext context, UserManager <ApplicationUser> userManager)
 {
     _context         = context;
     this.userManager = userManager;
 }
Example #6
0
 public DashboardController(CygateWMSContext context, UserManager <ApplicationUser> userManager)
 {
     this.context     = context;
     this.userManager = userManager;
 }
Example #7
0
 public ApplicationRoleController(CygateWMSContext context, RoleManager <ApplicationRole> roleManager)
 {
     this._context    = context;
     this.roleManager = roleManager;
 }
Example #8
0
 public CategoryController(CygateWMSContext context)
 {
     _context = context;
 }
Example #9
0
 public PreviewViewComponent(CygateWMSContext context, UserManager <ApplicationUser> userManager)
 {
     this.context     = context;
     this.userManager = userManager;
 }
Example #10
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, Microsoft.Extensions.Logging.ILoggerFactory loggerFactory, CygateWMSContext context)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            if (env.IsProduction() || env.IsStaging() || env.IsEnvironment("Staging_2"))
            {
                app.UseExceptionHandler("/Error");
                app.UseHsts();
            }


            //app.UseExceptionHandler("/Home/Error");
            app.UseAuthentication();
            app.UseStaticFiles();
            app.UseCookiePolicy();
            app.UseSession();
            //app.UseStatusCodePagesWithRedirects("/Home/Error");
            app.UseMvc(routes =>
            {
                routes.MapRoute(
                    name: "default",
                    template: "{controller=Account}/{action=Login}/{id?}");
            });
            DbInitializer.Initialize(context);
        }
Example #11
0
        public static void Initialize(CygateWMSContext context)
        {
            context.Database.EnsureCreated(); //if it(your database) doesn't exist ,it will be created
            context.Database.Migrate();

            //Roles
            if (!context.Roles.Any())
            {
                context.Roles.Add(new ApplicationRole()
                {
                    Name = Constants.ADMIN, NormalizedName = Constants.ADMIN, CreatedDate = DateTime.Now, IsActive = true, Description = "Admin"
                });
                context.Roles.Add(new ApplicationRole()
                {
                    Name = Constants.USER, NormalizedName = Constants.USER, CreatedDate = DateTime.Now, IsActive = true, Description = "User"
                });
                context.Roles.Add(new ApplicationRole()
                {
                    Name = Constants.TL, NormalizedName = Constants.TL, CreatedDate = DateTime.Now, IsActive = true, Description = "Team Leader"
                });
                context.SaveChanges();
            }
            //Category
            if (!context.Category.Any())
            {
                context.Category.Add(new Category()
                {
                    CategoryName = Constants.LINUX, CreatedOn = DateTime.Now, IsActive = true
                });
                context.Category.Add(new Category()
                {
                    CategoryName = Constants.WINDOWS, CreatedOn = DateTime.Now, IsActive = true
                });
                context.Category.Add(new Category()
                {
                    CategoryName = Constants.VMWARE, CreatedOn = DateTime.Now, IsActive = true
                });
                context.Category.Add(new Category()
                {
                    CategoryName = Constants.NETWORKING, CreatedOn = DateTime.Now, IsActive = true
                });
                context.Category.Add(new Category()
                {
                    CategoryName = Constants.ADMIN, CreatedOn = DateTime.Now, IsActive = true
                });
                context.Category.Add(new Category()
                {
                    CategoryName = Constants.PROCUREMENT, CreatedOn = DateTime.Now, IsActive = true
                });
                context.Category.Add(new Category()
                {
                    CategoryName = Constants.DEVELOPMENT, CreatedOn = DateTime.Now, IsActive = true
                });
                context.Category.Add(new Category()
                {
                    CategoryName = Constants.FINANCE, CreatedOn = DateTime.Now, IsActive = true
                });
                context.SaveChanges();
            }
            //Type
            if (!context.Type.Any())
            {
                context.Type.Add(new Models.Type()
                {
                    TypeName = Constants.ALERT, CreatedOn = DateTime.Now, IsActive = true
                });
                context.Type.Add(new Models.Type()
                {
                    TypeName = Constants.CHAT, CreatedOn = DateTime.Now, IsActive = true
                });
                context.Type.Add(new Models.Type()
                {
                    TypeName = Constants.DOCUMENTATION, CreatedOn = DateTime.Now, IsActive = true
                });
                context.Type.Add(new Models.Type()
                {
                    TypeName = Constants.INCIDENT, CreatedOn = DateTime.Now, IsActive = true
                });
                context.Type.Add(new Models.Type()
                {
                    TypeName = Constants.PHREPORT, CreatedOn = DateTime.Now, IsActive = true
                });
                context.Type.Add(new Models.Type()
                {
                    TypeName = Constants.PROJECTS, CreatedOn = DateTime.Now, IsActive = true
                });
                context.Type.Add(new Models.Type()
                {
                    TypeName = Constants.SCHEDULEDTASK, CreatedOn = DateTime.Now, IsActive = true
                });
                context.Type.Add(new Models.Type()
                {
                    TypeName = Constants.TASK, CreatedOn = DateTime.Now, IsActive = true
                });
                context.Type.Add(new Models.Type()
                {
                    TypeName = Constants.TICKET, CreatedOn = DateTime.Now, IsActive = true
                });
                context.SaveChanges();
            }
            //Shift
            if (!context.Shift.Any())
            {
                context.Shift.Add(new Shift()
                {
                    ShiftName = Constants.GENERAL, CreatedOn = DateTime.Now, IsActive = true
                });
                context.Shift.Add(new Shift()
                {
                    ShiftName = Constants.SHIFT_A, CreatedOn = DateTime.Now, IsActive = true
                });
                context.Shift.Add(new Shift()
                {
                    ShiftName = Constants.SHIFT_B, CreatedOn = DateTime.Now, IsActive = true
                });
                context.Shift.Add(new Shift()
                {
                    ShiftName = Constants.SHIFT_C, CreatedOn = DateTime.Now, IsActive = true
                });
                context.SaveChanges();
            }
            //onCallEscalates
            if (!context.onCallEscalates.Any())
            {
                context.onCallEscalates.Add(new OnCallEscalate()
                {
                    OnCallEscalateName = Constants.NO, CreatedOn = DateTime.Now, IsActive = true
                });
                context.onCallEscalates.Add(new OnCallEscalate()
                {
                    OnCallEscalateName = Constants.YES_INDIA, CreatedOn = DateTime.Now, IsActive = true
                });
                context.onCallEscalates.Add(new OnCallEscalate()
                {
                    OnCallEscalateName = Constants.YES_SWEDEN, CreatedOn = DateTime.Now, IsActive = true
                });
                context.SaveChanges();
            }
            //onCallEscalates
            if (!context.AllowanceType.Any())
            {
                context.AllowanceType.Add(new AllowanceType()
                {
                    AllowanceTypeName = Constants.HOLIDAY, AllowanceTypePrice = 1250, CreatedOn = DateTime.Now, IsActive = true
                });
                context.AllowanceType.Add(new AllowanceType()
                {
                    AllowanceTypeName = Constants.NIGHT, AllowanceTypePrice = 400, CreatedOn = DateTime.Now, IsActive = true
                });
                context.SaveChanges();
            }
            //ShiftRoster
            if (!context.RosterShifts.Any())
            {
                context.RosterShifts.Add(new RosterShift()
                {
                    RosterShiftName = Constants.A, CreatedOn = DateTime.Now, IsActive = true
                });
                context.RosterShifts.Add(new RosterShift()
                {
                    RosterShiftName = Constants.B, CreatedOn = DateTime.Now, IsActive = true
                });
                context.RosterShifts.Add(new RosterShift()
                {
                    RosterShiftName = Constants.C, CreatedOn = DateTime.Now, IsActive = true
                });
                context.RosterShifts.Add(new RosterShift()
                {
                    RosterShiftName = Constants.R, CreatedOn = DateTime.Now, IsActive = true
                });
                context.RosterShifts.Add(new RosterShift()
                {
                    RosterShiftName = Constants.OFF, CreatedOn = DateTime.Now, IsActive = true
                });
                context.RosterShifts.Add(new RosterShift()
                {
                    RosterShiftName = Constants.PL, CreatedOn = DateTime.Now, IsActive = true
                });
                context.RosterShifts.Add(new RosterShift()
                {
                    RosterShiftName = Constants.CL, CreatedOn = DateTime.Now, IsActive = true
                });
                context.RosterShifts.Add(new RosterShift()
                {
                    RosterShiftName = Constants.SL, CreatedOn = DateTime.Now, IsActive = true
                });
                context.SaveChanges();
            }
        }
Example #12
0
 public ShiftsController(CygateWMSContext context)
 {
     _context = context;
 }
Example #13
0
 public ProductsController(CygateWMSContext context, UserManager <ApplicationUser> userManager)
 {
     this._context    = context;
     this.userManager = userManager;
 }
Example #14
0
 public HolidaysController(CygateWMSContext context)
 {
     _context = context;
 }