protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["userrole"].ToString() != "Administrator")
            {
                Response.Redirect("Home.aspx");
            }

            if (Request.QueryString["ID"] == null)
            {
                inputPaymentType.Attributes["value"] = null;

                errorMsg.Text = "Belum memilih payment type, silahkan kembali";
                errorMsg.Style.Add("visibility", "visible");
            }
            else if (Request.QueryString["ID"] != null)
            {
                int         id = Int32.Parse(Request.QueryString["ID"]);
                PaymentType pt = ItemAuthHandler.checkExistPaymentTypeId(id);

                if (pt == null)
                {
                    inputPaymentType.Attributes["value"] = null;
                    errorMsg.Text = "payment type tidak ditemukan";
                    errorMsg.Style.Add("visibility", "visible");
                }
                else
                {
                    inputPaymentType.Attributes["value"] = pt.type.ToString();
                }
            }
        }
예제 #2
0
        public static Boolean checkPaymentTypeId(int id)
        {
            PaymentType pt = ItemAuthHandler.checkExistPaymentTypeId(id);

            if (pt != null)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }