Пример #1
0
        public ActionResult Edit(CodeValue codeValue, string id)
        {
            try
            {
                var response = codeValue.Update();

                if (response.ReturnCode < 0000)
                {
                    ModelState.AddModelError("Error", response.Message);
                    return(View());
                }

                // 12/02/2012 - Daniel, please note the following:
                // - The syntax below takes you to the Index page, however it passes as a parameter the ID
                // which is essential to have the code value list for the previously selected Code Type
                // - I am not sure what happens when an object has to be sent back.
                //
                return(RedirectToAction("Index", "CodeValue", new { id = codeValue.FKCodeType }));
            }
            catch (Exception ex)
            {
                ModelState.AddModelError("Error", "An unexpected error occurred: " + ex);

                return(View());
            }
        }