Exemplo n.º 1
0
        protected void LinkButtonAddDoctor_Click(object sender, EventArgs e)
        {
            if (TextBoxDoctorName.Text == "" || TextBoxDegree.Text == "" || TextBoxCity.Text == "")
            {
                messagediv.Visible             = true;
                messagediv.Attributes["class"] = "fixed-message rounded alert bg-danger alert-dismissible animated fadeIn text-center text-white";
                mesaagetxt.InnerHtml           = "Error! Please fill all required field.";
            }

            else
            {
                string response = operation.AddDoctor(TextBoxDoctorName.Text, TextBoxDegree.Text, TextBoxCity.Text);

                if (response == "SUCCESS")
                {
                    messagediv.Visible             = true;
                    messagediv.Attributes["class"] = "fixed-message rounded alert bg-success alert-dismissible animated fadeIn text-center text-white";
                    mesaagetxt.InnerHtml           = "Success.";

                    BindPage();
                }
                else if (response == "ERROR")
                {
                    messagediv.Visible             = true;
                    messagediv.Attributes["class"] = "fixed-message rounded alert bg-danger alert-dismissible animated fadeIn text-center text-white";
                    mesaagetxt.InnerHtml           = "Error! something went wrong please try again later.";
                }
            }
        }