public bool InsertNhaCC(string maNCC, string tenNCC, string diaChi, string sdt)
 {
     try
     {
         NhaCungCap ncc = new NhaCungCap
         {
             MaNCC  = maNCC,
             TenNCC = tenNCC,
             DiaChi = diaChi,
             SDT    = sdt,
         };
         context.NhaCungCaps.Add(ncc);
         context.SaveChanges();
         return(true);
     }
     catch
     {
         return(false);
     }
 }
示例#2
0
        // Cap nhat nhacc
        public static bool UpdateNhaCC(NhaCungCap _cc)
        {
            try
            {
                using (var db = new SieuThiDBDataContext())
                {
                    var cc = db.NhaCungCaps.Single(x => x.MaNCC == _cc.MaNCC);
                    cc.TenNCC    = _cc.TenNCC;
                    cc.DiaChi    = _cc.DiaChi;
                    cc.DienThoai = _cc.DienThoai;
                    cc.MaSoThue  = _cc.MaSoThue;
                    cc.Fax       = _cc.Fax;


                    db.SubmitChanges();
                    return(true);
                }
            }
            catch
            {
                return(false);
            }
        }
示例#3
0
        // Tạo nhacc
        public static bool CreateNhaCC(NhaCungCap cc)
        {
            try
            {
                using (SieuThiDBDataContext db = new SieuThiDBDataContext())
                {
                    var cc1 = new NhaCungCap();

                    cc1.TenNCC    = cc.TenNCC ?? "";
                    cc1.MaNCC     = cc.MaNCC;
                    cc1.DiaChi    = cc.DiaChi;
                    cc1.DienThoai = cc.DienThoai;
                    cc1.MaSoThue  = cc.MaSoThue;
                    cc1.Fax       = cc.Fax;
                    db.NhaCungCaps.InsertOnSubmit(cc1);
                    db.SubmitChanges();
                    return(true);
                }
            }
            catch
            {
                return(false);
            }
        }
 public bool XoaNCC(NhaCungCap ncc)
 {
     return(nccDAL.XoaNhaCungCap(ncc));
 }
 public bool CapNhatNCC(NhaCungCap ncc)
 {
     return(nccDAL.CapNhatNhaCungCap(ncc));
 }
 public bool ThemNCC(NhaCungCap ncc)
 {
     return(nccDAL.ThemNhaCungCap(ncc));
 }
示例#7
0
 public bool CapNhatNhaCungCap(NhaCungCap ncc)
 {
     return(da.CapNhatNhaCungCap(ncc));
 }
示例#8
0
 public bool ThemNhaCungCap(NhaCungCap ncc)
 {
     return(da.ThemNhaCungCap(ncc));
 }
示例#9
0
 public void EditData(NhaCungCap ex)
 {
     bus.EditData(ex);
 }
 public static bool update(NhaCungCap ncc)
 {
     return(NhaCungCap_DAO.update(ncc));
 }
 public static bool insert(NhaCungCap ncc)
 {
     return(NhaCungCap_DAO.insert(ncc));
 }
示例#12
0
 public bool updateNhaCungCap(NhaCungCap nhacungcap)
 {
     return(objNCC.updateNhanVien(nhacungcap));
 }
示例#13
0
 public bool addNCC(NhaCungCap nhacungcap)
 {
     return(objNCC.addNhaCungCap(nhacungcap));
 }
示例#14
0
 public void DeleteData(NhaCungCap ex)
 {
     bus.DeleteData(ex);
 }
 public bool Them(NhaCungCap nhaCungCap)
 {
     return(dal_nhaCungCap.Them(nhaCungCap));
 }
 public bool CapNhat(NhaCungCap nhaCungCap)
 {
     return(dal_nhaCungCap.CapNhat(nhaCungCap));
 }
示例#17
0
 // THEM DATA
 public void AddData(NhaCungCap ex)
 {
     bus.AddData(ex);
 }