Ejemplo n.º 1
0
    protected void RepeaterKombinasiProduk_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        using (DataClassesDatabaseDataContext db = new DataClassesDatabaseDataContext())
        {
            if (e.CommandName == "Hapus")
            {
                KombinasiProduk_Class KombinasiProduk_Class = new KombinasiProduk_Class();

                if (KombinasiProduk_Class.Hapus(db, e.CommandArgument.ToInt()))
                {
                    db.SubmitChanges();

                    LoadDataKombinasiProduk(db);
                }
            }
            if (e.CommandName == "UbahStatus")
            {
                StokProduk_Class StokProduk_Class = new StokProduk_Class(db);

                if (StokProduk_Class.UbahStatus((e.CommandArgument.ToString()).ToInt()))
                {
                    LoadDataKombinasiProduk(db);
                }
            }
        }
    }