Пример #1
0
 public string Insert(Disease aDisease)
 {
     if (aDisease.Name == "")
     {
         return("Enter a Name");
     }
     else if (aDiseaseGateway.Cheak(aDisease.Name) == true)
     {
         return("Already Exist.");
     }
     else if (aDiseaseGateway.Insert(aDisease) > 0)
     {
         return("Medicine Saved");
     }
     else
     {
         return("Try Again");
     }
 }
Пример #2
0
        public string Insert(Disease disease)
        {
            if (disease.Name == "")
            {
                return("disease name is missing");
            }

            else if (disease.Description == "")
            {
                return("disease description is missing");
            }


            else if (disease.TreatmentProcedure == "")
            {
                return("disease treatment procedure is missing");
            }

            else if (diseaseGateway.HasThisDiesesName(disease.Name))
            {
                return("disease name already exists");
            }

            else
            {
                int value = diseaseGateway.Insert(disease);

                if (value > 0)
                {
                    return("Saved Successfully");
                }

                else
                {
                    return("Operation Failed");
                }
            }
        }