예제 #1
0
        private void readTableBWEntry(List <tableRow> MapTex, BinaryReader reader)
        {
            tableRow item = new tableRow
            {
                tileset      = reader.ReadUInt32(),
                mapTerrainId = reader.ReadUInt16().ToString(),
                scripts      = reader.ReadUInt16(),
                scriptB      = reader.ReadUInt16(),
                texts        = reader.ReadUInt16(),
                musicA       = reader.ReadUInt16(),
                musicB       = reader.ReadUInt16(),
                musicC       = reader.ReadUInt16(),
                musicD       = reader.ReadUInt16(),
                encount      = reader.ReadUInt16(),
                mapId        = reader.ReadUInt16(),
                zoneId       = reader.ReadUInt16(),
                unk          = reader.ReadUInt16(),
                cameraAngle  = reader.ReadUInt16(),
                flag         = reader.ReadUInt16(),
                cameraAngle2 = reader.ReadUInt16(),
                flytoX       = reader.ReadUInt32(),
                flytoZ       = reader.ReadUInt32(),
                flytoY       = reader.ReadUInt32(),
                unk3         = reader.ReadUInt16()
            };

            MapTex.Add(item);
        }
        private DataRow _createRow(tableRow row, DataTable data)
        {
            DataRow newRow = data.NewRow();

            newRow["confidence"] = row.confidence;
            newRow["game"]       = row.game;
            return(newRow);
        }
예제 #3
0
        private void readTableHGSSEntry(List <tableRow> MapTex, BinaryReader reader, BinaryReader reader3, int id)
        {
            tableRow item = new tableRow();

            item.headerId   = id;
            item.tex_ext    = reader.ReadByte();
            item.tex_int    = reader.ReadByte();
            item.map_matrix = reader.ReadInt16();
            item.scripts    = reader.ReadInt16();
            item.trainers   = reader.ReadInt16();
            item.texts      = reader.ReadInt16();
            item.musicA     = reader.ReadUInt16();
            item.musicB     = reader.ReadUInt16();
            item.events     = reader.ReadInt16();
            item.name       = reader.ReadByte();
            item.encount    = reader.ReadInt16();
            reader.ReadByte();
            item.weather     = reader.ReadByte();
            item.cameraAngle = reader.ReadByte();
            item.nameStyle   = reader.ReadByte();
            item.flag        = reader.ReadByte();
            MapTex.Add(item);
        }
