コード例 #1
0
        public static Boolean exportTourData(String inSanctionId)
        {
            String        curMethodName = "exportTourData";
            StringBuilder curSqlStmt    = new StringBuilder("");
            StringBuilder curXml        = new StringBuilder("");
            Boolean       returnStatus  = false;

            try {
                curSqlStmt = new StringBuilder("");
                curXml.Append("<LiveWebRequest>");

                curSqlStmt = new StringBuilder("");
                curSqlStmt.Append("SELECT * FROM Tournament ");
                curSqlStmt.Append("Where SanctionId = '" + inSanctionId + "' ");
                curXml.Append(exportData("Tournament", new String[] { "SanctionId" }, curSqlStmt.ToString(), "Update"));

                curXml.Append("</LiveWebRequest>");
                SendMessageHttp.sendMessagePostXml(LiveWebLocation, curXml.ToString());
                Log.WriteFile(curMethodName + ":Connection successsful to " + LiveWebLocation + " for tournament " + inSanctionId);

                returnStatus = true;
            } catch (Exception ex) {
                returnStatus = false;
                MessageBox.Show("Error encountered trying to send data to web location \n\nError: " + ex.Message);
                Log.WriteFile(curMethodName + ":Exception=" + ex.Message);
            }

            return(returnStatus);
        }
コード例 #2
0
        public static Boolean exportCurrentSkierTrickVideo(String inSanctionId, String inMemberId, String inAgeGroup, byte inRound)
        {
            String        curMethodName = "exportCurrentSkierTrickVideo";
            StringBuilder curSqlStmt    = new StringBuilder("");
            StringBuilder curXml        = new StringBuilder("");
            Boolean       returnStatus  = false;

            try {
                curSqlStmt = new StringBuilder("");
                curXml.Append("<LiveWebRequest>");

                curSqlStmt = new StringBuilder("");
                curSqlStmt.Append("SELECT * FROM TrickVideo ");
                curSqlStmt.Append("Where SanctionId = '" + inSanctionId + "' And MemberId = '" + inMemberId + "' And AgeGroup = '" + inAgeGroup + "' ");
                curSqlStmt.Append("And Round = " + inRound);
                curXml.Append(exportData("TrickVideo", new String[] { "SanctionId", "MemberId", "AgeGroup", "Round" }, curSqlStmt.ToString(), "Insert"));

                curXml.Append("</LiveWebRequest>");
                SendMessageHttp.sendMessagePostXml(LiveWebLocation, curXml.ToString());
                returnStatus = true;
            } catch (Exception ex) {
                returnStatus = false;
                //MessageBox.Show( "Error encountered trying to send data to web location \n\nError: " + ex.Message );
                Log.WriteFile(curMethodName + ":Exception=" + ex.Message);
            }

            return(returnStatus);
        }
