public ActionResult CreateNew(Size model) { try { bool check = _sizeService.CheckContain(model.Width, model.Height, model.Unit); if (check) { AlertWarning(InfoString.SetContainString("Kích thước")); ViewData["UnitOfSize"] = UnitOfSizeCategory.GetUnitsOfSize(); return(View(model)); } model.CreateBy = "hadacduong"; model.CreateDate = DateTime.Now; _sizeService.CreateNew(model); _sizeService.CommitChanges(); AlertSuccess(InfoString.CREATE_SUCCESSFULL); } catch (Exception ex) { Log(ex); AlertError(InfoString.ERROR_SYSTEM); } return(RedirectToAction("Index")); }