コード例 #1
0
        /// <summary>
        /// 保存
        /// </summary>
        /// <param name="flowActionEntity"></param>
        /// <returns></returns>
        public bool AddFlowAction(FlowActionEntity flowActionEntity)
        {
            bool flag = false;

            DbCommand cmd = db.GetStoredProcCommand("UP_AddFlowAction");

            db.AddInParameter(cmd,"@JournalID",DbType.Int64,flowActionEntity.JournalID);
            db.AddInParameter(cmd, "@StatusID", DbType.Int64, flowActionEntity.StatusID);
            db.AddInParameter(cmd,"@ActionName",DbType.AnsiString,flowActionEntity.ActionName);
            db.AddInParameter(cmd,"@DisplayName",DbType.AnsiString,flowActionEntity.DisplayName);
            db.AddInParameter(cmd,"@ActionType",DbType.Byte,flowActionEntity.ActionType);
            db.AddInParameter(cmd, "@CStatus", DbType.Int32, flowActionEntity.CStatus);
            db.AddInParameter(cmd, "@ActionRoleID", DbType.Int64, flowActionEntity.ActionRoleID);
            db.AddInParameter(cmd, "@SMSTemplate", DbType.Int32, flowActionEntity.SMSTemplate);
            db.AddInParameter(cmd, "@EmailTemplate", DbType.Int32, flowActionEntity.EmailTemplate);
            db.AddInParameter(cmd, "@TOStatusID", DbType.Int64, flowActionEntity.TOStatusID);
            db.AddInParameter(cmd, "@Status", DbType.Byte, flowActionEntity.Status);
            db.AddInParameter(cmd, "@IsShowLog", DbType.Byte, flowActionEntity.IsShowLog);
            db.AddInParameter(cmd, "@IsRetractionSendMsg", DbType.Byte, flowActionEntity.IsRetractionSendMsg);
            db.AddInParameter(cmd, "@SortID", DbType.Int32, flowActionEntity.SortID);

            try
            {
                db.ExecuteNonQuery(cmd);
                flag = true;
            }
            catch(SqlException sqlEx)
            {
                throw sqlEx;
            }
            return flag;
        }
コード例 #2
0
 public ExecResult AddFlowAction(FlowActionEntity flowActionEntity)
 {
     ExecResult result = new ExecResult();
     try
     {
         IFlowActionService flowActionService = ServiceContainer.Instance.Container.Resolve<IFlowActionService>();
         bool flag = flowActionService.AddFlowAction(flowActionEntity);
         if (flag)
         {
             result.result = EnumJsonResult.success.ToString();
             result.msg = "成功";
         }
         else
         {
             result.result = EnumJsonResult.failure.ToString();
             result.msg = "添加审稿操作失败,请确认信息是否正确";
         }
     }
     catch (Exception ex)
     {
         result.result = EnumJsonResult.error.ToString();
         result.msg = "添加审稿操作时出现异常:" + ex.Message;
     }
     return result;
 }
コード例 #3
0
 public ActionResult AddFlowActionAjax(FlowActionEntity flowActionEntity)
 {
     ExecResult exeResult = new ExecResult();
     IFlowFacadeService service = ServiceContainer.Instance.Container.Resolve<IFlowFacadeService>();
     flowActionEntity.JournalID = JournalID;
     exeResult = service.AddFlowAction(flowActionEntity);
     return Content(JsonConvert.SerializeObject(exeResult));
 }
