Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }