Example #1
0
 public string Save(Disease aDisease)
 {
     if (IsNameExists(aDisease.Name))
     {
         return("Name Already Exists");
     }
     else
     {
         if (aDiseaseGateway.Save(aDisease) > 0)
         {
             return("Saved Successfully");
         }
         else
         {
             return("Failed");
         }
     }
 }
        public string Save(Disease aDisease)
        {
            Disease disease = aDiseaseGateway.Find(aDisease.Name);

            if (disease == null)
            {
                aDiseaseGateway.Save(aDisease);
                return("Disease saved.");
            }
            return("Duplicate Name.");
        }
Example #3
0
        public ActionResult Create([Bind(Include = "Name, Description, Treatment, Drugs")] Disease d)
        {
            if (ModelState.IsValid)
            {
                if (dGate.Save(d))
                {
                    return(RedirectToAction("index", "Home"));
                }
                return(View(d));
            }

            return(View(d));
        }
Example #4
0
 public bool Save(Disease disease)
 {
     if (disease.Name == "")
     {
         MessageBox.Show("Name cannot be empty");
         return(false);
     }
     else
     {
         DiseaseGateway diseaseGateway = new DiseaseGateway();
         return(diseaseGateway.Save(disease));
     }
 }
Example #5
0
 public string Save(Disease aDisease)
 {
     if (aGateway.IsDiseaseNameExists(aDisease))
     {
         return("Disease Already Exists");
     }
     else
     {
         if (aGateway.Save(aDisease) > 0)
         {
             return("Saved Succesfully");
         }
         else
         {
             return("Saving Failed");
         }
     }
 }
        public bool Save(Disease disease)
        {
            DiseaseGateway diseaseGateway = new DiseaseGateway();

            return(diseaseGateway.Save(disease));
        }