Exemple #1
0
        /// <summary>
        /// 得到按钮显示标题(多语言时)
        /// </summary>
        /// <param name="language">语言</param>
        /// <param name="flowButton">按钮实体</param>
        /// <param name="note">输出备注</param>
        /// <returns></returns>
        public string GetLanguageTitle(Model.FlowButton flowButton, out string note, string language = "zh-CN")
        {
            note = string.Empty;
            if (null == flowButton)
            {
                return(string.Empty);
            }
            string title = string.Empty;

            switch (language)
            {
            case "en-US":
                title = flowButton.Title_en;
                note  = flowButton.Note_en;
                break;

            case "zh":
                title = flowButton.Title_zh;
                note  = flowButton.Note_zh;
                break;

            default:
                title = flowButton.Title;
                note  = flowButton.Note;
                break;
            }
            return(title);
        }
Exemple #2
0
 /// <summary>
 /// 更新按钮
 /// </summary>
 /// <param name="flowButton">按钮实体</param>
 public int Update(Model.FlowButton flowButton)
 {
     ClearCache();
     using (var db = new DataContext())
     {
         db.Update(flowButton);
         return(db.SaveChanges());
     }
 }
Exemple #3
0
 public string Save(Model.FlowButton flowButtonModel)
 {
     if (!ModelState.IsValid)
     {
         return(Tools.GetValidateErrorMessag(ModelState));
     }
     Business.FlowButton flowButton = new Business.FlowButton();
     if (Request.Querys("buttonid").IsGuid(out Guid guid))
     {
         var    oldModel = flowButton.Get(guid);
         string oldJSON  = null == oldModel ? "" : oldModel.ToString();
         flowButton.Update(flowButtonModel);
         Business.Log.Add("修改了流程按钮-" + flowButtonModel.Title, type: Business.Log.Type.流程管理, oldContents: oldJSON, newContents: flowButtonModel.ToString());
     }
     else
     {
         flowButton.Add(flowButtonModel);
         Business.Log.Add("添加了流程按钮-" + flowButtonModel.Title, flowButtonModel.ToString(), Business.Log.Type.流程管理);
     }
     return("保存成功!");
 }
Exemple #4
0
        public IActionResult Edit()
        {
            string buttonId = Request.Querys("buttonid");

            Business.FlowButton flowButton      = new Business.FlowButton();
            Model.FlowButton    flowButtonModel = null;
            if (buttonId.IsGuid(out Guid bid))
            {
                flowButtonModel = flowButton.Get(bid);
            }
            if (null == flowButtonModel)
            {
                flowButtonModel = new Model.FlowButton
                {
                    Id   = Guid.NewGuid(),
                    Sort = flowButton.GetMaxSort()
                };
            }
            ViewData["queryString"] = Request.UrlQuery();
            return(View(flowButtonModel));
        }
Exemple #5
0
 /// <summary>
 /// 更新按钮
 /// </summary>
 /// <param name="flowButton">按钮实体</param>
 public int Update(Model.FlowButton flowButton)
 {
     return(flowButtonData.Update(flowButton));
 }
Exemple #6
0
 /// <summary>
 /// 添加一个按钮
 /// </summary>
 /// <param name="flowButton">按钮实体</param>
 /// <returns></returns>
 public int Add(Model.FlowButton flowButton)
 {
     return(flowButtonData.Add(flowButton));
 }