public ActionResult EditContract(int Id)
        {
            AGE.CMS.Data.Models.Intake.viewContract contract = new Data.Models.Intake.viewContract();

            contract = CMSService.GetContract(Id);

            return(Json(contract, JsonRequestBehavior.AllowGet));
        }
Beispiel #2
0
        public ActionResult EditContract(int conId)
        {
            viewContract contract = new viewContract();

            contract = CMSService.GetContract(conId);

            if (contract == null)
            {
                contract = new viewContract();
            }

            return(PartialView(contract));
        }
        public ActionResult ViewReferrals(int Id)
        {
            viewDHSReferral viewDHSReferral;

            if (Id != 0)
            {
                viewDHSReferral = CMSService.GetDHSReferrals(Id);

                viewDHSReferral.caselookup     = getcaselookup(username, ViewBag.UserContractId);
                viewDHSReferral.viewCaseHeader = new AGE.CMS.Data.Models.Intake.viewCaseHeader();
                viewDHSReferral.viewCaseHeader = CMSService.GetCaseHeaderById((int)viewDHSReferral.CaseheaderId);
                viewDHSReferral.CaseheaderId   = viewDHSReferral.viewCaseHeader.Id;
            }

            else
            {
                viewDHSReferral             = new viewDHSReferral();
                viewDHSReferral.DateCreated = DateTime.Now;
            }
            var contractid = 0;

            if (viewDHSReferral != null)
            {
                contractid = viewDHSReferral.ContractId;
            }


            if (viewDHSReferral.caselookup.listofcontracts != null && viewDHSReferral.caselookup.listofcontracts.Any() && viewDHSReferral.caselookup.listofcontracts.Count == 1)
            {
                viewDHSReferral.ContractId   = viewDHSReferral.caselookup.listofcontracts.FirstOrDefault().Id;
                viewDHSReferral.ContractName = (from contract in viewDHSReferral.caselookup.listofcontracts where contract.Id == viewDHSReferral.ContractId select contract.ContractName).FirstOrDefault();
            }

            viewDHSReferral.caselookup = getcaselookup(username, ViewBag.UserContractId);

            viewDHSReferral.StatusDescription = CaseStatus.Opened.ToString();

            CMSService.UpdateDHSReferralStatus(Id, viewDHSReferral.StatusDescription, username);
            viewDHSReferral.ContractAgencyName = CMSService.GetContract(contractid).DisplayContractName;
            return(View(viewDHSReferral));
        }