public WFNhapHang LayMaPN() { WFNhapHang pn = new WFNhapHang(); pn = ((from p in db.WFNhapHangs orderby p.MaPN descending select p).Take(1)).Single(); return pn; }
public WFNhapHang LayMaPN() { WFNhapHang pn = new WFNhapHang(); pn = ((from p in db.WFNhapHangs orderby p.MaPN descending select p).Take(1)).Single(); return(pn); }
public bool XoaPN(int mapn) { try { WFNhapHang pn = db.WFNhapHangs.SingleOrDefault(p => p.MaPN == mapn); db.WFNhapHangs.Remove(pn); db.SaveChanges(); return(true); } catch { return(false); } }
public bool ThemPN(DateTime ngay) { try { WFNhapHang pn = new WFNhapHang(); pn.NgayNhap = ngay; db.WFNhapHangs.Add(pn); db.SaveChanges(); return true; } catch (Exception e) { return false; } }
public bool ThemPN(DateTime ngay) { try { WFNhapHang pn = new WFNhapHang(); pn.NgayNhap = ngay; db.WFNhapHangs.Add(pn); db.SaveChanges(); return(true); } catch (Exception e) { return(false); } }