Exemplo n.º 1
0
            public bool LoadRoster(string sRoster, int iMiscAffiliation)
            {
                m_rst.ReadRoster(sRoster);
                foreach (RosterEntry rste in m_rst.Plrste)
                    {
                    Umpire ump = new Umpire(rste.m_sFirst, rste.m_sLast, rste.m_plsMisc[iMiscAffiliation], rste.m_sEmail, rste.m_plsMisc);

                    m_mpNameUmpire.Add(ump.Name, ump);
                    }
                return true;
            }
Exemplo n.º 2
0
            /* R S  H A N D L E  R E A D I N G  O F F I C I A L S  1 */
            /*----------------------------------------------------------------------------
                    %%Function: RsHandleReadingOfficials1
                    %%Qualified: ArbWeb.CountsData:GameData:Games.RsHandleReadingOfficials1
                    %%Contact: rlittle

                ----------------------------------------------------------------------------*/
            private ReadState RsHandleReadingOfficials1(Roster rst, bool fIncludeCanceled, string sLine, string[] rgsFields,
                Dictionary<string, string> mpNamePos, Dictionary<string, string> mpNameStatus, bool fCanceled, string sSite, string sGame,
                string sHome, string sAway, string sLevel, string sSport, ReadState rs,
                ref string sPosLast, ref string sStatusLast, ref string sNameLast, ref string sDateTime, ref bool fOpenSlot, ref Umpire ump)
            {
                // Games may have multiple officials, so we have to collect up the officials.
                // we do this in mpNamePos

                // &&&& TODO: omit dates before here...

                if (Regex.Match(sLine, "Attached").Success)
                    return rs;

                if (rgsFields[0].Length < 1)
                    {
                    // look for possible contiuation line; if not there, then we will fall back
                    // to ReadingOfficials1
                    rs = ReadState.ReadingOfficials2;
                    sPosLast = rgsFields[1];
                    sNameLast = rgsFields[icolOfficial];
                    sStatusLast = rgsFields[icolSlotStatus];

                    if (Regex.Match(rgsFields[icolOfficial], "_____").Success)
                        {
                        fOpenSlot = true;
                        mpNamePos.Add(String.Format("!!OPEN{0}", mpNamePos.Count), rgsFields[1]);
                        mpNameStatus.Add(String.Format("!!OPEN{0}", mpNameStatus.Count), rgsFields[icolSlotStatus]);
                        return rs;
                        }
                    else
                        {
                        string sName = ReverseName(rgsFields[icolOfficial]);
                        mpNamePos.Add(sName, rgsFields[1]);
                        mpNameStatus.Add(sName, rgsFields[icolSlotStatus]);
                        return rs;
                        }
                    }
                // otherwise we're done!!
                //						m_srpt.AddMessage("recording results...");
                if (!fCanceled || fIncludeCanceled)
                    {
                    // record our game

                    // we've got all the info for one particular game and its officials.

                    // walk through the officials that we have
                    foreach (string sName in mpNamePos.Keys)
                        {
                        string sPos = mpNamePos[sName];
                        string sStatus = mpNameStatus[sName];
                        string sEmail;
                        string sTeam;
                        string sNameUse = sName;
                        List<string> plsMisc = null;

                        if (Regex.Match(sName, "!!OPEN.*").Success)
                            {
                            sNameUse = null;
                            sEmail = "";
                            sTeam = "";
                            sStatus = "";
                            }
                        else
                            {
                            ump = rst.UmpireLookup(sName);

                            if (ump == null)
                                {
                                if (sName != "")
                                    m_srpt.AddMessage(String.Format("Cannot find info for Umpire: {0}", sName),
                                                      StatusRpt.MSGT.Error);
                                sEmail = "";
                                sTeam = "";
                                }
                            else
                                {
                                sEmail = ump.Contact;
                                sTeam = ump.Misc;
                                plsMisc = ump.PlsMisc;
                                }
                            }
                        if (sPos != "Training")
                            {
                            if (sDateTime.EndsWith("TBA"))
                                sDateTime = sDateTime.Substring(0, sDateTime.Length - icolOfficial) + "00:00";
                            AddGame(DateTime.Parse(sDateTime), sSite, sNameUse, sTeam, sEmail, sGame, sHome, sAway, sLevel, sSport,
                                    sPos, sStatus, fCanceled, plsMisc);
                            }
                        }
                    }
                rs = ReadState.ScanForGame;
                return rs;
            }