Exemplo n.º 1
0
        protected void LinkButtonAddTestCenter_Click(object sender, EventArgs e)
        {
            if (Session["LabId"] != null)
            {
                if (TextBoxCenterName.Text == "" || TextBoxCenterCode.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.AddTestCenter(TextBoxCenterName.Text, TextBoxCenterCode.Text, Session["LabId"].ToString());

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

            else
            {
                messagediv.Visible             = true;
                messagediv.Attributes["class"] = "fixed-message rounded alert bg-warning alert-dismissible animated fadeIn text-center text-white";
                mesaagetxt.InnerHtml           = "session out!";
            }
        }