public void SetDetialFromOrg(LevelDetailEntity detail, LevelConfigEntity entity) { Pagination page = new Pagination(); var configList = configApp.GetItemList(page, "1"); detail.F_Id = entity.F_Id; detail.c_level = entity.c_level; detail.LevelName = configList.Find(t => t.c_key == detail.c_level).c_value; detail.c_need_nums = entity.c_need_nums; detail.c_need_level = entity.c_need_level; var needLeve = configList.Find(t => t.c_key == detail.c_need_level); if (needLeve != null) { detail.needLevelName = needLeve.c_value; } detail.c_level_num = entity.c_level_num; detail.c_recomm_reward = entity.c_recomm_reward; detail.c_buy_reward = entity.c_buy_reward; detail.c_is_delete = entity.c_is_delete; detail.c_create_date = entity.c_create_date; detail.F_CreatorTime = entity.F_CreatorTime; detail.F_CreatorUserId = entity.F_CreatorUserId; detail.F_LastModifyTime = entity.F_LastModifyTime; detail.F_LastModifyUserId = entity.F_LastModifyUserId; detail.F_DeleteTime = entity.F_DeleteTime; detail.F_DeleteUserId = entity.F_DeleteUserId; detail.F_DeleteMark = entity.F_DeleteMark; }
public HttpResponseMessage DoCreate([FromBody] LevelConfigEntity LevelConfig) { if (!string.IsNullOrEmpty(LevelConfig.Name) && !string.IsNullOrEmpty(LevelConfig.Describe) && !string.IsNullOrEmpty(LevelConfig.Value)) { var levelconfigModel = new LevelConfigEntity { Name = LevelConfig.Name, Describe = LevelConfig.Describe, Value = LevelConfig.Value, Uptime = DateTime.Now, Addtime = DateTime.Now, }; try { if (_levelconfigService.Create(levelconfigModel) != null) { return(PageHelper.toJson(PageHelper.ReturnValue(true, "数据添加成功!"))); } } catch { return(PageHelper.toJson(PageHelper.ReturnValue(false, "数据添加失败!"))); } } return(PageHelper.toJson(PageHelper.ReturnValue(false, "数据验证错误!"))); }
public LevelDetailEntity GetDetailForm(string keyValue) { LevelConfigEntity entity = GetForm(keyValue); LevelDetailEntity detail = new LevelDetailEntity(); SetDetialFromOrg(detail, entity); return(detail); }
public void SubmitForm(LevelConfigEntity userEntity, string keyValue) { if (!string.IsNullOrEmpty(keyValue)) { userEntity.Modify(keyValue); } else { userEntity.Create(); } service.SubmitForm(userEntity, keyValue); }
public LevelConfigEntity Update(LevelConfigEntity entity) { try { _levelconfigRepository.Update(entity); return(entity); } catch (Exception e) { _log.Error(e, "数据库操作出错"); return(null); } }
public bool Delete(LevelConfigEntity entity) { try { _levelconfigRepository.Delete(entity); return(true); } catch (Exception e) { _log.Error(e, "数据库操作出错"); return(false); } }
public HttpResponseMessage DoEdit([FromBody] LevelConfigEntity LevelConfig) { if (LevelConfig != null && !string.IsNullOrEmpty(LevelConfig.Id.ToString()) && PageHelper.ValidateNumber(LevelConfig.Id.ToString()) && !string.IsNullOrEmpty(LevelConfig.Name) && !string.IsNullOrEmpty(LevelConfig.Describe) && !string.IsNullOrEmpty(LevelConfig.Value)) { var levelconfigModel = _levelconfigService.GetLevelConfigById(LevelConfig.Id); levelconfigModel.Name = LevelConfig.Name; levelconfigModel.Describe = LevelConfig.Describe; levelconfigModel.Value = LevelConfig.Value; levelconfigModel.Uptime = DateTime.Now; try { if (_levelconfigService.Update(levelconfigModel) != null) { return(PageHelper.toJson(PageHelper.ReturnValue(true, "数据更新成功!"))); } } catch { return(PageHelper.toJson(PageHelper.ReturnValue(false, "数据更新失败!"))); } } return(PageHelper.toJson(PageHelper.ReturnValue(false, "数据验证错误!"))); }
public ActionResult SubmitLevelForm(LevelConfigEntity commEntity, string keyValue) { levelApp.SubmitForm(commEntity, keyValue); return(Success("操作成功。")); }
public void UpdateForm(LevelConfigEntity userEntity) { service.Update(userEntity); }