Exemplo n.º 1
0
        public ActionResult DiseaseEntry(Disease disease)
        {
            List <Disease> diseaseList = headManager.GetDiseaseList();

            ViewBag.DiseaseList = diseaseList;

            if (!ModelState.IsValid)
            {
                return(View(disease));
            }

            if (headManager.IsDiseaseExist(disease.Name))
            {
                ViewBag.SaveConfirmMsg = "Disease Name Already Exist";
            }
            else if (headManager.SetDisease(disease))
            {
                ViewBag.SaveConfirmMsg = "Data saved";
            }
            else
            {
                ViewBag.SaveConfirmMsg = "Data saved failed";
            }

            return(View());
        }