コード例 #4
0
        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="flowActionEntity"></param>
        /// <returns></returns>
        public bool UpdateFlowAction(FlowActionEntity flowActionEntity)
        {
            bool flag = false;
            StringBuilder whereCommandText = new StringBuilder();
            whereCommandText.Append(" ActionID=@ActionID AND JournalID=@JournalID AND StatusID=@StatusID");
            StringBuilder sqlCommandText = new StringBuilder();
            sqlCommandText.Append("ActionName=@ActionName");
            sqlCommandText.Append(", DisplayName=@DisplayName");
            sqlCommandText.Append(", ActionType=@ActionType");
            sqlCommandText.Append(", CStatus=@CStatus");
            sqlCommandText.Append(", ActionRoleID=@ActionRoleID");
            sqlCommandText.Append(", SMSTemplate=@SMSTemplate");
            sqlCommandText.Append(", EmailTemplate=@EmailTemplate");
            sqlCommandText.Append(", TOStatusID=@TOStatusID");
            sqlCommandText.Append(", Status=@Status");
            sqlCommandText.Append(", IsShowLog=@IsShowLog");
            sqlCommandText.Append(", IsRetractionSendMsg=@IsRetractionSendMsg");
            sqlCommandText.Append(", SortID=@SortID");

            DbCommand cmd = db.GetSqlStringCommand(String.Format("UPDATE dbo.FlowAction SET {0} WHERE  {1}",sqlCommandText.ToString(),whereCommandText.ToString()));

            db.AddInParameter(cmd,"@ActionID",DbType.Int64,flowActionEntity.ActionID);
            db.AddInParameter(cmd,"@JournalID",DbType.Int64,flowActionEntity.JournalID);
            db.AddInParameter(cmd, "@StatusID", DbType.Int64, flowActionEntity.StatusID);
            db.AddInParameter(cmd,"@ActionName",DbType.AnsiString,flowActionEntity.ActionName);
            db.AddInParameter(cmd,"@DisplayName",DbType.AnsiString,flowActionEntity.DisplayName);
            db.AddInParameter(cmd,"@ActionType",DbType.Byte,flowActionEntity.ActionType);
            db.AddInParameter(cmd, "@CStatus", DbType.Int32, flowActionEntity.CStatus);
            db.AddInParameter(cmd, "@ActionRoleID", DbType.Int64, flowActionEntity.ActionRoleID);
            db.AddInParameter(cmd, "@SMSTemplate", DbType.Int32, flowActionEntity.SMSTemplate);
            db.AddInParameter(cmd, "@EmailTemplate", DbType.Int32, flowActionEntity.EmailTemplate);
            db.AddInParameter(cmd, "@TOStatusID", DbType.Int64, flowActionEntity.TOStatusID);
            db.AddInParameter(cmd, "@Status", DbType.Byte, flowActionEntity.Status);
            db.AddInParameter(cmd, "@IsShowLog", DbType.Byte, flowActionEntity.IsShowLog);
            db.AddInParameter(cmd, "@IsRetractionSendMsg", DbType.Byte, flowActionEntity.IsRetractionSendMsg);
            db.AddInParameter(cmd, "@SortID", DbType.Int32, flowActionEntity.SortID);

            try
            {
                db.ExecuteNonQuery(cmd);
                flag = true;
            }
            catch(SqlException sqlEx)
            {
                throw sqlEx;
            }
            return flag;
        }
コード例 #5
0
 public List<FlowActionEntity> MakeFlowActionList(IDataReader dr)
 {
     List<FlowActionEntity> list=new List<FlowActionEntity>();
     FlowActionEntity flowActionEntity = null;
     while (dr.Read())
     {
         flowActionEntity = new FlowActionEntity();
         flowActionEntity.ActionID = (Int64)dr["ActionID"];
         flowActionEntity.JournalID = (Int64)dr["JournalID"];
         flowActionEntity.StatusID = (Int64)dr["StatusID"];
         flowActionEntity.ActionName = (String)dr["ActionName"];
         flowActionEntity.DisplayName = (String)dr["DisplayName"];
         flowActionEntity.ActionType = (Byte)dr["ActionType"];
         flowActionEntity.CStatus = (Int32)dr["CStatus"];
         flowActionEntity.ActionRoleID = TypeParse.ToLong(dr["ActionRoleID"], 0);
         flowActionEntity.SMSTemplate = (Int32)dr["SMSTemplate"];
         flowActionEntity.EmailTemplate = (Int32)dr["EmailTemplate"];
         flowActionEntity.TOStatusID = (Int64)dr["TOStatusID"];
         flowActionEntity.SortID = (Int32)dr["SortID"];
         flowActionEntity.Status = (Byte)dr["Status"];
         flowActionEntity.IsShowLog = (Byte)dr["IsShowLog"];
         flowActionEntity.IsRetractionSendMsg = (Byte)dr["IsRetractionSendMsg"];
         flowActionEntity.AddDate = (DateTime)dr["AddDate"];
         list.Add(flowActionEntity);
     }
     dr.Close();
     return list;
 }
