示例#1
0
        public ActionResult CreateDictValue(Int64 dictValueId = 0)
        {
            DictValueEntity model = null;
            if (dictValueId > 0)
            {
                DictValueQuery query = new DictValueQuery();
                query.JournalID = CurAuthor.JournalID;
                query.DictValueID = dictValueId;
                ISiteConfigFacadeService service = ServiceContainer.Instance.Container.Resolve<ISiteConfigFacadeService>();
                model = service.GetDictValueModel(query);
            }
            if (model == null)
            {
                model = new DictValueEntity();
            }

            return View(model);
        }
示例#2
0
 public ActionResult SaveDictValue(DictValueEntity model)
 {
     ISiteConfigFacadeService service = ServiceContainer.Instance.Container.Resolve<ISiteConfigFacadeService>();
     if (model.DictValueID == 0)
         model.InUserID = CurAuthor.AuthorID;
     else
         model.EditUserID = CurAuthor.AuthorID;
     model.JournalID = CurAuthor.JournalID;
     ExecResult result = service.SaveDictValue(model);
     return Json(new { result = result.result, msg = result.msg });
 }
示例#3
0
 /// <summary>
 /// 数据字典值是否已经存在
 /// </summary>
 /// <param name="model"></param>       
 /// <returns></returns>
 public bool DictValueIsExists(DictValueEntity model)
 {
     return DictValueDataAccess.Instance.DictValueIsExists(model);
 }
示例#4
0
 public ExecResult SaveDictValue(DictValueEntity model)
 {
     ExecResult execResult = new ExecResult();
     IDictValueService service = ServiceContainer.Instance.Container.Resolve<IDictValueService>();
     return service.Save(model);
 }
示例#5
0
 /// <summary>
 /// 将实体数据存入存储媒介(持久化一个对象)
 /// </summary>
 /// <param name="dictValue">DictValueEntity实体对象</param>
 /// <returns>true:存储成功 false:存储失败</returns>
 public bool AddDictValue(DictValueEntity dictValue)
 {
     return DictValueDataAccess.Instance.AddDictValue(dictValue);
 }
示例#6
0
 /// <summary>
 /// 从存储媒介删除实体数据
 /// </summary>
 /// <param name="dictValue">DictValueEntity实体对象</param>
 /// <returns>true:删除成功 false:删除失败</returns>
 public bool DeleteDictValue(DictValueEntity dictValue)
 {
     return DictValueDataAccess.Instance.DeleteDictValue(dictValue);
 }
示例#7
0
 /// <summary>
 /// 从存储媒介删除实体数据
 /// </summary>
 /// <param name="dictValue">DictValueEntity实体对象</param>
 /// <returns>true:删除成功 false:删除失败</returns>
 public bool DeleteDictValue(DictValueEntity dictValue)
 {
     return DictValueBusProvider.DeleteDictValue(dictValue);
 }
示例#8
0
 /// <summary>
 /// 更新存储媒介中的实体数据
 /// </summary>
 /// <param name="dictValue">DictValueEntity实体对象</param>
 /// <returns>true:更新成功 false:更新失败</returns>
 public bool UpdateDictValue(DictValueEntity dictValue)
 {
     return DictValueDataAccess.Instance.UpdateDictValue(dictValue);
 }
示例#9
0
 /// <summary>
 /// 将实体数据存入存储媒介(持久化一个对象)
 /// </summary>
 /// <param name="dictValue">DictValueEntity实体对象</param>
 /// <returns>true:存储成功 false:存储失败</returns>
 public bool AddDictValue(DictValueEntity dictValue)
 {
     return DictValueBusProvider.AddDictValue(dictValue);
 }
示例#10
0
 /// <summary>
 /// 更新存储媒介中的实体数据
 /// </summary>
 /// <param name="dictValue">DictValueEntity实体对象</param>
 /// <returns>true:更新成功 false:更新失败</returns>
 public bool UpdateDictValue(DictValueEntity dictValue)
 {
     return DictValueBusProvider.UpdateDictValue(dictValue);
 }
示例#11
0
 /// <summary>
 /// 保存数据字典值
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public ExecResult Save(DictValueEntity model)
 {
     ExecResult execResult = new ExecResult();
     model.DictKey = model.DictKey.TextFilter();
     if (DictValueIsExists(model))
     {
         execResult.result = EnumJsonResult.error.ToString();
         execResult.msg = "该数据字典值Value已存在!";
         return execResult;
     }
     bool result = false;
     model.ValueText = model.ValueText.TextFilter();
     if (model.DictValueID == 0)
     {
         result = AddDictValue(model);
         if (result)
         {
             execResult.result = EnumJsonResult.success.ToString();
             execResult.msg = "新增数据字典值成功!";
         }
         else
         {
             execResult.result = EnumJsonResult.failure.ToString();
             execResult.msg = "新增数据字典值失败!";
         }
     }
     else
     {
         result = UpdateDictValue(model);
         if (result)
         {
             execResult.result = EnumJsonResult.success.ToString();
             execResult.msg = "修改数据字典值成功!";
         }
         else
         {
             execResult.result = EnumJsonResult.failure.ToString();
             execResult.msg = "修改数据字典值失败!";
         }
     }
     return execResult;
 }
示例#12
0
 /// <summary>
 /// 数据字典值是否已经存在
 /// </summary>
 /// <param name="model"></param>       
 /// <returns></returns>
 public bool DictValueIsExists(DictValueEntity model)
 {
     return DictValueBusProvider.DictValueIsExists(model);
 }
 /// <summary>
 /// 保存数据字典值
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public ExecResult SaveDictValue(DictValueEntity model)
 {
     HttpClientHelper clientHelper = new HttpClientHelper();
     ExecResult result = clientHelper.Post<ExecResult, DictValueEntity>(GetAPIUrl(APIConstant.DICTVALUE_SAVE), model);
     return result;
 }