public static AdminTotals getAdminTotals(int ShowID, int EnteredBy) { String moduleSettings = ModuleConfig.GetSettings(); UserShows us = new UserShows(); DataSet ds = us.getAllUsersForShow(ShowID); AdminTotals adminTotals = new AdminTotals(); foreach (DataRow row in ds.Tables[0].Rows) { UserShows usdetails = new UserShows(row); User u = new User(usdetails.Userid); Transaction trans = new Transaction(usdetails.Userid, ShowID); if (EnteredBy == trans.EnteredBy) { adminTotals.Entries++; adminTotals.Runs += DogClasses.countDogsInClassForShow(usdetails.Userid, ShowID); } } return adminTotals; }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { testing = Config.GetInt("testing"); String cmd = Request["cmd"]; int iShowID = Convert.ToInt32(Request["showid"]); Shows show = new Shows(iShowID); ShowID.Value = iShowID.ToString(); showName = show.ShowName; int startingID = -1; if (!String.IsNullOrEmpty(Request["ShowDetailsID"])) startingID = Convert.ToInt32(Request["ShowDetailsID"]); UserShows us = new UserShows(); DataSet ds = us.getAllUsersForShow(iShowID); String html = ""; html = "<input type='button' id='btnAdd' value='Add Entry' />"; html += "<input type='button' id='btnBulkEmail' value='Email Everyone!' />"; html += "<div class='innerContainer'>"; int online = 0; int offline = 0; int Entries = ds.Tables[0].Rows.Count; foreach (DataRow row in ds.Tables[0].Rows) { UserShows usdetails = new UserShows(row); User u = new User(usdetails.Userid); //Transaction.ENTERED_BY EnteredBy = Transaction.hasShowAdminUpdateEntry(iShowID, usdetails.Userid); Transaction trans = new Transaction(usdetails.Userid, iShowID); Transaction.ENTERED_BY EnteredBy = (Transaction.ENTERED_BY )trans.EnteredBy; String EntryType = ""; if (EnteredBy == Transaction.ENTERED_BY.ONLINE_ENTRY) { EntryType = "O"; online++; //onlineDogs += DogClasses.countDogsInClassForShow(usdetails.Userid, iShowID); } else { EntryType = "A"; offline++; //offlineDogs += DogClasses.countDogsInClassForShow(usdetails.Userid, iShowID); } String tmp = ""; if (usdetails.Status == 2 ) { tmp = "NotPaid"; } else { tmp = (EnteredBy == 0 ? "OnlineEntry" : ""); } String ht = " "; if (usdetails.HandlerType == 1) { ht = "M"; } else if (usdetails.HandlerType == 2) { ht = "J"; } /* String ps = " "; if (usdetails.Status == (int)UserShows.UserStatus.STATUS_SAVED) { ps = "S"; } else if (usdetails.Status == (int)UserShows.UserStatus.STATUS_ENTERED_NOT_PAID) { ps = "N"; } * */ String showRef = usdetails.ID.ToString("000000"); html += "<div userid='" + usdetails.Userid.ToString() + "' class='user " + tmp + "'><div class='printRP'>P</div><div class='showref'>" + showRef + "</div><div class='userShowDetails'>" + EntryType + "</div><div class='handlerType'>" + ht + "</div><div class='userName'>" + u.Name + "</div><div class='delete'>x</div></div>"; } html += "</tbody></table></div>"; handlerList.InnerHtml = html; showStatus = String.Format("Online Entries:{0} Offline Entries:{1}", online, offline); strClassNosGradeList = fastJSON.JSON.Instance.ToJSON(ShowClasses.GetAllClassesForShow(iShowID)); } }