public ActionResult LuuDanhMucLoaiXe(int Key, string ten, string moTa, short hangSanXuatXeKey, string model , bool mayChayDau , bool mayChayXang , short soGhe , short loaiGheKey , string ghiChu) { try { var row = _db.LoaiXes.FirstOrDefault(r => r.LoaiXeKey == Key); if (row == null) { row = new Models.LoaiXe(); row.LoaiXeAlternateKey = Key.ToString(); _db.LoaiXes.Add(row); } row.Ten = ten; row.MoTa = moTa; row.HangSanXuatXeKey = hangSanXuatXeKey; row.Model = model; row.MayChayDau = mayChayDau; row.MayChayXang = mayChayXang; row.SoGhe = soGhe; row.LoaiGheKey = loaiGheKey; 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); } }
public ActionResult DanhMucLoaiXe() { var loaiXe = new Models.LoaiXe(); return View(loaiXe); }