Esempio n. 1
0
 public int Insert(MauSac entity)
 {
     entity.Status = true;
     db.MauSacs.Add(entity);
     db.SaveChanges();
     return(entity.ID);
 }
Esempio n. 2
0
 public long Insert(Kho entity)
 {
     entity.Status = true;
     db.Khoes.Add(entity);
     db.SaveChanges();
     return(entity.ID);
 }
Esempio n. 3
0
        public ActionResult Create([Bind(Include = "ID,DonHangID,KhachHangID,NgayGiaoDich,TongTien,SoLuong,TrangThai")] KhachHangGiaoDich khachHangGiaoDich)
        {
            if (ModelState.IsValid)
            {
                db.KhachHangGiaoDiches.Add(khachHangGiaoDich);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(khachHangGiaoDich));
        }
Esempio n. 4
0
 public bool Insert(LoaiMatHang entity)
 {
     try
     {
         db.LoaiMatHangs.Add(entity);
         db.SaveChanges();
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }
Esempio n. 5
0
 public bool Insert(KhachHangGiaoDich entity)
 {
     try
     {
         db.KhachHangGiaoDiches.Add(entity);
         db.SaveChanges();
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }
Esempio n. 6
0
 public int Insert(KhachHang entity)
 {
     try
     {
         db.KhachHangs.Add(entity);
         db.SaveChanges();
         return(entity.ID);
     }
     catch (Exception)
     {
         return(-1);
     }
 }
Esempio n. 7
0
 public bool Insert(GioiTinh entity)
 {
     try
     {
         db.GioiTinhs.Add(entity);
         db.SaveChanges();
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }
Esempio n. 8
0
 public bool Insert(HangHoa entity)
 {
     try
     {
         db.HangHoas.Add(entity);
         db.SaveChanges();
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }
Esempio n. 9
0
 public int Insert(Role entity)
 {
     try
     {
         db.Roles.Add(entity);
         db.SaveChanges();
         return(1);
     }
     catch
     {
         return(-1);
     }
 }
Esempio n. 10
0
 public bool Update(string id)
 {
     try
     {
         var qa = db.CauHinhIDs.Find(id);
         qa.Value += 1;
         db.SaveChanges();
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }
Esempio n. 11
0
 public ActionResult Create(LoaiKhachHang entity)
 {
     if (ModelState.IsValid)
     {
         db.LoaiKhachHangs.Add(entity);
         db.SaveChanges();
         return(RedirectToAction("Index"));
         //   return View();
     }
     else
     {
         return(View(entity));
     }
     //   return View();
 }
Esempio n. 12
0
 public ActionResult Create(KhachHang entity)
 {
     if (ModelState.IsValid)
     {
         gTinh();
         loaiKH();
         entity.CreatedDate = DateTime.Now;
         entity.CreateBy    = Session["UserName"].ToString();
         entity.Status      = true;
         db.KhachHangs.Add(entity);
         db.SaveChanges();
         return(RedirectToAction("Index"));
         //   return View();
     }
     else
     {
         return(View(entity));
     }
 }
Esempio n. 13
0
 public bool Insert(ChiTietNhap entity)
 {
     db.ChiTietNhaps.Add(entity);
     db.SaveChanges();
     return(true);
 }
Esempio n. 14
0
 public bool Insert(XuatHang entity)
 {
     db.XuatHangs.Add(entity);
     db.SaveChanges();
     return(true);
 }
Esempio n. 15
0
 public long Insert(KhoHang entity)
 {
     db.KhoHangs.Add(entity);
     db.SaveChanges();
     return(entity.ID);
 }
Esempio n. 16
0
 public long Insert(User entity)
 {
     db.Users.Add(entity);
     db.SaveChanges();
     return(entity.ID);
 }