示例#1
0
        public async Task <IActionResult> AddNewFeature(FeatureModel request)
        {
            if (ModelState.IsValid)
            {
                var reulst = await _WorkSVC.CreateFeature(request);

                if (!reulst)
                {
                    ViewBag.ErrorMessage = "ไม่สามารถเพิ่มงานหลักได้ กรุณาตรวจสอบข้อมูล";
                    var qry = await _membershipSVC.GetMemberships(request.Project_id);

                    ViewBag.AssignmentList = qry.Select(it => it.MemberUserName);
                    return(View(request));
                }
                return(RedirectToAction(nameof(Detail), new { id = request.Project_id }));
            }
            else
            {
                ViewBag.ErrorMessage = "ไม่สามารถเพิ่มงานหลักได้ กรุณาตรวจสอบข้อมูล";
                var qry = await _membershipSVC.GetMemberships(request.Project_id);

                ViewBag.AssignmentList = qry.Select(it => it.MemberUserName);
                return(View(request));
            }
        }