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

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

            try
            {
                myReader = null;

                myCommand.CommandText = @"SELECT * FROM [tblADText]  WHERE [DisplayID]= " + m_DisplayID_tblDisplay.DisplayID + " order by oIndex;";

                myCommand.Connection = Common.Conn;
                myReader             = myCommand.ExecuteReader();
                while (myReader.Read())
                {
                    //idlist.Add(myReader.GetInt64(myReader.GetOrdinal("ADTextID")));
                    tblADText tbladtext = new tblADText();
                    tbladtext.m_DisplayID_tblDisplay = this.m_DisplayID_tblDisplay;
                    tbladtext.AddFromRecordSet(myReader);
                    Add(tbladtext);
                }

                myReader.Close();
                myCommand.Dispose();
                // _SqlConnectionConnection.Close();

                //foreach (long id in idlist)// (int i = 0; i < count ; i++)
                //{
                //    tblADText tbladtext = new tblADText();
                //    tbladtext.ADTextID = id;
                //    tbladtext.m_DisplayID_tblDisplay = this.m_DisplayID_tblDisplay;
                //    tbladtext.Select();

                //    Add(tbladtext);
                //}
            }
            catch (SQLiteException ae)
            {
                System.Windows.Forms.MessageBox.Show(ae.Message);
                return(false);
            }



            return(ret);
        }
        public bool SaveDisplay()
        {
            bool   ret = true;
            string str = "";


            //m_tblLineCollection.Clear();
            //m_tblBitmapCollection.Clear();
            //m_tblRectCollection.Clear();
            //m_tblPolylineCollection.Clear();
            //m_tblADTextCollection.Clear();
            int i = 0;

            // this.Update();
            foreach (DrawObject o in Pages.GraphicPagesList[0].List)
            {
                i++;
                if (o.Dirty)
                {
                    str = o.GetType().ToString();
                    switch (str)
                    {
                    case "DCS.Draw.Curve":
                        o.Save(this.DisplayID, Pages.ActivePageNo);
                        break;

                    case "DCS.Draw.DrawEllipse":
                        o.Save(this.DisplayID, i);
                        break;

                    case "DCS.Draw.DrawImage":
                        o.Save(this.DisplayID, i);
                        break;

                    case "DCS.Draw.DrawLine":
                        o.Save(this.DisplayID, i);
                        break;

                    case "DCS.Draw.DrawPolyLine":
                        o.Save(this.DisplayID, i);
                        break;

                    case "DCS.Draw.DrawPolygon":
                        o.Save(this.DisplayID, i);
                        break;

                    case "DCS.Draw.DrawCurve":
                        o.Save(this.DisplayID, i);
                        break;

                    case "DCS.Draw.DrawRectangle":
                        o.Save(this.DisplayID, i);
                        break;

                    case "DCS.Draw.DrawText":
                        o.Save(this.DisplayID, i);
                        break;
                    }
                }
            }

            foreach (DeleteListStruc deleteliststruc in Pages.Parenttabgraphicpagecontrol.DeleteList)
            {
                if (deleteliststruc.ID != -1)
                {
                    switch ((STATIC_OBJ_TYPE)deleteliststruc.Type)
                    {
                    case STATIC_OBJ_TYPE.ID_BITMAP:
                        tblBitmap tblbitmap = new tblBitmap();
                        tblbitmap.ID = deleteliststruc.ID;
                        tblbitmap.Delete();
                        break;

                    case STATIC_OBJ_TYPE.ID_ANATEXT:
                    case STATIC_OBJ_TYPE.ID_TEXT:
                        tblADText tbladtext = new tblADText();
                        tbladtext.ID = deleteliststruc.ID;
                        tbladtext.Delete();
                        break;

                    case STATIC_OBJ_TYPE.ID_LINE:
                        tblLine tblline = new tblLine();
                        tblline.ID = deleteliststruc.ID;
                        tblline.Delete();
                        break;

                    case STATIC_OBJ_TYPE.ID_ELLIPS:
                    case STATIC_OBJ_TYPE.ID_ROUNDRECT:
                    case STATIC_OBJ_TYPE.ID_RECT:
                        tblRect tblRect = new tblRect();
                        tblRect.ID = deleteliststruc.ID;
                        tblRect.Delete();
                        break;

                    case STATIC_OBJ_TYPE.ID_POLYLINE:
                        tblPolyline tblpolyline = new tblPolyline();
                        tblpolyline.ID = deleteliststruc.ID;
                        tblpolyline.Delete();
                        break;

                    case STATIC_OBJ_TYPE.ID_POLYGON:
                        tblPolygon tblpolygon = new tblPolygon();
                        tblpolygon.ID = deleteliststruc.ID;
                        tblpolygon.Delete();
                        break;

                    case STATIC_OBJ_TYPE.ID_CURVE:
                        tblCurve tblcurve = new tblCurve();
                        tblcurve.ID = deleteliststruc.ID;
                        tblcurve.Delete();
                        break;
                    }
                }
            }
            Pages.Parenttabgraphicpagecontrol.DeleteList.Clear();

            return(ret);
        }
Example #3
0
 public bool Contains(tblADText item)
 {
     return(List.Contains(item));
 }
Example #4
0
 public int IndexOf(tblADText item)
 {
     return(List.IndexOf(item));
 }
Example #5
0
 public void Insert(int index, tblADText item)
 {
     List.Insert(index, item);
     this.OntblADTextChanged(EventArgs.Empty);
 }
Example #6
0
 public void Remove(tblADText item)
 {
     List.Remove(item);
     this.OntblADTextChanged(EventArgs.Empty);
 }
Example #7
0
 public void Add(tblADText item)
 {
     List.Add(item);
     this.OntblADTextChanged(EventArgs.Empty);
 }