예제 #1
0
        public ActionResult Create(CurrencyDTO model)
        {
            try
            {
                // Remove white space
                model.Symbol = RemoveSpecChar(model.Symbol);

                //=============================

                string msg    = "";
                bool   result = _factory.CreateOrEdit(model, CurrentUser.UserId, ref msg);
                if (result)
                {
                    return(RedirectToAction("Index"));
                }
                else
                {
                    ModelState.AddModelError("Name", msg);
                    Response.StatusCode = (int)HttpStatusCode.BadRequest;
                    return(View(model));
                }
            }
            catch (Exception ex)
            {
                NSLog.Logger.Error("Currency_Create: ", ex);
                return(new HttpStatusCodeResult(400, ex.Message));
            }
        }