Ejemplo n.º 1
0
        public bool SaveFlowState(SinoSZToolFlowDesign.DOL.Flow_StateDefine flow_StateDefine)
        {
            string _updateStr = "update  [FLOW_ENTITYSTATUS]";

            _updateStr += " set [STATENAME]=@STATENAME,[STATEDISPLAYNAME]=@STATEDISPLAYNAME,[STATEDESCRIPT]=@STATEDESCRIPT,[STATETYPE]=@STATETYPE, ";
            _updateStr += " [DISPLAYORDER]=@DISPLAYORDER where [ID]=@ID";


            using (OleDbConnection cn = OpenConnection(connectString))
            {
                try
                {
                    OleDbCommand _cmd = new OleDbCommand(_updateStr, cn);
                    _cmd.Parameters.Add(new OleDbParameter("@STATENAME", flow_StateDefine.Name));
                    _cmd.Parameters.Add(new OleDbParameter("@STATEDISPLAYNAME", flow_StateDefine.DisplayName));
                    _cmd.Parameters.Add(new OleDbParameter("@STATEDESCRIPT", flow_StateDefine.Description));
                    _cmd.Parameters.Add(new OleDbParameter("@STATETYPE", flow_StateDefine.Type));
                    _cmd.Parameters.Add(new OleDbParameter("@DISPLAYORDER", Convert.ToDouble(flow_StateDefine.Order)));
                    _cmd.Parameters.Add(new OleDbParameter("@ID", flow_StateDefine.ID));

                    _cmd.ExecuteNonQuery();
                    cn.Close();
                    return(true);
                }
                catch (Exception e)
                {
                    throw e;
                    //写系统错误日志
                    return(false);
                }
            }
        }
Ejemplo n.º 2
0
 public Flow_LocationStateMapItem(string _id, Flow_StateDefine _state, Flow_Location _location, decimal _type, string _meta)
 {
     id       = _id;
     state    = _state;
     location = _location;
     type     = _type;
     showMeta = _meta;
 }
Ejemplo n.º 3
0
 public Flow_StateActionDefine(string _actionID, string _actionName, string _actionTitle, Flow_StateDefine _beginState, Flow_StateDefine _endState,
                               string _actionType, int _userType, int _order, string _param)
 {
     actionID     = _actionID;
     actionName   = _actionName;
     actionTitle  = _actionTitle;
     beginState   = _beginState;
     endState     = _endState;
     actionType   = _actionType;
     userType     = _userType;
     displayOrder = _order;
     param        = _param;
 }
Ejemplo n.º 4
0
        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);
                }
            }
        }
Ejemplo n.º 5
0
        public bool SaveNewFlowState(SinoSZToolFlowDesign.DOL.Flow_BaseDefine flow_BaseDefine, SinoSZToolFlowDesign.DOL.Flow_StateDefine flow_StateDefine)
        {
            string _insertStr = "insert into [FLOW_ENTITYSTATUS]";

            _insertStr += " ([ID],[FLOWID],[STATENAME],[STATEDISPLAYNAME],[STATEDESCRIPT],[STATETYPE],[DISPLAYORDER]) ";
            _insertStr += " values (@ID,@FLOWID,@STATENAME,@STATEDISPLAYNAME,@STATEDESCRIPT,@STATETYPE,@DISPLAYORDER) ";



            using (OleDbConnection cn = OpenConnection(connectString))
            {
                try
                {
                    OleDbCommand _cmd = new OleDbCommand(_insertStr, cn);
                    _cmd.Parameters.Add(new OleDbParameter("@ID", flow_StateDefine.ID));
                    _cmd.Parameters.Add(new OleDbParameter("@FLOWID", flow_BaseDefine.ID));
                    _cmd.Parameters.Add(new OleDbParameter("@STATENAME", flow_StateDefine.Name));
                    _cmd.Parameters.Add(new OleDbParameter("@STATEDISPLAYNAME", flow_StateDefine.DisplayName));
                    _cmd.Parameters.Add(new OleDbParameter("@STATEDESCRIPT", flow_StateDefine.Description));
                    _cmd.Parameters.Add(new OleDbParameter("@STATETYPE", flow_StateDefine.Type));
                    _cmd.Parameters.Add(new OleDbParameter("@DISPLAYORDER", Convert.ToDouble(flow_StateDefine.Order)));
                    _cmd.ExecuteNonQuery();
                    cn.Close();
                    return(true);
                }
                catch (Exception e)
                {
                    throw e;
                    //写系统错误日志
                    return(false);
                }
            }
        }