public static int GetMaNVNext() { using (var db = new SieuThiDBDataContext()) { int?manv = 0; var nv = db.NhanViens.FirstOrDefault(); db.ManvNext(ref manv); if (nv == null) { return(1); } else { db.ManvNext(ref manv); return(manv + 1 ?? 1); } } }
public static int GetMaNhaCCNext() { using (var db = new SieuThiDBDataContext()) { int?ma = 0; var nv = db.nhacungcaps.FirstOrDefault(); if (nv == null) { return(1); } else { db.ManvNext(ref ma); return(ma + 1 ?? 1); } } }