コード例 #3
0
        public static Boolean exportCurrentSkiersRunOrder(String inEvent, String inSanctionId, byte inRound, String inEventGroup)
        {
            String         curMethodName  = "exportCurrentSkiersRunOrder";
            StringBuilder  curSqlStmt     = new StringBuilder("");
            StringBuilder  curXml         = new StringBuilder("");
            String         curMsg         = "";
            Boolean        returnStatus   = false;
            int            curLineCount   = 0;
            DataTable      curDataTable   = new DataTable();
            ProgressWindow myProgressInfo = new ProgressWindow();

            try {
                curSqlStmt.Append("Select TR.SanctionId, TR.MemberId, TR.SkierName, TR.AgeGroup, ER.EventGroup, " + inRound + " as Round ");
                curSqlStmt.Append("From TourReg TR ");
                curSqlStmt.Append("Inner Join EventReg ER on ER.SanctionId = TR.SanctionId AND ER.MemberId = TR.MemberId ");
                curSqlStmt.Append("      AND TR.AgeGroup = ER.AgeGroup AND ER.Event = '" + inEvent + "' ");
                if (inRound > 0)
                {
                    curSqlStmt.Append("Inner Join EventRunOrder RO on RO.SanctionId = TR.SanctionId AND RO.MemberId = TR.MemberId ");
                    curSqlStmt.Append("      AND RO.AgeGroup = TR.AgeGroup AND RO.Event = ER.Event AND RO.Round = " + inRound + " ");
                }
                curSqlStmt.Append("Where TR.SanctionId = '" + inSanctionId + "' ");
                if (inEventGroup != null)
                {
                    if (inEventGroup.Equals("All"))
                    {
                    }
                    else if (inEventGroup.ToUpper().Equals("MEN A"))
                    {
                        curSqlStmt.Append("And ER.AgeGroup = 'CM' ");
                    }
                    else if (inEventGroup.ToUpper().Equals("WOMEN A"))
                    {
                        curSqlStmt.Append("And ER.AgeGroup = 'CW' ");
                    }
                    else if (inEventGroup.ToUpper().Equals("MEN B"))
                    {
                        curSqlStmt.Append("And ER.AgeGroup = 'BM' ");
                    }
                    else if (inEventGroup.ToUpper().Equals("WOMEN B"))
                    {
                        curSqlStmt.Append("And ER.AgeGroup = 'BW' ");
                    }
                    else if (inEventGroup.ToUpper().Equals("NON TEAM"))
                    {
                        curSqlStmt.Append("And ER.AgeGroup not in ('CM', 'CW', 'BM', 'BW') ");
                    }
                    else
                    {
                        curSqlStmt.Append("AND ER.EventGroup = '" + inEventGroup + "' ");
                    }
                }
                curSqlStmt.Append("Order by TR.SanctionId, ER.EventGroup, TR.MemberId, TR.AgeGroup");
                curDataTable = getData(curSqlStmt.ToString());

                myProgressInfo.setProgressMin(1);
                myProgressInfo.setProgressMax(curDataTable.Rows.Count);

                String curMemberId = "", curAgeGroup = "", curSkierName = "";
                byte   curRound = 0;
                foreach (DataRow curRow in curDataTable.Rows)
                {
                    curMemberId  = (String)curRow["MemberId"];
                    curAgeGroup  = (String)curRow["AgeGroup"];
                    curSkierName = (String)curRow["SkierName"];
                    curRound     = (byte)((int)curRow["Round"]);

                    curLineCount++;
                    myProgressInfo.setProgressValue(curLineCount);
                    myProgressInfo.setProgessMsg("Processing " + curSkierName);
                    myProgressInfo.Show();
                    myProgressInfo.Refresh();

                    curXml = new StringBuilder("");
                    curXml.Append("<LiveWebRequest>");

                    curSqlStmt = new StringBuilder("");
                    curSqlStmt.Append("SELECT * FROM TourReg ");
                    curSqlStmt.Append("Where SanctionId = '" + inSanctionId + "' And MemberId = '" + curMemberId + "' And AgeGroup = '" + curAgeGroup + "' ");
                    curXml.Append(exportData("TourReg", new String[] { "SanctionId", "MemberId", "AgeGroup" }, curSqlStmt.ToString(), "Update"));

                    curSqlStmt = new StringBuilder("");
                    curSqlStmt.Append("Select * from EventReg ");
                    curSqlStmt.Append("Where SanctionId = '" + inSanctionId + "' And MemberId = '" + curMemberId + "' And AgeGroup = '" + curAgeGroup + "' ");
                    curSqlStmt.Append("And Event = '" + inEvent + "' ");
                    curXml.Append(exportData("EventReg", new String[] { "SanctionId", "MemberId", "AgeGroup", "Event" }, curSqlStmt.ToString(), "Update"));

                    if (inRound > 0)
                    {
                        curSqlStmt = new StringBuilder("");
                        curSqlStmt.Append("Select * from EventRunOrder ");
                        curSqlStmt.Append("Where SanctionId = '" + inSanctionId + "' And MemberId = '" + curMemberId + "' And AgeGroup = '" + curAgeGroup + "' ");
                        curSqlStmt.Append("And Event = '" + inEvent + "' And Round = " + inRound);
                        curXml.Append(exportData("EventRunOrder", new String[] { "SanctionId", "MemberId", "AgeGroup", "Event", "Round" }, curSqlStmt.ToString(), "Update"));
                    }

                    curXml.Append("</LiveWebRequest>");
                    SendMessageHttp.sendMessagePostXml(LiveWebLocation, curXml.ToString());
                    returnStatus = true;
                }

                myProgressInfo.Close();
            } catch (Exception ex) {
                //MessageBox.Show( "Error encountered trying to send data to web location \n\nError: " + ex.Message );
                curMsg = curMethodName + ":Exception=" + ex.Message;
                Log.WriteFile(curMsg);
            }

            return(returnStatus);
        }
