Пример #1
0
        public ActionResult Create([Bind(Include = "MaGD,MaKH,NgayGD,NgayHetHan,SoTien,NguoiThu")] LichSuGD lichsugd)
        {
            if (ModelState.IsValid)
            {
                db.DSLichSuGD.Add(lichsugd);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.MaKH = new SelectList(db.DSKhachHang, "MaKH", "TenKH", lichsugd.MaKH);
            return(View(lichsugd));
        }
Пример #2
0
 // them data vao danh sach lich su giao dich
 public ActionResult UpdateHistory(int makh, DateTime ngaygd, DateTime ngayhethan, decimal sotien, string nguoithu, int thoihan, decimal cuocphi, decimal tiengiam, string note, bool paid)
 {
     if (ModelState.IsValid)
     {
         LichSuGD newls = new LichSuGD();
         newls.MaKH       = makh;
         newls.NgayGD     = ngaygd;
         newls.NgayHetHan = ngayhethan;
         newls.SoTien     = sotien;
         newls.NguoiThu   = User.Identity.GetUserId();
         newls.CuocPhi    = cuocphi;
         newls.ThoiHan    = thoihan;
         newls.TienGiam   = tiengiam;
         newls.Note       = note;
         newls.Paid       = paid;
         db.DSLichSuGD.Add(newls);
         db.SaveChanges();
         return(Json(true));
     }
     return(Json(false));
 }