예제 #1
0
        public SessionGameGroupGameOrder(DsnConnection odbc, DataSet dataset)
            : base(odbc, dataset
                   , dataset.Tables[SessionTable.TableName] as XDataTable
                   , new MySQLRelationMap(new object[] {
            dataset.Tables[SessionTable.TableName] as XDataTable
            , MySQLRelationMap.MapOp.SaveRelationPoint
            , MySQLRelationMap.MapOp.FollowTo
            , PackGroupTable.TableName
            , MySQLRelationMap.MapOp.InvokNameChangeEvent
            , MySQLRelationMap.MapOp.FollowTo
            , GameTable.TableName
            , MySQLRelationMap.MapOp.InvokNameChangeEvent
        }).ToString()
                   //, ".session_has_game_group.\\game_group_in_session$/game_group_has_game.\\game_in_game_group$"
                   , false
                   , false
                   , new DataColumn[] { new DataColumn("game_number", typeof(int))
                                        , new DataColumn("ball_timer", typeof(int))
                                        , new DataColumn("overlap_prior", typeof(bool))
                                        , new DataColumn("progressive", typeof(bool))
                                        , new DataColumn("bonanza", typeof(bool))
                                        , new DataColumn("wild", typeof(bool))
                                        , new DataColumn("double_wild", typeof(bool))
                                        , new DataColumn("blind", typeof(bool))
                                        , new DataColumn("single_hotball", typeof(bool))
                                        , new DataColumn(ColorInfoTable.PrimaryKey, XDataTable.DefaultAutoKeyType) }
                   )
        {
            foreach (string name in DataColumns)
            {
                this.Columns[name].AllowDBNull  = false;
                this.Columns[name].DefaultValue = 0;
            }
            if (dataset != null)
            {
                DataTable child;
                dataset.Relations.Add(SessionGameGroupGameOrder.color_name = MySQLDataTable.StripPlural(MySQLDataTable.StripInfo(SessionGameGroupGameOrder.TableName))
                                                                             + "_is_"
                                                                             + MySQLDataTable.StripPlural(MySQLDataTable.StripInfo(ColorInfoTable.TableName))
                                      , dataset.Tables[ColorInfoTable.TableName].Columns[ColorInfoTable.PrimaryKey]
                                      , (child = dataset.Tables[SessionGameGroupGameOrder.TableName]).Columns[ColorInfoTable.PrimaryKey]
                                      );
                ForeignKeyConstraint fkc = child.Constraints[color_name] as ForeignKeyConstraint;
                if (fkc != null)
                {
                    fkc.DeleteRule = Rule.SetNull;
                }
            }

            number_column = NumberColumn;
            AddingRow    += new OnNewRow(initrow);
            FixupRow     += new OnFixupRow(SessionGameGroupGameOrder_FixupRow);

            //Create();
            //base.Fill(null, NumberColumn+",overlap_prior");

            ColumnChanged += new DataColumnChangeEventHandler(SessionGameGroupGameOrder_ColumnChanged);
        }
예제 #2
0
        void Init()
        {
            base.TableName = TableName;
            //Columns.Add( "Name", typeof( string ) );
            //Columns.Add( SessionPrizeOrder.NumberColumn, typeof( int ) );

            AddingRow += new OnNewRow(initrow);

            FixupRow        += new OnFixupRow(SessionGameGroupPrizeOrder_FixupRow);
            this.RowChanged += new DataRowChangeEventHandler(SessionPrizeMetaRelation_RowChanging);
            //Create();
        }
예제 #3
0
        public void SetSource(OnNewRow ondata, int keep)
        {
            Stream data;

            if (!Document.sources.TryGetValue("xl/sharedStrings.xml", out data))
            {
                data = new OoXmlStringsStream(Document.words);
                Document.sources["xl/sharedStrings.xml"] = data;
            }
            sst   = (OoXmlStringsStream)data;
            sdata = new OoXmlDataStream(this, keep, ondata);
            Document.sources[Stream.zfe.FilenameInZip] = sdata;
        }
예제 #4
0
        public SessionGameOrder(DsnConnection odbc, DataSet dataset)
            : base(odbc, dataset
                   , new DataColumn[] { new DataColumn("ball_timer", typeof(int))
                                        , new DataColumn("overlap_prior", typeof(bool))
                                        , new DataColumn("progressive", typeof(bool))
                                        , new DataColumn("bonanza", typeof(bool))
                                        , new DataColumn("wild", typeof(bool))
                                        , new DataColumn("double_wild", typeof(bool))
                                        , new DataColumn("blind", typeof(bool))
                                        , new DataColumn("single_hotball", typeof(bool))
                                        , new DataColumn(ColorInfoTable.PrimaryKey, XDataTable.DefaultAutoKeyType) }
                   )
        {
            if (dataset != null)
            {
                DataTable child;

                /*
                 * dataset.Relations.Add( SessionGameGroupGameOrder.color_name = MySQLDataTable.StripPlural( MySQLDataTable.StripInfo( SessionGameGroupGameOrder.TableName ) )
                 + "_is_"
                 + MySQLDataTable.StripPlural( MySQLDataTable.StripInfo( ColorInfoTable.TableName ) )
                 + , dataset.Tables[ColorInfoTable.TableName].Columns[ColorInfoTable.PrimaryKey]
                 + , ( child = dataset.Tables[SessionGameGroupGameOrder.TableName] ).Columns[ColorInfoTable.PrimaryKey]
                 + );
                 + ForeignKeyConstraint fkc = child.Constraints[color_name] as ForeignKeyConstraint;
                 + if( fkc != null )
                 + fkc.DeleteRule = Rule.SetNull;
                 */
            }

            //number_column = NumberColumn;
            AddingRow += new OnNewRow(initrow);
            FixupRow  += new OnFixupRow(SessionGameGroupGameOrder_FixupRow);

            //Create();
            //base.Fill(null, NumberColumn+",overlap_prior");

            ColumnChanged += new DataColumnChangeEventHandler(SessionGameGroupGameOrder_ColumnChanged);
        }
