public List <Shows> GetShowsLikeShow_Name(string show_Name) { List <Shows> retVal = new List <Shows>(); try { ShowsBL shows = new ShowsBL(_connString); tblShows = shows.GetShowsLikeShow_Name(show_Name); if (tblShows != null && tblShows.Rows.Count > 0) { foreach (DataRow row in tblShows.Rows) { Shows show = new Shows(_connString, Utils.DBNullToGuid(row["Show_ID"])); retVal.Add(show); } } } catch (Exception ex) { throw ex; } return(retVal); }
public List <Shows> GetShowsByClub_ID_And_Show_Year_ID(Guid club_ID, int show_Year_ID) { List <Shows> retVal = new List <Shows>(); try { ShowsBL shows = new ShowsBL(_connString); tblShows = shows.GetShowsByClub_ID_And_Show_Year_ID(club_ID, show_Year_ID); if (tblShows != null && tblShows.Rows.Count > 0) { foreach (DataRow row in tblShows.Rows) { Shows show = new Shows(_connString, Utils.DBNullToGuid(row["Show_ID"])); retVal.Add(show); } } } catch (Exception ex) { throw ex; } return(retVal); }
public static void ClearRunningOrders(string show_ID, Guid user_ID) { Guid newShow_ID = new Guid(show_ID); List<Guid> showList = new List<Guid>(); showList.Add(newShow_ID); LinkedShows ls = new LinkedShows(); List<LinkedShows> lsList = ls.GetLinked_ShowsByParent_ID(newShow_ID); if (lsList != null && lsList.Count > 0) { foreach (LinkedShows linkedShow in lsList) { showList.Add(linkedShow.Child_Show_ID); } } List<OwnersDogsClassesDrawn> oDCDList = new List<OwnersDogsClassesDrawn>(); oDCDList = OwnersDogsClassesDrawn.GetOwnersDogsClassesDrawnListData(newShow_ID, null, true); if (oDCDList != null && oDCDList.Count > 0) { SetClassesAndDrawQty(newShow_ID); foreach (ClassesAndDrawQty classRow in ClassesAndDrawQtyList) { foreach (OwnersDogsClassesDrawn row in oDCDList) { if (row.Show_Final_Class_ID == classRow.Show_Final_Class_ID) { SetRunningOrderNull(row, user_ID); } } } } foreach (Guid s_ID in showList) { Shows show = new Shows(s_ID); show.Running_Orders_Allocated = false; show.Update_Show(s_ID, user_ID); } }
public static void AllocateRunningOrders(string show_ID, Guid user_ID) { Guid newShow_ID = new Guid(show_ID); List<Guid> showList = new List<Guid>(); showList.Add(newShow_ID); LinkedShows ls = new LinkedShows(); List<LinkedShows> lsList = ls.GetLinked_ShowsByParent_ID(newShow_ID); if (lsList != null && lsList.Count > 0) { foreach (LinkedShows linkedShow in lsList) { showList.Add(linkedShow.Child_Show_ID); } } SetDay1Show_ID(showList); if (OwnersDogsClassesDrawn.DeleteOwnersDogsClassesDrawnList()) { foreach (Guid s_ID in showList) { OwnersDrawn = null; DogsDrawn = null; Shows show = new Shows(s_ID); if (!(bool)show.Running_Orders_Allocated) { AllEntriesInClass = OwnersDogsClassesDrawn.GetOwnersDogsClassesDrawnListData(s_ID, null, false); AllocateRunningOrdersStage1(s_ID, user_ID); AllocateRunningOrdersStage2(s_ID, user_ID); AllocateRunningOrdersStage3(s_ID, user_ID); show.Running_Orders_Allocated = true; show.Update_Show(s_ID, user_ID); } } } }
public List<OwnersDogsClassesDrawn> GetOwnerDogsClassesDrawnList(Guid show_ID, Guid? show_Final_Class_ID, bool display) { RunningOrdersBL rOBL = new RunningOrdersBL(); tblOwnersDogsClassesDrawnList = rOBL.GetOwnersDogsClassesDrawn(display); List<OwnersDogsClassesDrawn> displayList = new List<OwnersDogsClassesDrawn>(); OwnersDogsClassesDrawn displayItem = new OwnersDogsClassesDrawn(); if (tblOwnersDogsClassesDrawnList != null && tblOwnersDogsClassesDrawnList.Count > 0) { short ring_No = 0; Shows show = new Shows(show_ID); string show_Final_Class_Description = string.Empty; ClearDrawnFlags(); int rowCount = 0; int rowCountRO = 0; int rowCountInScope = 0; foreach (sss.tblOwnersDogsClassesDrawnListRow oDCDLRow in tblOwnersDogsClassesDrawnList) { rowCount += 1; if (!oDCDLRow.IsRunning_OrderNull()) { rowCountRO += 1; displayItem.Running_Order = oDCDLRow.Running_Order; if (oDCDLRow.Running_Order > 0 && oDCDLRow.Running_Order < 21) { rowCountInScope += 1; //if (display) SetDrawnFlags(oDCDLRow, show_ID); displayItem.DogDrawnInClass = true; } } } foreach (sss.tblOwnersDogsClassesDrawnListRow row in tblOwnersDogsClassesDrawnList) { ShowFinalClasses sfc = new ShowFinalClasses(row.Show_Final_Class_ID); if ((ring_No != row.Ring_No && ring_No != 0) || (ring_No == row.Ring_No && show_Final_Class_Description != row.Show_Final_Class_Description)) { //new ring number OwnersDogsClassesDrawn completeRow = BuildCompleteRow(displayItem); displayList.Add(completeRow); displayItem = new OwnersDogsClassesDrawn(); } if (!row.IsRunning_OrderNull()) { displayItem.Running_Order = row.Running_Order; if (row.Running_Order > 0 && row.Running_Order < 21) { //if (display) SetDrawnFlags(row, show_ID); displayItem.DogDrawnInClass = true; } } displayItem.Ring_No = row.Ring_No; displayItem.Owners.Add(row.Owner); if (RunningOrders.OwnersDrawn.IndexOf(row.Owner_ID) != -1) displayItem.OwnerDrawn = true; if ((Guid)sfc.Show_ID == RunningOrders.Day1_Show_ID) { if (RunningOrders.OwnersDrawnOnDay1.IndexOf(row.Owner_ID) != -1) displayItem.OwnerDrawnOnDay = true; } else { if (RunningOrders.OwnersDrawnOnDay2.IndexOf(row.Owner_ID) != -1) displayItem.OwnerDrawnOnDay = true; } displayItem.Dog_KC_Name = row.Dog_KC_Name; if (!row.IsOffer_Of_HelpNull()) { displayItem.Offer_Of_Help = row.Offer_Of_Help; displayItem.Helper = row.Offer_Of_Help; } else displayItem.Helper = false; displayItem.HighestClass = IsHighestClass(row); displayItem.OldestDog = IsOldestDog(row); displayItem.Entrant_ID = row.Entrant_ID; if (!row.IsEntry_DateNull()) displayItem.Entry_Date = row.Entry_Date; displayItem.Owner_ID = row.Owner_ID; displayItem.Dog_ID = row.Dog_ID; if (RunningOrders.DogsDrawn.IndexOf(row.Dog_ID) != -1) displayItem.DogDrawn = true; displayItem.Dog_Class_ID = row.Dog_Class_ID; displayItem.Show_Final_Class_ID = row.Show_Final_Class_ID; SetOwnerDogCounts(row, show_ID); displayItem.OwnerDogCount = RunningOrders.OwnerDogCount; displayItem.OwnerDogsInClassCount = RunningOrders.OwnerDogsInClassCount; displayItem.ClassesPerOwnerEnteredCount = RunningOrders.ClassesPerOwnerEnteredCount; displayItem.ClassesPerDogEnteredCount = RunningOrders.ClassesPerDogEnteredCount; displayItem.Show_Final_Class_Description = row.Show_Final_Class_Description; show_Final_Class_Description = row.Show_Final_Class_Description; //displayList.Add(displayItem); ring_No = row.Ring_No; } OwnersDogsClassesDrawn completeRowFinal = BuildCompleteRow(displayItem); displayList.Add(completeRowFinal); } return displayList; }
public static void SetDay1Show_ID(List<Guid> showList) { Guid firstShow_ID = showList[0]; Shows show = new Shows(showList[0]); DateTime firstShowDate = (DateTime)show.Show_Opens; foreach (Guid show_ID in showList) { Shows show2 = new Shows(show_ID); if (DateTime.Compare((DateTime)show2.Show_Opens, firstShowDate) < 0) { firstShow_ID = show_ID; firstShowDate = (DateTime)show2.Show_Opens; } } RunningOrders.Day1_Show_ID = firstShow_ID; }
public List<Shows> GetShowsLikeShow_Name(string show_Name) { List<Shows> showList = new List<Shows>(); ShowsBL shows = new ShowsBL(); tblShows = shows.GetShowsLikeShow_Name(show_Name); if (tblShows != null && tblShows.Count > 0) { foreach (sss.tblShowsRow row in tblShows) { Shows show = new Shows(row.Show_ID); showList.Add(show); } } return showList; }
public List<Shows> GetShowsByVenue_ID(Guid venue_ID) { List<Shows> showList = new List<Shows>(); ShowsBL shows = new ShowsBL(); tblShows = shows.GetShowsByVenue_ID(venue_ID); if (tblShows != null && tblShows.Count > 0) { foreach (sss.tblShowsRow row in tblShows) { Shows show = new Shows(row.Show_ID); showList.Add(show); } } return showList; }
public List<Shows> GetShowsByClub_ID_And_Show_Year_ID(Guid club_ID, int show_Year_ID) { List<Shows> showList = new List<Shows>(); ShowsBL shows = new ShowsBL(); tblShows = shows.GetShowsByClub_ID_And_Show_Year_ID(club_ID, show_Year_ID); if (tblShows != null && tblShows.Count > 0) { foreach (sss.tblShowsRow row in tblShows) { Shows show = new Shows(row.Show_ID); showList.Add(show); } } return showList; }
public Shows GetShowDetailsByCriteria(int movieId, short cityId, DateTime fromDate, DateTime toDate) { List <SqlParameter> param = new List <SqlParameter>(); param.Add(new SqlParameter() { ParameterName = "@MovieId", Value = movieId }); param.Add(new SqlParameter() { ParameterName = "@CityId", Value = cityId }); param.Add(new SqlParameter() { ParameterName = "@FromDate", Value = fromDate }); param.Add(new SqlParameter() { ParameterName = "@ToDate", Value = toDate }); DataSet ds = Select(StoredProcedureName.GET_SHOW_LIST, param); Shows showDetails = new Shows(); List <DayWiseShowDetails> showList = new List <DayWiseShowDetails>(); List <CinemaDetails> cinemaList = null; DateTime currentDate = fromDate; int cinemaId = 0; if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { while (currentDate <= toDate) { DayWiseShowDetails currentDayDetails = new DayWiseShowDetails(); currentDayDetails.ShowDate = currentDate; cinemaList = new List <CinemaDetails>(); foreach (DataRow currentCinema in ds.Tables[0].Rows) { if (Convert.ToDateTime(currentCinema["ShowDate"]).ToShortDateString() == currentDate.ToShortDateString()) { cinemaId = currentCinema["CinemaId"].ToIntSafe(); if (cinemaList.Select(c => c.CinemaId).Contains(cinemaId)) { continue; } string cinemaName = currentCinema["CinemaName"].ToStringSafe(); CinemaDetails cinema = new CinemaDetails { CinemaId = cinemaId, CinemaName = cinemaName }; string filter = "CinemaId=" + currentCinema["CinemaId"].ToString() + " and " + "ShowDate='" + currentDayDetails.ShowDate + "'"; cinema.ShowList = ds.Tables[0].Select(filter).ConvertToList <ShowDetails>(); cinemaList.Add(cinema); } } if (cinemaList != null) { currentDayDetails.CinemaList = cinemaList; } showList.Add(currentDayDetails); TimeSpan duration = new TimeSpan(1, 0, 0, 0); currentDate = currentDate.Add(duration); } } if (showList != null) { showDetails.ShowList = showList; } return(showDetails); }