示例#1
0
        public ActionResult postAlertSet()
        {
            dynamic result = new ExpandoObject();


            ssql = " select * from LRTIAlertMail where type = 'isal' ";
            LRTIAlertMail inst = dbDapper.QuerySingleOrDefault <LRTIAlertMail>(ssql);

            if (inst.value == "Y")
            {
                inst.value = "N";
            }
            else
            {
                inst.value = "Y";
            }

            //更新成功才回傳
            if (dbDapper.Update(inst))
            {
                result.result   = "OK";
                result.AlertSet = inst.value;
            }



            return(Content(JsonConvert.SerializeObject(result), "application/json"));
            //return Json(JsonConvert.SerializeObject(result), "application/json", JsonRequestBehavior.AllowGet);

            //return this.Json(result, JsonRequestBehavior.AllowGet);
            //return JsonConvert.SerializeObject(result);
        }
示例#2
0
        public ActionResult getAlertSet()
        {
            dynamic result = new ExpandoObject();


            ssql = " select * from LRTIAlertMail where type = 'isal' ";
            LRTIAlertMail inst = dbDapper.QuerySingleOrDefault <LRTIAlertMail>(ssql);

            result.AlertSet = inst.value;

            return(Content(JsonConvert.SerializeObject(result), "application/json"));
        }