示例#1
0
 public int Insert(MauSac entity)
 {
     entity.Status = true;
     db.MauSacs.Add(entity);
     db.SaveChanges();
     return(entity.ID);
 }
示例#2
0
 public long Insert(Kho entity)
 {
     entity.Status = true;
     db.Khoes.Add(entity);
     db.SaveChanges();
     return(entity.ID);
 }
示例#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));
        }
示例#4
0
 public bool Insert(LoaiMatHang entity)
 {
     try
     {
         db.LoaiMatHangs.Add(entity);
         db.SaveChanges();
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }
示例#5
0
 public bool Insert(KhachHangGiaoDich entity)
 {
     try
     {
         db.KhachHangGiaoDiches.Add(entity);
         db.SaveChanges();
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }
示例#6
0
 public int Insert(KhachHang entity)
 {
     try
     {
         db.KhachHangs.Add(entity);
         db.SaveChanges();
         return(entity.ID);
     }
     catch (Exception)
     {
         return(-1);
     }
 }
示例#7
0
 public bool Insert(GioiTinh entity)
 {
     try
     {
         db.GioiTinhs.Add(entity);
         db.SaveChanges();
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }
示例#8
0
 public bool Insert(HangHoa entity)
 {
     try
     {
         db.HangHoas.Add(entity);
         db.SaveChanges();
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }
示例#9
0
 public int Insert(Role entity)
 {
     try
     {
         db.Roles.Add(entity);
         db.SaveChanges();
         return(1);
     }
     catch
     {
         return(-1);
     }
 }
示例#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);
     }
 }
 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();
 }
示例#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));
     }
 }
示例#13
0
 public bool Insert(ChiTietNhap entity)
 {
     db.ChiTietNhaps.Add(entity);
     db.SaveChanges();
     return(true);
 }
示例#14
0
 public bool Insert(XuatHang entity)
 {
     db.XuatHangs.Add(entity);
     db.SaveChanges();
     return(true);
 }
示例#15
0
 public long Insert(KhoHang entity)
 {
     db.KhoHangs.Add(entity);
     db.SaveChanges();
     return(entity.ID);
 }
示例#16
0
 public long Insert(User entity)
 {
     db.Users.Add(entity);
     db.SaveChanges();
     return(entity.ID);
 }