protected void saveButton_Click(object sender, EventArgs e)
        {
            Disease aDisease = new Disease();

            aDisease.NameOfDisease      = nameDiseaseEntryTextBox.Text;
            aDisease.Description        = descriptionDiseaseEntryTextBox.Text;
            aDisease.TreatmentProcedure = treatmentProcedureDiseaseEntryTextBox.Text;
            msgLabel.Text = diseaseManager.SaveDisease(aDisease);
            diseaseEntryGridView.DataSource = diseaseManager.GetAllDiseases();
            diseaseEntryGridView.DataBind();
        }
Ejemplo n.º 2
0
        protected void SaveButton_Click(object sender, EventArgs e)
        {
            Disease aDisease = new Disease();

            aDisease.Name               = nameTextBox.Text;
            aDisease.Description        = descriptionTextBox.Text;
            aDisease.TreatmentProcedure = treatmentProcedureTextBox.Text;
            aDisease.PreferedDrugs      = preferedDrugsTextBox.Text;
            string msg = aDiseaseManager.SaveDisease(aDisease);

            msgLabel.Text = msg;
        }
Ejemplo n.º 3
0
        protected void saveButton_Click(object sender, EventArgs e)
        {
            Disease aDisease = new Disease();

            aDisease.NameOfDisease      = nameDiseaseEntryTextBox.Text;
            aDisease.Description        = descriptionDiseaseEntryTextBox.Text;
            aDisease.TreatmentProcedure = treatmentProcedureDiseaseEntryTextBox.Text;
            if (diseaseManager.IsDiseaseExists(aDisease))
            {
                megLabel.Text      = "";
                errorMegLabel.Text = "This disease already exists!";
            }
            else
            {
                errorMegLabel.Text                         = "";
                megLabel.Text                              = diseaseManager.SaveDisease(aDisease);
                nameDiseaseEntryTextBox.Text               = "";
                descriptionDiseaseEntryTextBox.Text        = "";
                treatmentProcedureDiseaseEntryTextBox.Text = "";
                diseaseEntryGridView.DataSource            = diseaseManager.GetAllDiseases();
                diseaseEntryGridView.DataBind();
            }
        }