Esempio n. 1
0
        public JsonResult Create(Transport model)
        {
            try
            {
                if (!ModelState.IsValid)
                {
                    return(Json(new { Result = "ERROR", Message = "Form is not valid! Please correct it and try again." }));
                }
                model.dtDateAdd    = DateTime.Now;
                model.kTransportId = Guid.NewGuid();

                TransportManager.Create(model);
                return(Json(new { Result = "OK", Record = model }));
            }
            catch (Exception ex)
            {
                return(Json(new { Result = "ERROR", Message = ex.Message }));
            }
        }