Exemple #1
0
        public JsonResult DeleteNotify(int id)
        {
            var bll     = new ExamNotifyBll();
            var success = bll.ExecuteTransation(
                () => bll.Delete(id),
                () => DataUpdateLog.SingleUpdate(nameof(ExamNotify), id, DataUpdateType.Delete)
                );

            return(Json(success ? ErrorModel.OperateSuccess : ErrorModel.OperateFailed));
        }
Exemple #2
0
        public JsonResult UpdateNotify(string json)
        {
            var model = JsonHelper.Deserialize <ExamNotify>(json);

            if (null != model)
            {
                var bll     = new ExamNotifyBll();
                var success = bll.ExecuteTransation(
                    () => bll.Update(model),
                    () => DataUpdateLog.SingleUpdate(nameof(ExamNotify), model.Id, DataUpdateType.Update)
                    );

                return(Json(success ? ErrorModel.OperateSuccess : ErrorModel.OperateFailed));
            }

            return(Json(ErrorModel.InputError));
        }