コード例 #6
0
 public FlowActionEntity MakeFlowAction(DataRow dr)
 {
     FlowActionEntity flowActionEntity = new FlowActionEntity();
     flowActionEntity.ActionID = (Int64)dr["ActionID"];
     flowActionEntity.JournalID = (Int64)dr["JournalID"];
     flowActionEntity.StatusID = (Int64)dr["StatusID"];
     flowActionEntity.ActionName = (String)dr["ActionName"];
     flowActionEntity.DisplayName = (String)dr["DisplayName"];
     flowActionEntity.ActionType = (Byte)dr["ActionType"];
     flowActionEntity.CStatus = (Int32)dr["CStatus"];
     flowActionEntity.SMSTemplate = (Int32)dr["SMSTemplate"];
     flowActionEntity.EmailTemplate = (Int32)dr["EmailTemplate"];
     flowActionEntity.TOStatusID = (Int64)dr["TOStatusID"];
     flowActionEntity.SortID = (Int32)dr["SortID"];
     flowActionEntity.Status = (Byte)dr["Status"];
     flowActionEntity.IsShowLog = (Byte)dr["IsShowLog"];
     flowActionEntity.IsRetractionSendMsg = (Byte)dr["IsRetractionSendMsg"];
     flowActionEntity.AddDate = (DateTime)dr["AddDate"];
     return flowActionEntity;
 }
コード例 #7
0
 public FlowActionEntity MakeFlowAction(IDataReader dr)
 {
     FlowActionEntity flowActionEntity = null;
     if (dr.Read())
     {
         flowActionEntity = new FlowActionEntity();
         flowActionEntity.ActionID = (Int64)dr["ActionID"];
         flowActionEntity.JournalID = (Int64)dr["JournalID"];
         flowActionEntity.StatusID = (Int64)dr["StatusID"];
         flowActionEntity.ActionName = (String)dr["ActionName"];
         flowActionEntity.DisplayName = (String)dr["DisplayName"];
         flowActionEntity.ActionType = (Byte)dr["ActionType"];
         flowActionEntity.CStatus = (Int32)dr["CStatus"];
         flowActionEntity.ActionRoleID = TypeParse.ToLong(dr["ActionRoleID"],0);
         flowActionEntity.SMSTemplate = (Int32)dr["SMSTemplate"];
         flowActionEntity.EmailTemplate = (Int32)dr["EmailTemplate"];
         flowActionEntity.TOStatusID = (Int64)dr["TOStatusID"];
         flowActionEntity.SortID = (Int32)dr["SortID"];
         flowActionEntity.Status = (Byte)dr["Status"];
         flowActionEntity.IsShowLog = (Byte)dr["IsShowLog"];
         flowActionEntity.IsRetractionSendMsg = (Byte)dr["IsRetractionSendMsg"];
         if(dr.HasColumn("AddDate"))
         {
             flowActionEntity.AddDate = (DateTime)dr["AddDate"];
         }
     }
     dr.Close();
     return flowActionEntity;
 }
コード例 #8
0
 /// <summary>
 /// 获取指定审稿状态下可以做的操作,带有权限
 /// </summary>
 /// <param name="query"></param>
 /// <returns></returns>
 public List<FlowActionEntity> GetFlowActionByStatus(FlowActionQuery query)
 {
     List<FlowActionEntity> list = new List<FlowActionEntity>();
     DbCommand cmd = db.GetStoredProcCommand("UP_GetHaveRightActionListByStatusID");
     db.AddInParameter(cmd, "@JournalID", DbType.Int64, query.JournalID);
     db.AddInParameter(cmd, "@StatusID", DbType.Int64, query.StatusID);
     db.AddInParameter(cmd, "@AuthorID", DbType.Int64, query.AuthorID);
     db.AddInParameter(cmd, "@RoleID", DbType.Int64, query.RoleID);
     using (IDataReader dr = db.ExecuteReader(cmd))
     {
         FlowActionEntity flowActionEntity = null;
         while (dr.Read())
         {
             flowActionEntity = new FlowActionEntity();
             flowActionEntity.ActionID = (Int64)dr["ActionID"];
             flowActionEntity.StatusID = (Int64)dr["StatusID"];
             flowActionEntity.ActionName = (String)dr["ActionName"];
             flowActionEntity.DisplayName = (String)dr["DisplayName"];
             flowActionEntity.ActionType = (Byte)dr["ActionType"];
             list.Add(flowActionEntity);
         }
         dr.Close();
     }
     return list;
 }
