public static string MaKhuVuc() { string Ma; var db = new PerfectAppEntities(); Ma = db.KhuVucs.OrderByDescending(k => k.MaKhuVuc).FirstOrDefault().MaKhuVuc; if (Ma != null) { Ma = XuLyChuoi.LayChuoi(Ma); } else { Ma = "KV0001"; } return(Ma); }
public static string LayMaHH() { string Ma; var db = new PerfectAppEntities(); Ma = db.HangHoas.OrderByDescending(k => k.MaHang).FirstOrDefault().MaHang; if (Ma != null) { Ma = XuLyChuoi.LayChuoi(Ma); } else { Ma = "HH0001"; } return(Ma); }
public static string LayMaNCC() { string Ma; var db = new PerfectAppEntities(); Ma = db.NhaCungCaps.OrderByDescending(k => k.MaNCC).FirstOrDefault().MaNCC; if (Ma != null) { Ma = XuLyChuoi.LayChuoi(Ma); } else { Ma = "NCC0001"; } return(Ma); }
public static string LayMaPhieu() { string kq = ""; var db = new PerfectAppEntities(); var rs = db.PhieuNhapHangs.OrderByDescending(p => p.MaPhieu).FirstOrDefault(); if (rs != null) { kq = XuLyChuoi.LayChuoi(rs.MaPhieu); } else { kq = "PNH0001"; } return(kq); }