public int Insert(MauSac entity) { entity.Status = true; db.MauSacs.Add(entity); db.SaveChanges(); return(entity.ID); }
public long Insert(Kho entity) { entity.Status = true; db.Khoes.Add(entity); db.SaveChanges(); return(entity.ID); }
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)); }
public bool Insert(LoaiMatHang entity) { try { db.LoaiMatHangs.Add(entity); db.SaveChanges(); return(true); } catch (Exception) { return(false); } }
public bool Insert(KhachHangGiaoDich entity) { try { db.KhachHangGiaoDiches.Add(entity); db.SaveChanges(); return(true); } catch (Exception) { return(false); } }
public int Insert(KhachHang entity) { try { db.KhachHangs.Add(entity); db.SaveChanges(); return(entity.ID); } catch (Exception) { return(-1); } }
public bool Insert(GioiTinh entity) { try { db.GioiTinhs.Add(entity); db.SaveChanges(); return(true); } catch (Exception) { return(false); } }
public bool Insert(HangHoa entity) { try { db.HangHoas.Add(entity); db.SaveChanges(); return(true); } catch (Exception) { return(false); } }
public int Insert(Role entity) { try { db.Roles.Add(entity); db.SaveChanges(); return(1); } catch { return(-1); } }
public bool Update(string id) { try { var qa = db.CauHinhIDs.Find(id); qa.Value += 1; db.SaveChanges(); return(true); } catch (Exception) { return(false); } }
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(); }
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)); } }
public bool Insert(ChiTietNhap entity) { db.ChiTietNhaps.Add(entity); db.SaveChanges(); return(true); }
public bool Insert(XuatHang entity) { db.XuatHangs.Add(entity); db.SaveChanges(); return(true); }
public long Insert(KhoHang entity) { db.KhoHangs.Add(entity); db.SaveChanges(); return(entity.ID); }
public long Insert(User entity) { db.Users.Add(entity); db.SaveChanges(); return(entity.ID); }