コード例 #9
0
        /// <summary>
        /// 删除对象
        /// </summary>
        /// <param name="flowActionEntity"></param>
        /// <returns></returns>
        public bool DeleteFlowAction(FlowActionEntity flowActionEntity)
        {
            bool flag = false;
            StringBuilder sqlCommandText = new StringBuilder();
            sqlCommandText.Append("DELETE FROM dbo.FlowAction");
            sqlCommandText.Append(" WHERE  ActionID=@ActionID AND JournalID=@JournalID AND StatusID=@StatusID");

            DbCommand cmd = db.GetSqlStringCommand(sqlCommandText.ToString());

            db.AddInParameter(cmd, "@ActionID",DbType.Int64,flowActionEntity.ActionID);
            db.AddInParameter(cmd, "@JournalID", DbType.Int64, flowActionEntity.JournalID);
            db.AddInParameter(cmd, "@StatusID", DbType.Int64, flowActionEntity.StatusID);

            try
            {
                db.ExecuteNonQuery(cmd);
                flag = true;
            }
            catch(SqlException sqlEx)
            {
                throw sqlEx;
            }
            return flag;
        }
コード例 #10
0
 /// <summary>
 /// 流转状态操作设置
 /// </summary>
 /// <returns></returns>
 public ActionResult FlowActionSet(long StatusID, long? ActionID)
 {
     FlowActionEntity actionEntity = null;
     if (ActionID == null)
     {
         actionEntity = new FlowActionEntity();
         actionEntity.JournalID = JournalID;
         actionEntity.StatusID = StatusID;
     }
     else
     {
         FlowActionQuery actionQuery = new FlowActionQuery();
         actionQuery.JournalID = JournalID;
         actionQuery.ActionID = ActionID.Value;
         IFlowFacadeService flowService = ServiceContainer.Instance.Container.Resolve<IFlowFacadeService>();
         actionEntity = flowService.GetFlowActionEntity(actionQuery);
     }
     return View(actionEntity);
 }
コード例 #11
0
 /// <summary>
 /// 新增审稿操作
 /// </summary>
 /// <param name="flowActionEntity"></param>
 /// <returns></returns>
 public ExecResult AddFlowAction(FlowActionEntity flowActionEntity)
 {
     HttpClientHelper clientHelper = new HttpClientHelper();
     ExecResult execResult = clientHelper.PostAuth<ExecResult, FlowActionEntity>(GetAPIUrl(APIConstant.FLOW_ADDFLOWACTION), flowActionEntity);
     return execResult;
 }
コード例 #12
0
 /// <summary>
 /// 从存储媒介删除实体数据
 /// </summary>
 /// <param name="flowAction">FlowActionEntity实体对象</param>
 /// <returns>true:删除成功 false:删除失败</returns>
 public bool DeleteFlowAction(FlowActionEntity flowAction)
 {
     return FlowActionBusProvider.DeleteFlowAction(flowAction);
 }
コード例 #13
0
 /// <summary>
 /// 将实体数据存入存储媒介(持久化一个对象)
 /// </summary>
 /// <param name="flowAction">FlowActionEntity实体对象</param>
 /// <returns>true:存储成功 false:存储失败</returns>
 public bool AddFlowAction(FlowActionEntity flowAction)
 {
     return FlowActionBusProvider.AddFlowAction(flowAction);
 }
コード例 #14
0
 /// <summary>
 /// 更新存储媒介中的实体数据
 /// </summary>
 /// <param name="flowAction">FlowActionEntity实体对象</param>
 /// <returns>true:更新成功 false:更新失败</returns>
 public bool UpdateFlowAction(FlowActionEntity flowAction)
 {
     return FlowActionBusProvider.UpdateFlowAction(flowAction);
 }
コード例 #15
0
 /// <summary>
 /// 更新
 /// </summary>
 /// <param name="flowAction">FlowActionEntity实体对象</param>
 /// <returns>true:更新成功 false:更新失败</returns>
 public bool UpdateFlowAction(FlowActionEntity flowAction)
 {
     return FlowActionDataAccess.Instance.UpdateFlowAction(flowAction);
 }
コード例 #16
0
 /// <summary>
 /// 将实体数据存入存储媒介(持久化一个对象)
 /// </summary>
 /// <param name="flowAction">FlowActionEntity实体对象</param>
 /// <returns>true:存储成功 false:存储失败</returns>
 public bool AddFlowAction(FlowActionEntity flowAction)
 {
     return FlowActionDataAccess.Instance.AddFlowAction(flowAction);
 }