public List <SinoSZToolFlowDesign.DOL.Flow_StateActionDefine> GetFlowStatusAction(SinoSZToolFlowDesign.DOL.Flow_StateDefine flow_StateDefine) { List <Flow_StateActionDefine> _ret = new List <Flow_StateActionDefine>(); string _sql = "select A.[ID],A.[ACTIONNAME],A.[ACTIONTITLE], "; _sql += "B.[ID],B.[STATENAME],B.[STATEDISPLAYNAME],B.[STATEDESCRIPT],B.[STATETYPE],B.[DISPLAYORDER], "; _sql += "A.[ACTIONTYPE],A.[USERTYPE],A.[DISPLAYORDER],A.[ACTIONPARAM] "; _sql += " FROM [FLOW_STATETRANSITION] A,[FLOW_ENTITYSTATUS] B where A.[STATEID] = @STATEID "; _sql += " and B.[ID] = A.[TARGETSTATEID] "; using (OleDbConnection cn = OpenConnection(connectString)) { try { OleDbCommand _cmd = new OleDbCommand(_sql, cn); _cmd.Parameters.Add(new OleDbParameter("@STATEID", flow_StateDefine.ID)); OleDbDataReader dr = _cmd.ExecuteReader(); while (dr.Read()) { Flow_StateDefine _endStateDefine = new Flow_StateDefine(dr.IsDBNull(3) ? "" : dr.GetString(3), dr.IsDBNull(4) ? "" : dr.GetString(4), dr.IsDBNull(5) ? "" : dr.GetString(5), dr.IsDBNull(6) ? "" : dr.GetString(6), dr.IsDBNull(7) ? "" : dr.GetString(7), dr.IsDBNull(8) ? 0 : Convert.ToInt32(dr.GetDecimal(8)) ); Flow_StateActionDefine _sa = new Flow_StateActionDefine(dr.IsDBNull(0) ? "" : dr.GetString(0), dr.IsDBNull(1) ? "" : dr.GetString(1), dr.IsDBNull(2) ? "" : dr.GetString(2), flow_StateDefine, _endStateDefine, dr.IsDBNull(9) ? "" : dr.GetString(9), dr.IsDBNull(10) ? 0 : Convert.ToInt32(dr.GetDecimal(10)), dr.IsDBNull(11) ? 0 : Convert.ToInt32(dr.GetDecimal(11)), dr.IsDBNull(12) ? "" : dr.GetString(12) ); _ret.Add(_sa); } dr.Close(); cn.Close(); return(_ret); } catch (Exception e) { throw e; //写系统错误日志 return(null); } } }
public List <Flow_StateActionDefine> GetFlowStatusAction(Flow_StateDefine flow_StateDefine) { List <Flow_StateActionDefine> _ret = new List <Flow_StateActionDefine>(); string _sql = "select A.ID,A.ACTIONNAME,A.ACTIONTITLE, "; _sql += "B.ID,B.STATENAME,B.STATEDISPLAYNAME,B.STATEDESCRIPT,B.STATETYPE,B.DISPLAYORDER, "; _sql += "A.ACTIONTYPE,A.USERTYPE,A.DISPLAYORDER,A.ACTIONPARAM "; _sql += " FROM FLOW_STATETRANSITION A,FLOW_ENTITYSTATUS B where A.STATEID = @STATEID "; _sql += " and B.ID = A.TARGETSTATEID "; SqlParameter[] _param = { new SqlParameter("@STATEID", SqlDbType.NVarChar, 50) }; _param[0].Value = flow_StateDefine.ID; try { SqlDataReader dr = SqlHelper.ExecuteReader(connectString, CommandType.Text, _sql, _param); while (dr.Read()) { Flow_StateDefine _endStateDefine = new Flow_StateDefine(dr.IsDBNull(3) ? "" : dr.GetString(3), dr.IsDBNull(4) ? "" : dr.GetString(4), dr.IsDBNull(5) ? "" : dr.GetString(5), dr.IsDBNull(6) ? "" : dr.GetString(6), dr.IsDBNull(7) ? "" : dr.GetString(7), dr.IsDBNull(8) ? 0 : Convert.ToInt32(dr.GetDecimal(8)) ); Flow_StateActionDefine _sa = new Flow_StateActionDefine(dr.IsDBNull(0) ? "" : dr.GetString(0), dr.IsDBNull(1) ? "" : dr.GetString(1), dr.IsDBNull(2) ? "" : dr.GetString(2), flow_StateDefine, _endStateDefine, dr.IsDBNull(9) ? "" : dr.GetString(9), dr.IsDBNull(10) ? 0 : Convert.ToInt32(dr.GetDecimal(10)), dr.IsDBNull(11) ? 0 : Convert.ToInt32(dr.GetDecimal(11)), dr.IsDBNull(12) ? "" : dr.GetString(12) ); _ret.Add(_sa); } dr.Close(); return(_ret); } catch (Exception e) { //写系统错误日志 return(null); } }
/// <summary> /// 新建状态动作 /// </summary> /// <param name="flow_StateActionDefine"></param> /// <returns></returns> public bool SaveNewStateAction(Flow_StateActionDefine flow_StateActionDefine) { string _insertStr = "insert into FLOW_STATETRANSITION"; _insertStr += " (ID,STATEID,ACTIONNAME,ACTIONTITLE,TARGETSTATEID,ACTIONTYPE,USERTYPE,DISPLAYORDER,ACTIONPARAM) "; _insertStr += " values (@ID,@STATEID,@ACTIONNAME,@ACTIONTITLE,@TARGETSTATEID,@ACTIONTYPE,@USERTYPE,@DISPLAYORDER,@ACTIONPARAM) "; SqlParameter[] _param2 = { new SqlParameter("@ID", SqlDbType.NVarChar, 50), new SqlParameter("@STATEID", SqlDbType.NVarChar, 50), new SqlParameter("@ACTIONNAME", SqlDbType.NVarChar, 50), new SqlParameter("@ACTIONTITLE", SqlDbType.NVarChar, 100), new SqlParameter("@TARGETSTATEID", SqlDbType.NVarChar, 50), new SqlParameter("@ACTIONTYPE", SqlDbType.NVarChar, 50), new SqlParameter("@USERTYPE", SqlDbType.Decimal), new SqlParameter("@DISPLAYORDER", SqlDbType.Decimal), new SqlParameter("@ACTIONPARAM", SqlDbType.NVarChar, 4000) }; _param2[1].Value = flow_StateActionDefine.BeginState.ID; _param2[2].Value = flow_StateActionDefine.ActionName; _param2[3].Value = flow_StateActionDefine.ActionTitle; _param2[4].Value = (flow_StateActionDefine.EndState == null) ? "" : flow_StateActionDefine.EndState.ID; _param2[5].Value = flow_StateActionDefine.ActionType; _param2[6].Value = Convert.ToDecimal(flow_StateActionDefine.UserType); _param2[7].Value = Convert.ToDecimal(flow_StateActionDefine.DisplayOrder); _param2[8].Value = flow_StateActionDefine.ParamDefine; _param2[0].Value = flow_StateActionDefine.ActionID; try { SqlHelper.ExecuteNonQuery(connectString, CommandType.Text, _insertStr, _param2); return(true); } catch { //写系统错误日志 return(false); } }
/// <summary> /// 保存状态动作定义 /// </summary> /// <param name="flow_StateActionDefine"></param> /// <returns></returns> public bool SaveStateAction(Flow_StateActionDefine flow_StateActionDefine) { string _updateStr = "update FLOW_STATETRANSITION"; _updateStr += " set STATEID=@STATEID,ACTIONNAME=@ACTIONNAME,ACTIONTITLE=@ACTIONTITLE,TARGETSTATEID=@TARGETSTATEID, "; _updateStr += " ACTIONTYPE=@ACTIONTYPE,USERTYPE=@USERTYPE,DISPLAYORDER=@DISPLAYORDER,ACTIONPARAM=@ACTIONPARAM "; _updateStr += " where ID=:ID"; SqlParameter[] _param2 = { new SqlParameter("@STATEID", SqlDbType.NVarChar, 50), new SqlParameter("@ACTIONNAME", SqlDbType.NVarChar, 50), new SqlParameter("@ACTIONTITLE", SqlDbType.NVarChar, 100), new SqlParameter("@TARGETSTATEID", SqlDbType.NVarChar, 50), new SqlParameter("@ACTIONTYPE", SqlDbType.NVarChar, 50), new SqlParameter("@USERTYPE", SqlDbType.Decimal), new SqlParameter("@DISPLAYORDER", SqlDbType.Decimal), new SqlParameter("@ACTIONPARAM", SqlDbType.NVarChar, 4000), new SqlParameter("@ID", SqlDbType.NVarChar, 50) }; _param2[0].Value = flow_StateActionDefine.BeginState.ID; _param2[1].Value = flow_StateActionDefine.ActionName; _param2[2].Value = flow_StateActionDefine.ActionTitle; _param2[3].Value = flow_StateActionDefine.EndState.ID; _param2[4].Value = flow_StateActionDefine.ActionType; _param2[5].Value = Convert.ToDecimal(flow_StateActionDefine.UserType); _param2[6].Value = Convert.ToDecimal(flow_StateActionDefine.DisplayOrder); _param2[7].Value = flow_StateActionDefine.ParamDefine; _param2[8].Value = flow_StateActionDefine.ActionID; try { SqlHelper.ExecuteNonQuery(connectString, CommandType.Text, _updateStr, _param2); return(true); } catch (Exception e) { //写系统错误日志 return(false); } }
public Biz_StateAction(Biz_FlowState _state, Flow_StateActionDefine _action) { _isNew = false; stateDefine = _state; _actionDefine = _action; }
public Biz_StateAction(string _id, Biz_FlowState _state) { _isNew = true; stateDefine = _state; _actionDefine = new Flow_StateActionDefine(_id, "NEWACTION", "新动作", _state.StateDefine, null, "业务流处理", 3, 0, ""); }