public ActionResult DeleteBuku(int bukuID)
        {
            BukuManager KM = new BukuManager();

            KM.DeleteBuku(bukuID);
            return(Json(new { success = true }));
        }
Exemple #2
0
 public ActionResult AddBuku(BukuView bv)
 {
     if (ModelState.IsValid)
     {
         BukuManager BK = new BukuManager();
         BK.AddBuku(bv);
         return(RedirectToAction("Welcome", "Home"));
     }
     return(View());
 }
 public ActionResult AddBuku(BukuView kv)
 {
     if (ModelState.IsValid)
     {
         BukuManager KM = new BukuManager();
         KM.AddBuku(kv);
         return(RedirectToAction("AdminOnly", "Home"));
     }
     return(View());
 }
 public ActionResult Add(TambahBukuModel TBM)
 {
     if (ModelState.IsValid)
     {
         BukuManager BM = new BukuManager();
         BM.TambahBuku(TBM);
         return(RedirectToAction("Welcome", "Home"));
     }
     return(View());
 }
 public ActionResult AddBuku(BukuView bv)
 {
     if (ModelState.IsValid)
     {
         BukuManager BM = new BukuManager();
         BM.AddBuku(bv);
         return(RedirectToAction("ListBuku", "Buku"));
     }
     return(View());
 }
        public ActionResult UpdateBukuData(int bukuID, string idBuku, string isbn, string judul, string penulis, string penerbit, int tahun, int stok)
        {
            BukuView KV = new BukuView();

            KV.id_buku  = bukuID;
            KV.ISBN     = isbn;
            KV.judul    = judul;
            KV.penulis  = penulis;
            KV.penerbit = penerbit;
            KV.tahun    = tahun;
            KV.stok     = stok;
            BukuManager KM = new BukuManager();

            KM.UpdateBuku(KV);
            return(Json(new { success = true }));
        }
Exemple #7
0
        public ActionResult UpdateBukuData(int bukuID, string isbn, string
                                           judul, string penulis, string penerbit, int tahun, int stok)
        {
            BukuView BV = new BukuView();

            BV.id_buku  = bukuID;
            BV.isbn     = isbn;
            BV.judul    = judul;
            BV.penulis  = penerbit;
            BV.penerbit = penerbit;
            BV.tahun    = tahun;
            BV.stok     = stok;
            BukuManager BM = new BukuManager();

            BM.UpdateBuku(BV);
            return(Json(new { success = true }));
        }
        public ActionResult UpdateBukuData(int bukuID, string ISBN, string
                                           judul, string penulis, string penerbit, int tahun, int stok, int harga_beli, int harga_jual)
        {
            BukuView BV = new BukuView();

            BV.id_buku    = bukuID;
            BV.ISBN       = ISBN;
            BV.judul      = judul;
            BV.penulis    = penulis;
            BV.penerbit   = penerbit;
            BV.tahun      = tahun;
            BV.stok       = stok;
            BV.harga_beli = harga_beli;
            BV.harga_jual = harga_jual;
            BukuManager BM = new BukuManager();

            BM.UpdateBuku(BV);
            return(Json(new { success = true }));
        }
        public ActionResult ManageBukuPartial(string status = "")
        {
            string       loginName = User.Identity.Name;
            BukuManager  BM        = new BukuManager();
            BukuDataView BDV       = new BukuDataView();

            BDV.BukuProfile = BM.GetBukuData();
            string message = string.Empty;

            if (status.Equals("update"))
            {
                message = "Update Sukses";
            }
            else if (status.Equals("delete"))
            {
                message = "Hapus Sukses";
            }
            ViewBag.Message = message;
            return(PartialView(BDV));
        }
        public ActionResult ManageBukuPartial(string status = "")
        {
            //if (User.Identity.IsAuthenticated)
            //{
            string       loginName = User.Identity.Name;
            BukuManager  KM        = new BukuManager();
            BukuDataView KDV       = new BukuDataView();

            KDV.BukuProfile = KM.GetBukuData();
            string message = string.Empty;

            if (status.Equals("update"))
            {
                message = "Update Successful";
            }
            else if (status.Equals("delete"))
            {
                message = "Delete Successful";
            }
            ViewBag.Message = message;
            return(PartialView(KDV));
            //}
            // return RedirectToAction("Index", "Home");
        }