Exemplo n.º 1
0
        public int InsertNewImage(
            string ID,
            DateTime TimeCapture,
            string ImagePath,
            System.Drawing.Rectangle ROI,
            System.Drawing.Rectangle ROIGerber,
            string Type
            )
        {
            Table.ImageSaved resultTbl = new Table.ImageSaved();
            string           cmd       = string.Format("INSERT INTO {0} ({1}) values({2});",
                                                       resultTbl.TableName,
                                                       // --------------
                                                       resultTbl.ID + "," +
                                                       resultTbl.TimeCapture + "," +
                                                       resultTbl.ImagePath + "," +
                                                       resultTbl.ROI + "," +
                                                       resultTbl.ROIGerber + "," +
                                                       resultTbl.Type,

                                                       //--------------
                                                       "\'" + ID + "\'," +
                                                       "\'" + TimeCapture.ToString("yyyy-MM-dd HH:mm:ss") + "\'," +
                                                       "\'" + ImagePath + "\'," +
                                                       "\'" + string.Format("{0},{1},{2},{3}", ROI.X, ROI.Y, ROI.Width, ROI.Height) + "\'," +
                                                       "\'" + string.Format("{0},{1},{2},{3}", ROIGerber.X, ROIGerber.Y, ROIGerber.Width, ROIGerber.Height) + "\'," +
                                                       "\'" + Type + "\'"
                                                       );

            return(mCtl.ExecuteCmd(mConn, cmd));
        }
Exemplo n.º 2
0
        public void InitImageTbl()
        {
            Table.ImageSaved imgTbl = new Table.ImageSaved();
            string           cmd    = string.Format("CREATE TABLE IF NOT EXISTS {0} ({1});",
                                                    imgTbl.TableName,
                                                    imgTbl.ID + " TEXT," +
                                                    imgTbl.TimeCapture + " TEXT," +
                                                    imgTbl.ImagePath + " TEXT," +
                                                    imgTbl.ROI + " TEXT," +
                                                    imgTbl.ROIGerber + " TEXT," +
                                                    imgTbl.Type + " TEXT"
                                                    );

            mCtl.ExecuteCmd(mConn, cmd);
        }