Пример #1
0
        [TestMethod]//okpass
        public void TestMethodDetailBenar()
        {
            int   id  = 1;
            ASPEK asp = aDAO.Detail(id);

            Assert.AreEqual("ubah lagi ya", asp.NAMA_ASPEK);
        }
Пример #2
0
        [TestMethod]//oktes+db
        public void TestTampilDetailbenar()
        {
            int   id     = 1;
            ASPEK result = aDAO.Detail(id);

            Assert.IsNotNull(result);
        }
Пример #3
0
        public ActionResult DeleteConfirmed(int id)
        {
            ASPEK aSPEK = db.ASPEK.Find(id);

            db.ASPEK.Remove(aSPEK);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Пример #4
0
        public void TestTampilDetailSalah()
        {
            int   id           = 0;
            ASPEK expectResult = null;
            ASPEK result       = aDAO.Detail(id);

            Assert.AreEqual(expectResult, result);
        }
Пример #5
0
        [TestMethod]//oktes+db
        public void TesDeleteAspekbenar()
        {
            ASPEK aspek = aDAO.Detail(17);

            Assert.IsNotNull(aspek);
            bool isPermanent = false;

            var a = aDAO.Delete(17, false);
        }
Пример #6
0
 public ActionResult Edit([Bind(Include = "ID_ASPEK,NAMA_ASPEK,DIBUAT_OLEH,DIBUAT_PADA,DIUBAH_OLEH,DIUBAH_PADA,STATUS_AKTIF")] ASPEK aSPEK)
 {
     if (ModelState.IsValid)
     {
         db.Entry(aSPEK).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(aSPEK));
 }
Пример #7
0
        public ActionResult Create([Bind(Include = "ID_ASPEK,NAMA_ASPEK,DIBUAT_OLEH,DIBUAT_PADA,DIUBAH_OLEH,DIUBAH_PADA,STATUS_AKTIF")] ASPEK aSPEK)
        {
            if (ModelState.IsValid)
            {
                db.ASPEK.Add(aSPEK);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(aSPEK));
        }
Пример #8
0
        [TestMethod]//oktes+db
        public void TestTambahAspekbenar()
        {
            ASPEK Asp = new ASPEK();

            Asp.NAMA_ASPEK   = "aspek";
            Asp.DIBUAT_OLEH  = "Zakki";
            Asp.DIBUAT_PADA  = DateTime.Now;
            Asp.STATUS_AKTIF = true;
            int a = aDAO.Add(Asp);

            Assert.IsNotNull(a);
        }
Пример #9
0
        [TestMethod]//oktess+db
        public void TesEditAspectSalah()
        {
            ASPEK aspek = aDAO.Detail(0);

            Assert.IsNotNull(aspek);
            aspek.NAMA_ASPEK   = "Komplit pake banget";
            aspek.DIUBAH_OLEH  = "suci";
            aspek.DIUBAH_PADA  = DateTime.Now;
            aspek.STATUS_AKTIF = true;
            var a = aDAO.Edit(0, aspek);

            Assert.AreEqual(0, a);
        }
Пример #10
0
        [TestMethod]//oktess+db
        public void TesEditAspectbenar()
        {
            ASPEK aspek = aDAO.Detail(2);

            Assert.IsNotNull(aspek);
            aspek.NAMA_ASPEK   = "ubah lagi ya";
            aspek.DIUBAH_OLEH  = "suci f";
            aspek.DIUBAH_PADA  = DateTime.Now;
            aspek.STATUS_AKTIF = true;
            var a = aDAO.Edit(2, aspek);

            Assert.AreEqual(1, a);
        }
Пример #11
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            ASPEK aspek = new ASPEK
            {
                NAMA_ASPEK   = TextBox1.Text,
                DIBUAT_OLEH  = TextBox2.Text,
                DIBUAT_PADA  = DateTime.Now,
                STATUS_AKTIF = CheckBox1.Checked
            };
            AspekDAO aspdao = new AspekDAO();

            aspdao.Add(aspek);
        }
Пример #12
0
        // GET: ASPEKs/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            ASPEK aSPEK = db.ASPEK.Find(id);

            if (aSPEK == null)
            {
                return(HttpNotFound());
            }
            return(View(aSPEK));
        }
Пример #13
0
        public static void Main(String[] args)
        {
            AspekDAO aDAO  = new AspekDAO();
            ASPEK    aspek = aDAO.Detail(2);


            //aspek.NAMA_ASPEK = "Try it ";
            //aspek.DIUBAH_OLEH = "Zakki";
            //aspek.DIUBAH_PADA = DateTime.Now;
            ////aDAO.Edit(1, aspek);

            //aDAO.Edit(2, aspek);
            Console.WriteLine(aspek.DIBUAT_OLEH);


            Console.ReadLine();
        }