Exemplo n.º 1
0
        public ActionResult Ctype(string title, string real, string toman, string description)
        {
            ViewBag.Title = "ثبت نوع توکن جدید";
            TokenType tk = new TokenType();

            try
            {
                tk.Title       = title;
                tk.RealValue   = long.Parse(real);
                tk.TomanValue  = long.Parse(toman);
                tk.Description = description;
                tk.Add();
                return(RedirectToAction("Types", "Token"));
            }
            catch (Exception ex)
            {
                ErrorLog log = new ErrorLog();
                log.Description = ex.Message;
                if (ex.InnerException != null)
                {
                    log.Description += ";" + ex.Message;
                }
                log.ErrorDate = DateTime.Now;
                log.Add();
            }
            return(View(tk));
        }