protected void updatePaymentType(object sender, EventArgs e)
        {
            string paymentTypeName = PaymentTypeNameBox.Text;

            string error = PaymentTypeController.updatePaymentType(currentPaymentType, paymentTypeName);

            if (error == "")
            {
                Response.Redirect("ViewPaymentType.aspx");
            }
            else
            {
                ErrorMessage.Text = error;
            }
        }
        protected void UpdatePaymentTypeBtn_Click(object sender, EventArgs e)
        {
            int    id           = Convert.ToInt32(Request.QueryString["ID"]);
            String paymentType  = TxtPaymentType.Text;
            string errorMessage = "";

            PaymentTypeController.updatePaymentType(id, paymentType, out errorMessage);
            if (errorMessage != "Success")
            {
                ErrorLbl.Text    = errorMessage;
                ErrorLbl.Visible = true;
            }
            else
            {
                ErrorLbl.Visible = false;
                Response.Redirect("./ViewPaymentType.aspx");
            }
        }
        protected void doUpdatePaymenttType(object sender, EventArgs e)
        {
            int    id   = Int32.Parse(Request.QueryString["id"]);
            String type = updatePaymentTypeNameId.Text;

            PaymentType pt = PaymentTypeRepository.db.PaymentTypes.Where(payType => payType.Type.Equals(type)).FirstOrDefault();
            String      paymentTypeIsExist;

            try
            {
                paymentTypeIsExist = pt.Type;
            }
            catch
            {
                paymentTypeIsExist = "";
            }


            if (type.Length == 0)
            {
                errorMsgId.Text = "Please fill the payment type name";
            }
            else if (type.Length < 3)
            {
                errorMsgId.Text = "updated payment type name must be 3 character or more";
            }
            else if (type.Equals(paymentTypeIsExist))
            {
                errorMsgId.Text = "Payment type name is already exist, please input different type of payment"; //mungin perlu di re-validate
            }
            else
            {
                PaymentTypeController.updatePaymentType(id, type);
                Response.Redirect("ViewPaymentType.aspx");
            }
        }