示例#1
0
 public void setInitPinState()
 {
     InitialVal = "";
     PinState   = "";
     if (this.Type != 0)
     {
         tblFunction _tblfunction = tblSolution.m_tblSolution().GetFunctionFromType(this.Type);
         if (_tblfunction != null)
         {
             for (int i = 0; i < _tblfunction.m_tblFormalParameterCollection.Count; i++)
             {
                 InitialVal += _tblfunction.m_tblFormalParameterCollection[i].InitializeValue;
                 InitialVal += ";";
                 if ((_tblfunction.m_tblFormalParameterCollection[i].Class == (int)VarClass.Input) ||
                     (_tblfunction.m_tblFormalParameterCollection[i].Class == (int)VarClass.InOut) ||
                     (_tblfunction.m_tblFormalParameterCollection[i].Class == (int)VarClass.Output))
                 {
                     PinState += "TRUE";
                     PinState += ";";
                 }
                 else
                 {
                     PinState += "FALSE";
                     PinState += ";";
                 }
             }
             // InitialVal.Remove(InitialVal.Length - 1);
         }
     }
 }
        /// <remarks>Represents the foreign key object</remarks>
        //private tblSolution _SolutionID_tblSolution;

        //[Description("Represents the foreign key object of the type SolutionID")]
        //public tblSolution m_SolutionID_tblSolution
        //{
        //    get
        //    {
        //        return _SolutionID_tblSolution;
        //    }
        //    set
        //    {
        //        _SolutionID_tblSolution = value;
        //    }
        //}


        public override bool Load()
        {
            bool ret = true;

            //List<long> idlist = new List<long>();
            if (Common.Conn == null)
            {
                Common.Conn = new SQLiteConnection(Common.ConnectionString);
                Common.Conn.Open();
            }
            SQLiteDataReader myReader  = null;
            SQLiteCommand    myCommand = new SQLiteCommand();

            //if (_SqlConnectionConnection.State == System.Data.ConnectionState.Open)
            //    _SqlConnectionConnection.Close();
            //_SqlConnectionConnection.ConnectionString = Common.ConnectionString;
            //_SqlConnectionConnection.Open();

            try
            {
                myReader = null;
                myCommand.CommandText = @"SELECT * FROM [tblFunction] ;";
                myCommand.Connection  = Common.Conn;
                myReader = myCommand.ExecuteReader();
                while (myReader.Read())
                {
                    tblFunction tblfunction = new tblFunction();
                    tblfunction.m_SolutionID_tblSolution = this.m_SolutionID_tblSolution;
                    tblfunction.AddFromRecordSet(myReader);
                    this.Add(tblfunction);
                }

                myReader.Close();
                myCommand.Dispose();
                //_SqlConnectionConnection.Close();
                //int count = idlist.Count;
                //foreach( long id in idlist)// (int i = 0; i < count ; i++)
                //{
                //    tblFunction tblfunction = new tblFunction();
                //    tblfunction.FunctionID = id;// idlist[i];
                //    tblfunction.m_SolutionID_tblSolution = this.m_SolutionID_tblSolution;
                //    tblfunction.Select();
                //    //tblfunction.m_tblFormalParameterCollection.Load(_connectionstring, tblfunction.FunctionID);
                //    this.Add(tblfunction);
                //}
                //"SELECT [FunctionName], [Description], [Type], [IsStandard], [FunctionGroup], [Extensible], [IsFunction], [Body], [Language] FROM [tblFunction] WHERE [FunctionID]=@FunctionID ";
            }
            catch (SQLiteException ae)
            {
                System.Windows.Forms.MessageBox.Show(ae.Message);
                return(false);
            }



            return(ret);
        }
        //private tblSolution _SolutionID_tblSolution;

        //[Description("Represents the foreign key object of the type SolutionID")]
        //public tblSolution m_SolutionID_tblSolution
        //{
        //    get
        //    {
        //        return _SolutionID_tblSolution;
        //    }
        //    set
        //    {
        //        _SolutionID_tblSolution = value;
        //    }
        //}
        #endregion

        #region Public Methods

        public tblFunction(tblFunction ToCopy)
        {
            _FunctionName  = ToCopy._FunctionName;
            _FunctionID    = ToCopy._FunctionID;
            _SolutionID    = ToCopy._SolutionID;
            _Description   = ToCopy._Description;
            _Type          = ToCopy._Type;
            _IsStandard    = ToCopy._IsStandard;
            _FunctionGroup = ToCopy._FunctionGroup;
            _Extensible    = ToCopy._Extensible;
            _IsFunction    = ToCopy._IsFunction;

            _Language   = ToCopy._Language;
            _Overloaded = ToCopy._Overloaded;
            _Width      = ToCopy._Width;
            foreach (tblFormalParameter tblformalparameter in ToCopy.m_tblFormalParameterCollection)
            {
                this.m_tblFormalParameterCollection.Add(new tblFormalParameter(tblformalparameter));
            }
        }
示例#4
0
 public bool Contains(tblFunction item)
 {
     return(List.Contains(item));
 }
示例#5
0
 public int IndexOf(tblFunction item)
 {
     return(List.IndexOf(item));
 }
示例#6
0
 public void Insert(int index, tblFunction item)
 {
     List.Insert(index, item);
     this.OntblFunctionChanged(EventArgs.Empty);
 }
示例#7
0
 public void Remove(tblFunction item)
 {
     List.Remove(item);
     this.OntblFunctionChanged(EventArgs.Empty);
 }
示例#8
0
 public void Add(tblFunction item)
 {
     List.Add(item);
     this.OntblFunctionChanged(EventArgs.Empty);
 }
示例#9
0
 public tblUDFBDBLOCKCollection(tblFunction _parent)
 {
     _FunctionID_tblFunction = _parent;
 }
 public long IDOf(tblFunction item)
 {
     return(((tblFunction)List[List.IndexOf(item)]).FunctionID);
 }
 public tblUDFBDPinConnectionCollection(tblFunction _parent)
 {
     _FunctionID_tblFunction = _parent;
 }
示例#12
0
 public tblFBDAlarmOrderCollection(tblFunction _parent)
 {
     _FunctionID_tblFunction = _parent;
 }
示例#13
0
 public tblFormalParameterCollection(tblFunction _parent)
 {
     _FunctionID_tblFunction = _parent;
 }