Esempio n. 1
0
        public IHttpActionResult DeleteRelationUserAttentionPeriodical([FromBody]RelationUserAttentionPeriodicalModel model)
        {
            WebModelIsSucceed isSucceed = new WebModelIsSucceed();
            try
            {

                int i = relationUserAttentionPeriodicalAdapter.Remove(model);
                if (i > 0)
                {
                    isSucceed.IsSucceed = true;
                }
                else
                {
                    isSucceed.IsSucceed = false;
                    isSucceed.ErrorMessage = "无操作记录!";
                }
                return Json(isSucceed);
            }
            catch (Exception ex)
            {
                isSucceed.IsSucceed = false;
                isSucceed.ErrorMessage = ex.Message + "\r\n" + ex.StackTrace;
                return Json(isSucceed);
            }

        }
Esempio n. 2
0
        public IHttpActionResult AddOrUpdateAttentionUserCollectPeriodical([FromBody]RelationUserCollectPeriodicalModel model)
        {
            WebModelIsSucceed isSucceed = new WebModelIsSucceed();
            try
            {
                RelationUserAttentionPeriodicalModel Model = relationUserAttentionPeriodicalAdapter.GetAll().Where(w => w.UUID == model.UUID).FirstOrDefault();
                if (Model == null)//添加
                {
                    Model = new  RelationUserAttentionPeriodicalModel();
                    Model.UUID = Guid.NewGuid();
                }
                Model.CreateTime = model.CreateTime;
                Model.PeriodicalID = model.PeriodicalID;
                Model.PeriodicalName = model.PeriodicalName;
                Model.SysUserID = model.SysUserID;
                Model.ValidStatus = model.ValidStatus;
                int i = relationUserAttentionPeriodicalAdapter.AddOrUpdate(Model);
                if (i > 0)
                {
                    isSucceed.IsSucceed = true;
                }
                else
                {
                    isSucceed.IsSucceed = false;
                    isSucceed.ErrorMessage = "无操作记录!";
                }
                return Json(isSucceed);
            }
            catch (Exception ex)
            {
                isSucceed.IsSucceed = false;
                isSucceed.ErrorMessage = ex.Message + "\r\n" + ex.StackTrace;
                return Json(isSucceed);
            }

        }