public void themKH() { ChucVu chucvu = new ChucVu(); chucvu.MaCV = ""; chucvu.TenChucVu = ""; demos.ChucVus.Add(chucvu); demos.SaveChanges(); }
public static List <ChucVu> selectChucvu() { List <ChucVu> cv = new List <ChucVu>(); string s = "select * from chucvu"; DataTable dt = DA.Ketnoi.ExcecuteQuery(s); for (int i = 0; i < dt.Rows.Count; i++) { ChucVu cv1 = new ChucVu(); cv1.Machucvu = dt.Rows[i]["machucvu"].ToString(); cv1.Tenchucvu = dt.Rows[i]["tenchucvu"].ToString(); cv1.Hsl = float.Parse(dt.Rows[i]["hsl"].ToString()); cv.Add(cv1); } return(cv); }
public bool DKKH(ChucVuDTO kh) { ChucVu customer = new ChucVu(); try { customer.MaCV = kh.MaCV; customer.TenChucVu = kh.TenChucVu; demos.ChucVus.Add(customer); demos.SaveChanges(); return(true); } catch { return(false); } }