예제 #4
0
        /*Unit Implementation in Web Services - End*/
        //Method to fetch the table module details
        /*Unit Implementation in Web Services - Begin*/
        //Added a new parameter - strUnit
        public List<table> getTableData(double dStnLat, double dStnLong, int iAtl, int iMaxDist, int iMaxAltDiff, IRuleSets objIRuleset, string strNode, string strNodeName, string strCultureCode, string strServiceName, string strModuleName, string strLangID,string strUnit)
        {
            DataSet dsTbl = new DataSet();
            objTableSvc.setTableWebServiceValues(dStnLat, dStnLong, iAtl, iMaxDist, iMaxAltDiff);
            /*Unit Implementation in Web Services - Begin*/
            dsTbl = objTblPre.getTableDataForService(strNode, strNodeName, objIRuleset, strServiceName, strModuleName, strCultureCode, strUnit);
            /*Unit Implementation in Web Services - End*/
            List<table> tablelist = new List<table>();
            table tbl;
            tableRow tr = new tableRow();
            tableCell tc;
            HeaderRow hr1 = new HeaderRow();
            HeaderRow hr2 = new HeaderRow();
            HeaderCell hc;

            if (dsTbl.Tables[0].TableName.ToLower().Contains("header") && dsTbl.Tables.Count == 2)
            {
                tbl = new table();
                tbl.HeaderRows = new List<HeaderRow>();
                tbl.TableName = dsTbl.Tables[1].TableName;

                hr1.HeaderCells = new List<HeaderCell>();
                hr2.HeaderCells = new List<HeaderCell>();
                int count = 0;
                string day = "";
                string prevVal = "";
                foreach (DataRow dr in dsTbl.Tables[0].Rows)
                {
                    if (count == 0)
                    {
                        hc = new HeaderCell();
                        hc.Value = "";
                        hc.Colspan = "1";
                        hr1.HeaderCells.Add(hc);
                        hc = new HeaderCell();
                        hc.Value = "";
                        hc.Colspan = "1";
                        hr2.HeaderCells.Add(hc);
                    }
                    if (prevVal != dr[0].ToString().Split(',')[0] && !(dr[0].ToString().Split(',')[1].EndsWith("0")))
                    {
                        hc = new HeaderCell();
                        day = DateTime.Parse(dr[0].ToString().Split(',')[0].ToString()).DayOfWeek.ToString();
                        hc.Value = day;
                        hc.Colspan = dr[1].ToString();
                        hr1.HeaderCells.Add(hc);
                        prevVal = dr[0].ToString().Split(',')[0];
                    }
                    HeaderCell hc1 = new HeaderCell();
                    hc1.Value = dr[0].ToString().Split(',')[1].ToString();
                    hc1.Colspan = "1";
                    hr2.HeaderCells.Add(hc1);
                    count++;
                }
                tbl.HeaderRows.Add(hr1);
                tbl.HeaderRows.Add(hr2);

                tbl.tableRows = new List<tableRow>();
                foreach (DataRow dr in dsTbl.Tables[1].Rows)
                {
                    tr = new tableRow();
                    tr.tableCells = new List<tableCell>();
                    for (int i = 0; i < (dsTbl.Tables[1].Columns.Count/3); i++)
                    {
                        tc = new tableCell();
                        tc.Value = dr[0 + (i * 3)].ToString();
                        tc.ToolTip = dr[1 + (i * 3)].ToString();
                        tc.bgColor = dr[2 + (i * 3)].ToString();
                        if (i == 0)
                        {
                            tc.Color = "";
                            tc.CellImage = "";
                        }
                        else
                        {
                            Color bgColor = new Color();
                            bgColor = ColorTranslator.FromHtml(tc.bgColor);
                            tc.Color = ColorTranslator.FromHtml("#" + objCommonUtil.ContrastColor(bgColor).Name).Name;
                            /********IM01144144 - New Agricast Webservices - icons URL - BEGIN ***************************/
                            //tc.CellImage = objCommonUtil.toBase64(GetImage(tc.Value, tc.Color, tc.bgColor));
                            tc.CellImage = GetImage(tc.Value, tc.Color, tc.bgColor);
                            /********IM01144144 - New Agricast Webservices - icons URL - END ***************************/
                        }
                        if (i == 0)
                            tc.Header = "true";
                        else
                            tc.Header = "";
                        tr.tableCells.Add(tc);
                    }
                    tbl.tableRows.Add(tr);
                }

                tablelist.Add(tbl);
            }
            else
            {
                foreach (DataTable dt in dsTbl.Tables)
                {
                    tbl = new table();
                    tbl.HeaderRows = new List<HeaderRow>();
                    tbl.TableName = dt.TableName.ToString();

                    hr1.HeaderCells = new List<HeaderCell>();
                    for (int i = 0; i < (dt.Columns.Count / 3);i++ )
                    {
                        hc = new HeaderCell();
                        if (i == 0)
                            hc.Value = objLocSearchSvc.getTranslatedText("hour", strLangID);
                        else
                            hc.Value = (i-1).ToString();
                        hc.Colspan = "1";
                        hr1.HeaderCells.Add(hc);
                    }
                    tbl.HeaderRows.Add(hr1);

                    tbl.tableRows = new List<tableRow>();
                    foreach (DataRow dr in dt.Rows)
                    {
                        tr = new tableRow();
                        tr.tableCells = new List<tableCell>();
                        for (int i = 0; i < (dr.Table.Columns.Count/3); i++)
                        {
                            tc = new tableCell();
                            tc.Value = dr[0 + (i * 3)].ToString();
                            tc.ToolTip = dr[1 + (i * 3)].ToString();
                            tc.bgColor = dr[2 + (i * 3)].ToString();
                            if (i == 0)
                            {
                                tc.Color = "";
                                tc.CellImage = "";
                            }
                            else
                            {
                                Color bgColor = new Color();
                                bgColor = ColorTranslator.FromHtml(tc.bgColor);
                                tc.Color = ColorTranslator.FromHtml("#" + objCommonUtil.ContrastColor(bgColor).Name).Name;
                                /********IM01144144 - New Agricast Webservices - icons URL - BEGIN ***************************/
                                //tc.CellImage =  objCommonUtil.toBase64(GetImage(tc.Value, tc.Color, tc.bgColor));
                                tc.CellImage = GetImage(tc.Value, tc.Color, tc.bgColor);
                                /********IM01144144 - New Agricast Webservices - icons URL - END ***************************/
                            }
                            if (i == 0)
                                tc.Header = "true";
                            else
                                tc.Header = "";
                            tr.tableCells.Add(tc);
                        }
                        tbl.tableRows.Add(tr);
                    }

                    tablelist.Add(tbl);
                }
            }
             return tablelist;
        }