Пример #1
0
        public ActionResult SaveDanhMucQuocGia(int Key, string TenCoDau, string TenKhongDau, string CountryCode, string GhiChu)//, byte[] Culture
        {
            try
            {
                var row = _db.QuocGias.FirstOrDefault(r => r.QuocGiaKey == Key);
                if (row == null)
                {
                    row = new Models.QuocGia();
                    row.QuocGiaAlternateKey = Key.ToString();
                    _db.QuocGias.Add(row);
                }
                row.TenCoDau    = TenCoDau;
                row.TenKhongDau = TenKhongDau;
                row.CountryCode = CountryCode;
                //row.Culture = Culture;
                row.GhiChu = GhiChu;

                _db.SaveChanges();

                return(Json(new { Result = true, Title = TitleMessageBox.SuccessTitle, Message = Message.SuccessDataAction }, JsonRequestBehavior.AllowGet));
            }
            catch (Exception)
            {
                return(Json(new { Result = false, Title = TitleMessageBox.FailureTitle, Message = Message.FailureDataAction }, JsonRequestBehavior.AllowGet));
            }
        }
Пример #2
0
 //
 // GET: /TheLoai/Edit/5
 public ActionResult Edit(string Ma_quoc_gia = null)
 {
     WebProjectFinal.Models.QuocGia quocgia = new Models.QuocGia(QuocGiaBLL.GetQuocGia(Ma_quoc_gia));
     if (quocgia == null)
     {
         return HttpNotFound();
     }
     return View(quocgia);
 }