예제 #5
0
 public OoXmlDataStream(gSheet sheet, int Keep,OnNewRow dr)
     : base()
 {
     string separator = Guid.NewGuid().ToString();
     sheet.LoadInMemory();                                                                                               // Make sure that the sheet is loaded in memory
     XmlDocument d = sheet.Stream.ReadAsXml();                                                                           // Load as XML
     XmlNamespaceManager nsmgr = new XmlNamespaceManager(d.NameTable);                                                   // Set the name space    
     nsmgr.AddNamespace("aa", "http://schemas.openxmlformats.org/spreadsheetml/2006/main");                              // To Open XML
     XmlNode ws = d.SelectSingleNode("//aa:worksheet/aa:sheetData", nsmgr);                                              // Locate data NODE
     if (ws == null) throw new Exception("Could not find sheet data");                                                   // Error if not
     XmlNode r = ws.FirstChild; while (Keep > 0 && r != null) { r = r.NextSibling; Keep--; }                             // Skip rows to keep
     if (r != null) InitializeColumns(r);                                                                                // if present use first row NOT to keep to initialize columns
     ws.AppendChild(d.CreateNode(XmlNodeType.Comment, "SEPARATOR", null)).InnerText = separator;                         // Add separator mark up
     InitializeHeaderAndFooter(d.OuterXml, separator);                                                                   // Get header and footer using separator
     rowopen1= ASCIIEncoding.ASCII.GetBytes("<row r=\"");                                                                // <row r="
     sstpart  = ASCIIEncoding.ASCII.GetBytes("\" t=\"s");                                                                // " t="s 
     rowopen2 = ASCIIEncoding.ASCII.GetBytes("\">\n");                                                                   // ">
     rowclose = ASCIIEncoding.ASCII.GetBytes("</row>\n");                                                                // </row>
   
     srsheet = sheet;                                                                                                    // Sheet this stream is linked to
     onrow = dr;                                                                                                         // On data callback
 }
예제 #6
0
        public OoXmlDataStream(gSheet sheet, int Keep, OnNewRow dr)
            : base()
        {
            string separator = Guid.NewGuid().ToString();

            sheet.LoadInMemory();                                                                                               // Make sure that the sheet is loaded in memory
            XmlDocument         d     = sheet.Stream.ReadAsXml();                                                               // Load as XML
            XmlNamespaceManager nsmgr = new XmlNamespaceManager(d.NameTable);                                                   // Set the name space

            nsmgr.AddNamespace("aa", "http://schemas.openxmlformats.org/spreadsheetml/2006/main");                              // To Open XML
            XmlNode ws = d.SelectSingleNode("//aa:worksheet/aa:sheetData", nsmgr);                                              // Locate data NODE

            if (ws == null)
            {
                throw new Exception("Could not find sheet data");                                                               // Error if not
            }
            XmlNode r = ws.FirstChild; while (Keep > 0 && r != null)

            {
                r = r.NextSibling; Keep--;
            }                                                                                                                   // Skip rows to keep

            if (r != null)
            {
                InitializeColumns(r);                                                                                           // if present use first row NOT to keep to initialize columns
            }
            ws.AppendChild(d.CreateNode(XmlNodeType.Comment, "SEPARATOR", null)).InnerText = separator;                         // Add separator mark up
            InitializeHeaderAndFooter(d.OuterXml, separator);                                                                   // Get header and footer using separator
            rowopen1 = ASCIIEncoding.ASCII.GetBytes("<row r=\"");                                                               // <row r="
            sstpart  = ASCIIEncoding.ASCII.GetBytes("\" t=\"s");                                                                // " t="s
            rowopen2 = ASCIIEncoding.ASCII.GetBytes("\">\n");                                                                   // ">
            rowclose = ASCIIEncoding.ASCII.GetBytes("</row>\n");                                                                // </row>

            srsheet = sheet;                                                                                                    // Sheet this stream is linked to
            onrow   = dr;                                                                                                       // On data callback
        }
예제 #7
0
 public void SetSource(OnNewRow ondata, int keep)
 {
     Stream data;
     if (!Document.sources.TryGetValue("xl/sharedStrings.xml", out data))
     {
         data=new OoXmlStringsStream(Document.words);
         Document.sources["xl/sharedStrings.xml"] = data;
     }
     sst = (OoXmlStringsStream)data;
     sdata = new OoXmlDataStream(this, keep, ondata);
     Document.sources[Stream.zfe.FilenameInZip] = sdata;
 }