예제 #1
0
        public async Task <IActionResult> SendMessageModal(AJAXModel_Modal model)
        {
            //
            var objProject = await _PM_ProjectService.GetById(model.idrecord);

            //Lấy danh sách user tham gia dự án
            var objWork = await _PM_WorkService.GetAllByProjectId(model.idrecord);

            var userids = objWork.Select(n => n.UserId).Distinct().ToList();

            var obj = new OneSignalrMessage()
            {
                Description = "",
                Title       = "Nhắc nhở dự án: " + objProject.Title,
                Id          = model.idrecord,
                PlayerIds   = new string[] { },
                View        = "ProjectPage"
            };

            var cus = new OS_MessageModal()
            {
                Data         = obj,
                Data_Modal   = model,
                Select_Users = await Select_User(string.Join(',', userids))
            };

            return(PartialView(cus));
        }
예제 #2
0
        public async Task <IActionResult> ComponentModal(AJAXModel_Modal obj)
        {
            var existed = await _PM_ComponentService.GetById(obj.idrecord);

            if (existed == null)
            {
                existed = new PM_Component()
                {
                    Code        = "",
                    DateCreated = DateTime.Now,
                    DateEnd     = DateTime.Now,
                    DateStart   = DateTime.Now,
                    Description = "",
                    Id          = ObjectId.GenerateNewId().ToString(),
                    Label       = "",
                    Note        = "",
                    ParentId    = "0",
                    ProjectId   = obj.idsub,
                    Status      = 0,
                    Title       = ""
                };
            }

            //Danh sách mẫu
            var model = new PM_ComponentModal()
            {
                Select_ProjectComponents = await Select_ProjectComponent(existed.ProjectId, existed.ParentId),
                Select_ProjectStatus     = Select_ProjectStatus(existed.Status.ToString()),
                Data       = existed,
                Data_Modal = obj
            };

            return(PartialView(model));
        }
예제 #3
0
        public async Task <IActionResult> WorkModal(AJAXModel_Modal model)
        {
            var data = await _PM_WorkService.GetAllByComponentId(model.idrecord);

            var k = data.Select(n => n.UserId);

            var select = string.Join(',', k);

            var dt = new PM_WorkModal()
            {
                Data        = data,
                Select_User = await Select_User(select),
                Data_Modal  = model
            };

            return(PartialView(dt));
        }
예제 #4
0
        public async Task <IActionResult> HomeDiaryModal(AJAXModel_Modal obj)
        {
            var existed = await _WM_DiaryService.GetById(obj.idrecord);

            if (existed == null)
            {
                existed = new WM_Diary()
                {
                    DateCreated = DateTime.Now,
                    Description = "",
                    Id          = ObjectId.GenerateNewId().ToString(),
                    ScheduleId  = obj.idsub,
                    Title       = "",
                };
            }

            var model = new WM_DiaryModel()
            {
                Data       = existed,
                Data_Modal = obj
            };

            return(PartialView(model));
        }