Beispiel #1
0
        public async Task <ActionResult> Create(SecondaryDoctor secondaryDoctor)
        {
            if (HelperExtensions.isAllowedforEditingorAdd(secondaryDoctor.PatientId, CategoryCycleStatusHelper.GetPatientNewOrOldCycleByCategory(secondaryDoctor.PatientId, BillingCodeHelper.cmmBillingCatagoryid), User.Identity.GetUserId()) == false)
            {
                return(RedirectToAction("Index", "CcmStatus", new { status = HelperExtensions.GetStatusRedirectionbyUser(User.Identity.GetUserId()), Message = "Cycle is locked." }));
            }
            if (ModelState.IsValid)
            {
                _db.SecondaryDoctors.Add(secondaryDoctor);
                await _db.SaveChangesAsync();

                return(RedirectToAction("Index", new { patientId = secondaryDoctor.PatientId }));
            }

            return(View(secondaryDoctor));
        }
Beispiel #2
0
        public async Task <string> _Create(SecondaryDoctor secondaryDoctor)
        {
            if (HelperExtensions.isAllowedforEditingorAdd(secondaryDoctor.PatientId, CategoryCycleStatusHelper.GetPatientNewOrOldCycleByCategory(secondaryDoctor.PatientId, BillingCodeHelper.cmmBillingCatagoryid), User.Identity.GetUserId()) == false)
            {
                //return RedirectToAction("Index", "CcmStatus", new { status = HelperExtensions.GetStatusRedirectionbyUser(User.Identity.GetUserId()), Message = "Cycle is locked." });
                return("Cycle is locked.");
            }
            if (ModelState.IsValid)
            {
                secondaryDoctor.CreatedOn = DateTime.Now;
                secondaryDoctor.CreatedBy = User.Identity.GetUserId();
                secondaryDoctor.Status    = true;


                _db.SecondaryDoctors.Add(secondaryDoctor);
                await _db.SaveChangesAsync();

                return("True");
                //return RedirectToAction("Index", new { patientId = secondaryDoctor.PatientId });
            }

            return("False");
            //return View(secondaryDoctor);
        }