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);
                }
            }
        }
        public bool SaveNewFlowProperties(SinoSZToolFlowDesign.DOL.Flow_BaseDefine flow_BaseDefine)
        {
            string _insertStr = "insert into [FLOW_ENTITYTYPE]";

            _insertStr += " ([ID],[FLOWNAME],[DESCRIPTION],[ROOTDWID]) values (@ID,@FLOWNAME,@DESCRIPTION,@ROOTDWID) ";
            using (OleDbConnection cn = OpenConnection(connectString))
            {
                try
                {
                    OleDbCommand _cmd = new OleDbCommand(_insertStr, cn);
                    _cmd.Parameters.Add(new OleDbParameter("@ID", flow_BaseDefine.ID));
                    _cmd.Parameters.Add(new OleDbParameter("@FLOWNAME", flow_BaseDefine.FlowName));
                    _cmd.Parameters.Add(new OleDbParameter("@DESCRIPTION", flow_BaseDefine.Description));
                    _cmd.Parameters.Add(new OleDbParameter("@ROOTDWID", Double.Parse(flow_BaseDefine.RootDWID)));
                    _cmd.ExecuteNonQuery();
                    cn.Close();
                    return(true);
                }
                catch (Exception e)
                {
                    //写系统错误日志
                    throw e;
                    return(false);
                }
            }
        }
        public List <SinoSZToolFlowDesign.DOL.Flow_StateDefine> GetFlowStatusByFlow(SinoSZToolFlowDesign.DOL.Flow_BaseDefine flow_BaseDefine)
        {
            List <Flow_StateDefine> _ret = new List <Flow_StateDefine>();

            string _sql = "select [ID],[STATENAME],[STATEDISPLAYNAME],[STATEDESCRIPT],[STATETYPE],[DISPLAYORDER] ";

            _sql += " FROM [FLOW_ENTITYSTATUS] where [FLOWID] = @FLOWID";

            using (OleDbConnection cn = OpenConnection(connectString))
            {
                try
                {
                    OleDbCommand _cmd = new OleDbCommand(_sql, cn);
                    _cmd.Parameters.Add(new OleDbParameter("@FLOWID", flow_BaseDefine.ID));
                    OleDbDataReader dr = _cmd.ExecuteReader();
                    while (dr.Read())
                    {
                        Flow_StateDefine _fd = new Flow_StateDefine(dr.IsDBNull(0) ? "" : dr.GetString(0),
                                                                    dr.IsDBNull(1) ? "" : dr.GetString(1),
                                                                    dr.IsDBNull(2) ? "" : dr.GetString(2),
                                                                    dr.IsDBNull(3) ? "" : dr.GetString(3),
                                                                    dr.IsDBNull(4) ? "" : dr.GetString(4),
                                                                    dr.IsDBNull(5) ? 0 : Convert.ToInt32(dr.GetDecimal(5))
                                                                    );
                        _ret.Add(_fd);
                    }
                    dr.Close();
                    cn.Close();
                    return(_ret);
                }
                catch (Exception e)
                {
                    throw e;
                    //写系统错误日志
                    return(null);
                }
            }
        }