Пример #1
0
        public ApiResponse <MonModel> UpdateMonThi(MonModel monModel)
        {
            string jsonObject = JsonConvert.SerializeObject(monModel);

            var list = CoreRepo.PostToGetApiResponse <MonModel>(Constance.Constance.UrlApi, "MonThi/updateMonThi/", jsonObject);

            if (list.Status == (int)HttpStatusCode.NotFound)
            {
                return(list);
            }

            return(list);
        }
Пример #2
0
        public ActionResult Edit(MonModel mon)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    var result = _monRepo.UpdateMonThi(mon);

                    if (result.CheckStatus())
                    {
                        return(RedirectToAction("Index"));
                    }
                }
                // TODO: Add insert logic here

                return(View());
            }
            catch
            {
                return(View());
            }
        }