Пример #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string id = Convert.ToString(Session["id"]);

            //String message = null;
            if (Session["id"] == null)
            {
                Response.Redirect("Login.aspx");
            }
            else
            {
                try
                {
                    Koneksi loadData = new Koneksi();
                    TableUser.DataSource = loadData.daftar_barang();
                    TableUser.DataBind();
                    loadData.kon.Close();
                    Riwayat.DataSource = loadData.riwayat_barang();
                    Riwayat.DataBind();
                    loadData.kon.Close();
                }catch (Exception msg)
                {
                    this.message = "terjadi masalah";
                }
            }
        }
Пример #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["id"] == null)
     {
         Response.Redirect("Login.aspx");
     }
     if (!IsPostBack)
     {
         barang.DataSource     = k.daftar_barang();
         barang.DataTextField  = "nama";
         barang.DataValueField = "id";
         barang.DataBind();
         k.kon.Close();
     }
 }