/// <summary> /// 通过活动名称选择一个动作 /// 动作名为空,返回所有动作 /// </summary> /// <param name="actionName">动作名</param> /// <returns></returns> public List<Actions> GetActionByActionName(string actionName) { ActionDao ad = new ActionDao(); Actions action = new Actions(); action.Where = string.IsNullOrEmpty(actionName) ? "" : "LoweredActionName = " + actionName.ToLower(); return ad.Select(action); }
public static ActionBusiness Map(ActionDao action) { return(new ActionBusiness { Id = action.Id, Name = action.Name, Value = action.Value, Person = action.Person != null?PersonMapper.Map(action.Person) : null }); }
/// <summary> /// 启用动作 /// </summary> /// <param name="action"></param> /// <returns></returns> public int EnableAction(Actions action) { ActionDao ad = new ActionDao(); action.Status = (int)DataStatusEnum.Enabled; return ad.Update(action); }
/// <summary> /// 创建一个动作 /// </summary> /// <param name="action"></param> /// <returns></returns> public int CreateAction(Actions action) { ActionDao ad = new ActionDao(); return ad.Insert(action); }