public bool RemoveCity(string cityID, ref string err) { QLBHDataContext qLBH = new QLBHDataContext(); var TP = from tp in qLBH.ThanhPhos where tp.ThanhPho1 == cityID select tp; qLBH.ThanhPhos.DeleteAllOnSubmit(TP); qLBH.SubmitChanges(); return(true); }
public bool UpdateCity(string cityID, string cityName, ref string err) { QLBHDataContext qLBH = new QLBHDataContext(); var TP = (from tp in qLBH.ThanhPhos where tp.ThanhPho1 == cityID select tp).SingleOrDefault(); if (TP != null) { TP.TenThanhPho = cityID; qLBH.SubmitChanges(); } return(true); }