public bool ThemLoaiPhi(ref string err, string Ma, string Ten) { bool f = false; CacLoaiPhi hs = new CacLoaiPhi(); hs.MaPhi = Ma; hs.TenPhi = Ten; try { dbs.CacLoaiPhis.InsertOnSubmit(hs); dbs.SubmitChanges(); f = true; } catch (Exception ex) { err = ex.Message; } return(f); }
public bool XoaLoaiPhi(ref string err, string Ma) { bool f = false; CacLoaiPhi hs = dbs.CacLoaiPhis.Single(p => p.MaPhi == Ma); try { if (hs != null) { dbs.CacLoaiPhis.DeleteOnSubmit(hs); dbs.SubmitChanges(); f = true; } } catch (Exception ex) { err = ex.Message; } return(f); }
public bool SuaLoaiPhi(ref string err, string Ma1, string Ma2, string Ten) { bool f = false; CacLoaiPhi hs = dbs.CacLoaiPhis.Single(p => p.MaPhi == Ma1); try { if (hs != null) { hs.MaPhi = Ma2; hs.TenPhi = Ten; dbs.SubmitChanges(); f = true; } } catch (Exception ex) { err = ex.Message; } return(f); }