Beispiel #1
0
 public static bool AddNXB(Nhaxuatban nxb)
 {
     DBQLPhatHanhSachEntities model = new DBQLPhatHanhSachEntities();
        try
        {
        model.Nhaxuatban.Add(nxb);
        model.SaveChanges();
        return true;
        }
        catch
        {
        return false;
        }
 }
Beispiel #2
0
 public static bool UpdateNoNXBKhiNhap(Nhaxuatban nxb)
 {
     DBQLPhatHanhSachEntities model = new DBQLPhatHanhSachEntities();
        var _nxb = (from p in model.Nhaxuatban
                where p.MaNXB.Equals(nxb.MaNXB)
                select p).FirstOrDefault();
        if (_nxb == null)
        return false;
        else
        {
        _nxb.No =_nxb.No+ nxb.No;
        model.SaveChanges();
        return true;
        }
 }
Beispiel #3
0
 public static bool UpdateNXB(Nhaxuatban nxb)
 {
     DBQLPhatHanhSachEntities model = new DBQLPhatHanhSachEntities();
        var _nxb = (from p in model.Nhaxuatban
                where p.MaNXB.Trim().Equals(nxb.MaNXB)
                select p).FirstOrDefault();
        if (_nxb == null)
        return false;
        else
        {
        _nxb.TenNXB = nxb.TenNXB;
        _nxb.Diachi = nxb.Diachi;
        _nxb.SDT = nxb.SDT;
        _nxb.Sotaikhoan = _nxb.Sotaikhoan;
        model.SaveChanges();
        return true;
        }
 }