Exemplo n.º 1
0
 /// <summary>
 /// 修改数据字典节点名称
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public CustomResult DicUpdate(NodeViewModel model)
 {
     OT_Dic modelDic = new OT_Dic();
     modelDic.Id = model.DictId;
     modelDic.Name = model.Name;
     modelDic.Belong = (byte)EDicParentId.Holiday;
     return dataDictionary.Update(modelDic);
 }
        public JsonResult UpdateHoliday(NodeViewModel model)
        {
            CustomResult result = new CustomResult();
            if (string.IsNullOrEmpty(model.Name))
            {
                result.ResultKey = (byte)ENodeAddResult.Exist;
                result.ResultValue = Wttech.DataSubmitted.Common.Resources.TipInfo.InputHolidayName;
                return Json(result, JsonRequestBehavior.DenyGet);
            }

            result = ReportFactory.Instance.DicUpdate(model);

            //精确假期名称存在提示信息
            if (result.ResultKey == (byte)ENodeAddResult.Exist)
            {
                result.ResultValue = Wttech.DataSubmitted.Common.Resources.TipInfo.HolidayExist;
            }

            else if (result.ResultKey == (byte)EResult.Succeed)
            {
                ReportFactory.Instance.log.WriteLog(Common.OperationType.Update, string.Format("编辑了假期名称{0}", model.Name));
            }
            return Json(result, JsonRequestBehavior.DenyGet);
        }