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."); }
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)); }
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)); } }
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)); }