Beispiel #1
0
        public ActionResult proc()
        {
            var json = new StreamReader(Request.Body).ReadToEnd();
            var data = JsonConvert.DeserializeObject <JGN_Dictionary>(json);

            if (DictionaryBLL.CheckValue(_context, data.value, data.type))
            {
                return(Ok(new { status = "error", message = SiteConfig.generalLocalizer["_record_exist"].Value }));
            }
            if (data.id > 0)
            {
                // Update Operation
                DictionaryBLL.Update(_context, data);
            }
            else
            {
                // Add Operation
                data = DictionaryBLL.Add(_context, data);
            }

            return(Ok(new { status = "success", record = data, message = SiteConfig.generalLocalizer["_records_processed"].Value }));
        }