Beispiel #1
0
        public async Task <IActionResult> SendMessage(
            int roomId,
            string message,
            [FromServices] EmpStoreContext ctx)
        {
            var Message = new Message
            {
                ChatId    = roomId,
                Text      = message,
                Name      = User.Identity.Name,
                Timestamp = DateTime.Now
            };

            ctx.Messages.Add(Message);
            await ctx.SaveChangesAsync();

            await room.Clients.Group(roomId.ToString())
            .SendAsync("RecieveMessage", new
            {
                Text      = Message.Text,
                Name      = Message.Name,
                Timestamp = Message.Timestamp.ToString("dd/MM/yyy hh:mm:ss")
            });

            return(Ok());
        }
Beispiel #2
0
 public Repo4(EmpStoreContext context, UserManager <ApplicationUser> userManager, SignInManager <ApplicationUser> signInManager, IHttpContextAccessor httpContextAccessor)
 {
     _context             = context;
     _userManager         = userManager;
     _signInManager       = signInManager;
     _httpContextAccessor = httpContextAccessor;
 }
 public HomeController(ILogger <HomeController> logger, Repo repo, Repo2 repo2, Repo3 repo3, Repo4 repo4, EmpStoreContext ctx)
 {
     _logger = logger;
     _repo   = repo;
     _repo2  = repo2;
     _repo3  = repo3;
     _repo4  = repo4;
     _ctx    = ctx;
 }
 public EmployeeHomeController(TaskRepo taskRepo, AttendenceRepo attendenceRepo, LeaveRepository leaveRepository, IEmpRepository empRepository, IWebHostEnvironment webHostEnvironment, TimeTrackRepo timeTrackRepo, EmpStoreContext context, Repo4 repo4)
 {
     _timeTrackRepo        = timeTrackRepo;
     _empRepository        = empRepository;
     _webHostEnvironment   = webHostEnvironment;
     _context              = context;
     _leaveRepository      = leaveRepository;
     _attendenceRepository = attendenceRepo;
     _taskRepository       = taskRepo;
     _repo4 = repo4;
 }
Beispiel #5
0
 public CollectionRepository(EmpStoreContext context)
 {
     _context = context;
 }
Beispiel #6
0
 public PostApiController(EmpStoreContext context)
 {
     _context = context;
 }
Beispiel #7
0
 public Repo2(EmpStoreContext context, UserManager <ApplicationUser> userManager, SignInManager <ApplicationUser> signInManager)
 {
     _context       = context;
     _userManager   = userManager;
     _signInManager = signInManager;
 }
 public TimeTrackRepo(EmpStoreContext context)
 {
     _context = context;
 }
 public RoomViewComponent(EmpStoreContext ctx)
 {
     _ctx = ctx;
 }
 public CustomerRepository(EmpStoreContext context)
 {
     _context = context;
 }
Beispiel #11
0
 public Repo3(EmpStoreContext context)
 {
     _context = context;
 }
 public LeaveRepository(EmpStoreContext context)
 {
     _context = context;
 }
Beispiel #13
0
 public BudgetRepository(EmpStoreContext context)
 {
     _context = context;
 }
Beispiel #14
0
 public ProjectRepository(EmpStoreContext context)
 {
     _context = context;
 }
Beispiel #15
0
 public AttendenceRepo(EmpStoreContext context)
 {
     _context = context;
 }
 public DocumentRepository(EmpStoreContext context)
 {
     _context = context;
 }
Beispiel #17
0
 public PreCollectionController(CollectionRepository collectionRepository, ProjectRepository projectRepository, EmpStoreContext context)
 {
     _collectionRepository = collectionRepository;
     _projectRepository    = projectRepository;
     _context = context;
 }
 public TaskRepository(EmpStoreContext context)
 {
     _context = context;
 }
 public JobRepository(EmpStoreContext context)
 {
     _context = context;
 }