コード例 #4
0
        public static Boolean exportCurrentSkierJump(String inSanctionId, String inMemberId, String inAgeGroup, byte inRound, int inPassNum, String inEventGroup)
        {
            String        curMethodName = "exportCurrentSkierJump";
            StringBuilder curSqlStmt    = new StringBuilder("");
            StringBuilder curXml        = new StringBuilder("");
            Boolean       returnStatus  = false;

            try {
                curSqlStmt = new StringBuilder("");
                curXml.Append("<LiveWebRequest>");
                if (inPassNum > 1)
                {
                    curSqlStmt = new StringBuilder("");
                    curSqlStmt.Append("SELECT * FROM JumpScore ");
                    curSqlStmt.Append("Where SanctionId = '" + inSanctionId + "' And MemberId = '" + inMemberId + "' And AgeGroup = '" + inAgeGroup + "' ");
                    curSqlStmt.Append("And Round = " + inRound);
                    curXml.Append(exportData("JumpScore", new String[] { "SanctionId", "MemberId", "AgeGroup", "Round" }, curSqlStmt.ToString(), "Insert"));

                    curSqlStmt = new StringBuilder("");
                    curSqlStmt.Append("SELECT * FROM JumpRecap ");
                    curSqlStmt.Append("Where SanctionId = '" + inSanctionId + "' And MemberId = '" + inMemberId + "' And AgeGroup = '" + inAgeGroup + "' ");
                    if (inPassNum == 0)
                    {
                        curSqlStmt.Append("And Round = " + inRound);
                    }
                    else
                    {
                        curSqlStmt.Append("And Round = " + inRound + " And PassNum = " + inPassNum);
                    }
                    curXml.Append(exportData("JumpRecap", new String[] { "SanctionId", "MemberId", "AgeGroup", "Round", "PassNum" }, curSqlStmt.ToString(), "Insert"));
                }
                else
                {
                    curSqlStmt = new StringBuilder("");
                    curSqlStmt.Append("SELECT * FROM TourReg ");
                    curSqlStmt.Append("Where SanctionId = '" + inSanctionId + "' And MemberId = '" + inMemberId + "' And AgeGroup = '" + inAgeGroup + "' ");
                    curXml.Append(exportData("TourReg", new String[] { "SanctionId", "MemberId", "AgeGroup" }, curSqlStmt.ToString(), "Update"));

                    curSqlStmt = new StringBuilder("");
                    curSqlStmt.Append("Select * from EventReg ");
                    curSqlStmt.Append("Where SanctionId = '" + inSanctionId + "' And MemberId = '" + inMemberId + "' And AgeGroup = '" + inAgeGroup + "' ");
                    curSqlStmt.Append("And Event = 'Jump'");
                    curXml.Append(exportData("EventReg", new String[] { "SanctionId", "MemberId", "AgeGroup", "Event" }, curSqlStmt.ToString(), "Update"));

                    curSqlStmt = new StringBuilder("");
                    curSqlStmt.Append("Select * from EventRunOrder ");
                    curSqlStmt.Append("Where SanctionId = '" + inSanctionId + "' And MemberId = '" + inMemberId + "' And AgeGroup = '" + inAgeGroup + "' ");
                    curSqlStmt.Append("And Event = 'Jump' And Round = " + inRound);
                    curXml.Append(exportData("EventRunOrder", new String[] { "SanctionId", "MemberId", "AgeGroup", "Event", "Round" }, curSqlStmt.ToString(), "Update"));

                    curSqlStmt = new StringBuilder("");
                    curSqlStmt.Append("SELECT SanctionId, MemberId, AgeGroup, Round FROM JumpScore ");
                    curSqlStmt.Append("Where SanctionId = '" + inSanctionId + "' And MemberId = '" + inMemberId + "' And AgeGroup = '" + inAgeGroup + "' ");
                    curSqlStmt.Append("And Round = " + inRound);
                    curXml.Append(exportData("JumpScore", new String[] { "SanctionId", "MemberId", "AgeGroup", "Round" }, curSqlStmt.ToString(), "Delete"));

                    curSqlStmt = new StringBuilder("");
                    curSqlStmt.Append("SELECT Distinct SanctionId, MemberId, AgeGroup, Round FROM JumpRecap ");
                    curSqlStmt.Append("Where SanctionId = '" + inSanctionId + "' And MemberId = '" + inMemberId + "' And AgeGroup = '" + inAgeGroup + "' ");
                    if (inPassNum == 0)
                    {
                        curSqlStmt.Append("And Round = " + inRound);
                    }
                    else
                    {
                        curSqlStmt.Append("And Round = " + inRound + " And PassNum = " + inPassNum);
                    }
                    curXml.Append(exportData("JumpRecap", new String[] { "SanctionId", "MemberId", "AgeGroup", "Round" }, curSqlStmt.ToString(), "Delete"));

                    curSqlStmt = new StringBuilder("");
                    curSqlStmt.Append("SELECT * FROM JumpScore ");
                    curSqlStmt.Append("Where SanctionId = '" + inSanctionId + "' And MemberId = '" + inMemberId + "' And AgeGroup = '" + inAgeGroup + "' ");
                    curSqlStmt.Append("And Round = " + inRound);
                    curXml.Append(exportData("JumpScore", new String[] { "SanctionId", "MemberId", "AgeGroup", "Round" }, curSqlStmt.ToString(), "Update"));

                    curSqlStmt = new StringBuilder("");
                    curSqlStmt.Append("SELECT * FROM JumpRecap ");
                    curSqlStmt.Append("Where SanctionId = '" + inSanctionId + "' And MemberId = '" + inMemberId + "' And AgeGroup = '" + inAgeGroup + "' ");
                    if (inPassNum == 0)
                    {
                        curSqlStmt.Append("And Round = " + inRound);
                    }
                    else
                    {
                        curSqlStmt.Append("And Round = " + inRound + " And PassNum = " + inPassNum);
                    }
                    curXml.Append(exportData("JumpRecap", new String[] { "SanctionId", "MemberId", "AgeGroup", "Round", "PassNum" }, curSqlStmt.ToString(), "Update"));
                }

                curXml.Append("</LiveWebRequest>");
                SendMessageHttp.sendMessagePostXml(LiveWebLocation, curXml.ToString());
                returnStatus = true;
            } catch (Exception ex) {
                returnStatus = false;
                //MessageBox.Show( "Error encountered trying to send data to web location \n\nError: " + ex.Message );
                Log.WriteFile(curMethodName + ":Exception=" + ex.Message);
            }

            return(returnStatus);
        }