protected void Btn_Insert_Click(object sender, EventArgs e) { String type = PaymentTypeTxt.Text; int isValid = PaymentTypeController.PaymentTypeValidation(type); if (isValid == -1) { TypeLabel.Text = "Type must be filled, unique and consist of 3 chars or more"; } else if (isValid == -2) { TypeLabel.Text = "Type must consist of 3 chars or more and unique"; } else if (isValid == -3) { TypeLabel.Text = "Type must be unique"; } else { PaymentTypeController.add(type); Response.Redirect("ViewPaymentType.aspx"); } }