Exemplo n.º 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            CTNHap ctnhap = db.CTNHaps.Find(id);

            db.CTNHaps.Remove(ctnhap);
            db.SaveChanges();
            return(RedirectToAction("Details/" + ctnhap.Sophieu.ToString(), "Nhap"));
        }
Exemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "idctnhap,Sophieu,Tenct,idct,dvt,slthuc,slbaocao,Dongianhap,trangthai,idxl")] CTNHap ctnhap)
 {
     //if (ModelState.IsValid)
     //{
     db.Entry(ctnhap).State = EntityState.Modified;
     db.SaveChanges();
     return(RedirectToAction("Details/" + ctnhap.Sophieu.ToString(), "Nhap"));
     //}
     //ViewBag.Ma_CT = new SelectList(db.DM_CT, "Ma_CT", "Ma_CT", ctnhap.idct);
     //ViewBag.idxl = new SelectList(db.Xulies, "idxl", "phuongphap",ctnhap.idctnhap);
     //return RedirectToAction("Details/" + ctnhap.Sophieu.ToString(), "Nhap");
 }
Exemplo n.º 3
0
        // GET: /CTNhap/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            CTNHap ctnhap = db.CTNHaps.Find(id);

            if (ctnhap == null)
            {
                return(HttpNotFound());
            }
            return(View(ctnhap));
        }
Exemplo n.º 4
0
        // GET: /CTNhap/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            CTNHap ctnhap = db.CTNHaps.Find(id);

            if (ctnhap == null)
            {
                return(HttpNotFound());
            }
            ViewBag.sophieu = ctnhap.Sophieu;
            return(View(ctnhap));
        }
Exemplo n.º 5
0
        public ActionResult Creatett([Bind(Include = "idctnhap,idct,Tenct,Sophieu,dvt,slthuc,slbaocao,Dongianhap,loai")] CTNHap ctnhap)
        {
            //if (ModelState.IsValid)
            //{
            ctnhap.loai = true;
            db.CTNHaps.Add(ctnhap);
            db.SaveChanges();
            return(RedirectToAction("Details/" + ctnhap.Sophieu.ToString(), "Nhap"));
            //}

            //ViewBag.idct = new SelectList(db.DM_CT, "idct", "Ten_CT", ctnhap.idct);
            //ViewBag.idxl = new SelectList(db.Xulies, "idxl", "phuongphap");
            //ViewBag.sophieu = ctnhap.idctnhap;
            //return RedirectToAction("Details/" + ctnhap.Sophieu.ToString(), "Nhap");
            //return Content(kq);
        }
Exemplo n.º 6
0
        // GET: /CTNhap/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            CTNHap ctnhap = db.CTNHaps.Find(id);

            if (ctnhap == null)
            {
                return(HttpNotFound());
            }
            var list = new String[] { "Kg", "Tấn", "Phuy" };

            ViewBag.idct    = new SelectList(db.DM_CT, "idct", "Ma_CT", ctnhap.idct);
            ViewBag.idxl    = new SelectList(db.Xulies, "idxl", "phuongphap", ctnhap.idxl);
            ViewBag.dvt     = new SelectList(list, "Kg");
            ViewBag.sophieu = ctnhap.Sophieu;
            return(View(ctnhap));
        }