Example #1
0
        public static bool DeleteShowBL(int deleteShowID)
        {
            bool showDeleted = false;

            try
            {
                if (deleteShowID > 0)
                {
                    ShowsDAL showDAL = new ShowsDAL();
                    showDeleted = showDAL.DeleteShowDAL(deleteShowID);
                }
                else
                {
                    throw new MovieExceptions("Invalid show ID");
                }
            }
            catch (MovieExceptions ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(showDeleted);
        }
Example #2
0
        public ActionResult InsertShow(string StrName, string StrAuthor, int IntBudget, bool YsnIsMusical, int IntClubID, int IntDateID)
        {
            Show newShow = new Show
            {
                StrName      = StrName,
                StrAuthor    = StrAuthor,
                IntBudget    = IntBudget,
                YsnIsMusical = YsnIsMusical,
                IntClubID    = IntClubID,
                Club         = ClubsDAL.GetClub(IntClubID),
                IntDateID    = IntDateID,
                Date         = DatesDAL.GetDate(IntDateID)
            };

            bool success = ShowsDAL.InsertShow(newShow);

            ShowsVM model = new ShowsVM()
            {
                LstAllClubs = ClubsDAL.GetAllClubs(),
                LstShows    = ShowsDAL.GetAllShows(),
                LstAllDates = DatesDAL.GetAllDates()
            };

            return(PartialView("CRUDPartials/_Shows", model));
        }
Example #3
0
        public ActionResult GetAllActorsNotIn(int intShowID)
        {
            AllActorsNotInVM model = new AllActorsNotInVM()
            {
                LstAllShows       = ShowsDAL.GetAllShows(),
                LstAllActorsNotIn = AnalyticsDAL.GetAllActorsNotIn(intShowID),
                Show = ShowsDAL.GetShow(intShowID)
            };

            return(PartialView("AnalyticsPartials/_AllActorsNotIn", model));
        }
Example #4
0
        public ActionResult Analytics()
        {
            AnalyticsVM model = new AnalyticsVM();

            model._budgetAverage_vm.LstBudgetAverages           = AnalyticsDAL.GetBudgetAverages();
            model._musicalsCount_vm.LstMusicalCounts            = AnalyticsDAL.GetMusicalCounts();
            model._repeatStaffPositions_vm.LstPossiblePositions = AnalyticsDAL.GetPossiblePositions();
            model._membersByVoicePart_vm.LstAllVoiceParts       = AnalyticsDAL.GetPossibleVoiceParts();
            model._nonSinging_vm.LstNonSingingMembers           = AnalyticsDAL.GetNonSingingMembers();
            model._allActorsNotIn_vm.LstAllShows = ShowsDAL.GetAllShows();

            return(View(model));
        }
Example #5
0
        public ActionResult GetShowsByInstrument(string strSearch)
        {
            ShowsByInstrumentVM model = new ShowsByInstrumentVM()
            {
                LstShowsByInstrument = AnalyticsDAL.GetShowsByInstrument(strSearch),
                StrSearch            = strSearch
            };

            foreach (var showsByInstrument in model.LstShowsByInstrument)
            {
                showsByInstrument.Show = ShowsDAL.GetShow(showsByInstrument.IntShowID);
            }

            return(PartialView("AnalyticsPartials/_ShowsByInstrument", model));
        }
Example #6
0
        public ActionResult DeleteShow(int IntShowID)
        {
            Show remShow = new Show
            {
                IntShowID = IntShowID
            };

            bool success = ShowsDAL.DeleteShow(remShow);

            ShowsVM model = new ShowsVM()
            {
                LstAllClubs = ClubsDAL.GetAllClubs(),
                LstShows    = ShowsDAL.GetAllShows(),
                LstAllDates = DatesDAL.GetAllDates()
            };

            return(PartialView("CRUDPartials/_Shows", model));
        }
Example #7
0
        public ActionResult DeleteCast(int IntCastID)
        {
            Cast remCast = new Cast
            {
                IntCastID = IntCastID
            };

            bool success = CastsDAL.DeleteCast(remCast);

            CastsVM model = new CastsVM()
            {
                LstCasts      = CastsDAL.GetAllCasts(),
                LstAllMembers = MembersDAL.GetAllMembers(),
                LstAllShows   = ShowsDAL.GetAllShows()
            };

            return(PartialView("CRUDPartials/_Casts", model));
        }
Example #8
0
        public ActionResult DeleteStaff(int IntStaffID)
        {
            Staff remStaff = new Staff
            {
                IntStaffID = IntStaffID
            };

            bool success = StaffDAL.DeleteStaff(remStaff);

            StaffVM model = new StaffVM()
            {
                LstStaff      = StaffDAL.GetAllStaff(),
                LstAllMembers = MembersDAL.GetAllMembers(),
                LstAllShows   = ShowsDAL.GetAllShows()
            };

            return(PartialView("CRUDPartials/_Staff", model));
        }
Example #9
0
        public ActionResult DeletePit(int IntPitID)
        {
            Pit remPit = new Pit
            {
                IntPitID = IntPitID
            };

            bool success = PitsDAL.DeletePit(remPit);

            PitsVM model = new PitsVM()
            {
                LstPits       = PitsDAL.GetAllPits(),
                LstAllMembers = MembersDAL.GetAllMembers(),
                LstAllShows   = ShowsDAL.GetAllShows()
            };

            return(PartialView("CRUDPartials/_Pits", model));
        }
Example #10
0
        public static ShowEntity SearchShowByIdBL(int showId)
        {
            ShowEntity searchShow = null;

            try
            {
                searchShow = ShowsDAL.SearchShowByIdDAL(showId);
            }
            catch (MovieExceptions ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(searchShow);
        }
Example #11
0
        public ActionResult UpdateShow(int IntShowID, int IntBudget)
        {
            Show updShow = new Show
            {
                IntShowID = IntShowID,
                IntBudget = IntBudget
            };

            bool success = ShowsDAL.UpdateShow(updShow);

            ShowsVM model = new ShowsVM()
            {
                LstAllClubs = ClubsDAL.GetAllClubs(),
                LstShows    = ShowsDAL.GetAllShows(),
                LstAllDates = DatesDAL.GetAllDates()
            };

            return(PartialView("CRUDPartials/_Shows", model));
        }
Example #12
0
        public ActionResult Crud()
        {
            ViewBag.Message = "Create, Read, Update, and Delete table info here";

            CRUDVM model = new CRUDVM();

            IEnumerable <Cast>   allCasts   = CastsDAL.GetAllCasts();
            IEnumerable <Club>   allClubs   = ClubsDAL.GetAllClubs();
            IEnumerable <Date>   allDates   = DatesDAL.GetAllDates();
            IEnumerable <Exec>   allExec    = ExecDAL.GetAllExec();
            IEnumerable <Member> allMembers = MembersDAL.GetAllMembers();
            IEnumerable <Pit>    allPits    = PitsDAL.GetAllPits();
            IEnumerable <Show>   allShows   = ShowsDAL.GetAllShows();
            IEnumerable <Staff>  allStaff   = StaffDAL.GetAllStaff();


            model._shows_vm.LstShows    = allShows;
            model._shows_vm.LstAllClubs = allClubs;
            model._shows_vm.LstAllDates = allDates;

            model._casts_vm.LstCasts      = allCasts;
            model._casts_vm.LstAllMembers = allMembers;
            model._casts_vm.LstAllShows   = allShows;

            model._exec_vm.LstExec       = allExec;
            model._exec_vm.LstAllMembers = allMembers;
            model._exec_vm.LstAllClubs   = allClubs;
            model._exec_vm.LstAllDates   = allDates;

            model._members_vm.LstMembers = allMembers;

            model._pits_vm.LstPits       = allPits;
            model._pits_vm.LstAllMembers = allMembers;
            model._pits_vm.LstAllShows   = allShows;


            model._staff_vm.LstStaff      = allStaff;
            model._staff_vm.LstAllMembers = allMembers;
            model._staff_vm.LstAllShows   = allShows;

            return(View(model));
        }
Example #13
0
        public ActionResult UpdateCast(int IntCastID, int IntMemberID)
        {
            Cast updCast = new Cast
            {
                IntCastID   = IntCastID,
                IntMemberID = IntMemberID,
                Member      = MembersDAL.GetMember(IntMemberID)
            };

            bool success = CastsDAL.UpdateCast(updCast);

            CastsVM model = new CastsVM()
            {
                LstCasts      = CastsDAL.GetAllCasts(),
                LstAllMembers = MembersDAL.GetAllMembers(),
                LstAllShows   = ShowsDAL.GetAllShows()
            };

            return(PartialView("CRUDPartials/_Casts", model));
        }
Example #14
0
        public static List <ShowEntity> GetAllShowsBL(int id)
        {
            List <ShowEntity> showList = null;

            try
            {
                ShowsDAL showDAL = new ShowsDAL();

                showList = showDAL.ViewAllShowsDAL(id);
            }
            catch (MovieExceptions ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(showList);
        }
Example #15
0
        public ActionResult UpdatePit(int IntPitID, int IntSeat, int IntMemberID)
        {
            Pit upPit = new Pit
            {
                IntPitID    = IntPitID,
                IntSeat     = IntSeat,
                IntMemberID = IntMemberID,
                Member      = MembersDAL.GetMember(IntMemberID)
            };

            bool success = PitsDAL.UpdatePit(upPit);

            PitsVM model = new PitsVM()
            {
                LstPits       = PitsDAL.GetAllPits(),
                LstAllMembers = MembersDAL.GetAllMembers(),
                LstAllShows   = ShowsDAL.GetAllShows()
            };

            return(PartialView("CRUDPartials/_Pits", model));
        }
Example #16
0
        public ActionResult InsertStaff(string StrPosition, int IntMemberID, int IntShowID)
        {
            Staff newStaff = new Staff
            {
                StrPosition = StrPosition,
                IntMemberID = IntMemberID,
                Member      = MembersDAL.GetMember(IntMemberID),
                IntShowID   = IntShowID,
                Show        = ShowsDAL.GetShow(IntShowID)
            };

            bool success = StaffDAL.InsertStaff(newStaff);

            StaffVM model = new StaffVM()
            {
                LstStaff      = StaffDAL.GetAllStaff(),
                LstAllMembers = MembersDAL.GetAllMembers(),
                LstAllShows   = ShowsDAL.GetAllShows()
            };

            return(PartialView("CRUDPartials/_Staff", model));
        }
Example #17
0
        public static bool AddShowBL(ShowEntity newShow)
        {
            bool showAdded = false;

            try
            {
                if (ValidateShow(newShow))
                {
                    ShowsDAL showDAL = new ShowsDAL();

                    showAdded = showDAL.AddShowDAL(newShow);
                }
            }
            catch (MovieExceptions)
            {
                throw;
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(showAdded);
        }
Example #18
0
        public ActionResult InsertCast(string StrVoicePart, string StrRole, int IntMemberID, int IntShowID)
        {
            Cast newCast = new Cast
            {
                StrVoicePart = StrVoicePart,
                StrRole      = StrRole,
                IntMemberID  = IntMemberID,
                Member       = MembersDAL.GetMember(IntMemberID),
                IntShowID    = IntShowID,
                Show         = ShowsDAL.GetShow(IntShowID)
            };

            bool success = CastsDAL.InsertCast(newCast);

            CastsVM model = new CastsVM()
            {
                LstCasts      = CastsDAL.GetAllCasts(),
                LstAllMembers = MembersDAL.GetAllMembers(),
                LstAllShows   = ShowsDAL.GetAllShows()
            };

            return(PartialView("CRUDPartials/_Casts", model));
        }
Example #19
0
        public ActionResult InsertPit(string StrInstrument, int IntSeat, int IntMemberID, int IntShowID)
        {
            Pit newPit = new Pit
            {
                StrInstrument = StrInstrument,
                IntSeat       = IntSeat,
                IntMemberID   = IntMemberID,
                Member        = MembersDAL.GetMember(IntMemberID),
                IntShowID     = IntShowID,
                Show          = ShowsDAL.GetShow(IntShowID)
            };

            bool success = PitsDAL.InsertPit(newPit);

            PitsVM model = new PitsVM()
            {
                LstPits       = PitsDAL.GetAllPits(),
                LstAllMembers = MembersDAL.GetAllMembers(),
                LstAllShows   = ShowsDAL.GetAllShows()
            };

            return(PartialView("CRUDPartials/_Pits", model));
        }
Example #20
0
        public static bool UpdateShowBL(ShowEntity updateShow)
        {
            bool showUpdated = false;

            try
            {
                if (ValidateShow(updateShow))
                {
                    ShowsDAL showDAL = new ShowsDAL();

                    showUpdated = showDAL.UpdateShowDAL(updateShow);
                }
            }

            catch (MovieExceptions ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(showUpdated);
        }
Example #21
0
        public static ShowsByInstrumentVM Of(string strSearch, int intShowID)
        {
            Show show = ShowsDAL.GetShow(intShowID);

            return(new ShowsByInstrumentVM(strSearch, show));
        }