Exemplo n.º 1
0
 public IActionResult SaveItem(DMTinhThanh model)
 {
     if (!ModelState.IsValid)
     {
         return(View(model));
     }
     else
     {
         TempData["MessageSuccess"] = "Cập nhật thành công";
         return(RedirectToAction("Index"));
     }
 }
Exemplo n.º 2
0
        public List <DMTinhThanh> GetDMTinhThanh()
        {
            List <DMTinhThanh>  dm      = new List <DMTinhThanh>();
            List <dtb_province> listDMs = (from s in db.dtb_provinces select s).ToList();

            foreach (var d in listDMs)
            {
                DMTinhThanh x = new DMTinhThanh();
                x.Id      = d.id;
                x.MaTinh  = d.province_code;
                x.TenTinh = d.province_name;
                dm.Add(x);
            }

            return(dm);
        }