// GET: Admin/Season/Details/5
        public ActionResult Details(int _seriesId)
        {
            var vm = new vmEntity();

            vm.Season      = _seriesId > 0 ? _seasonRepository.GetById(_seriesId) : new Season();
            vm.PageHeading = $"Season: {vm.Season.Title}";

            return(View(vm));
        }
        protected void SeasonList_SelectedIndexChanged(object sender, EventArgs e)
        {
            var seasonRepository = new SeasonRepository();
            var races = seasonRepository.GetById(int.Parse(SeasonList.SelectedValue)).Races;

            RaceList.DataSource = races;
            RaceList.DataValueField = "Id";
            RaceList.DataTextField = "Name";
            RaceList.DataBind();
        }
        //TODO change to _episodeId
        public ActionResult Save(int _seasonId, int?_episodeId)
        {
            var vm = new vmEntity(_genreRepository.GetAll().OrderBy(x => x.Title));

            vm.Season      = _seasonRepository.GetById(_seasonId);
            vm.Episode     = _episodeId != 0 ? _episodeRepository.GetById(_episodeId.GetValueOrDefault()) : GetNewEpisodeForEdit(_episodeId.GetValueOrDefault(), _seasonId);
            vm.PageHeading = _episodeId != null ? $"Edit Episode {vm.Episode.Title} Season {vm.Season.Season_Number}" : $"Add Episode to Season {vm.Season.Season_Number}";

            return(PartialView("_savePanel", vm));
        }
Esempio n. 4
0
        public IHttpActionResult Get(int Id)
        {
            var season = _seasonRepository.GetById(Id);

            if (season == null)
            {
                return(NotFound());
            }

            return(Ok(season));
        }
Esempio n. 5
0
        private void UpdRow(int rowId)
        {
            var repSeason = new SeasonRepository(new CSBCDbContext());
            DateTime date;
            Season season;
            if (rowId != 0)
                season = repSeason.GetById(rowId);
            else
            {
                season = new Season();
            }
            try
            {
                season.CompanyID = Master.CompanyId;
                season.SeasonID = rowId;
                season.Description = txtName.Text;
                if (DateTime.TryParse(mskStartDate.Text, out date))
                    season.FromDate = date;
                if (DateTime.TryParse(mskEndDate.Text, out date))
                    season.ToDate = date;
                season.NewSchoolYear = chkNewSchool.Checked;
                season.CurrentSeason = chkCurrentSeason.Checked;
                season.CurrentSignUps = chkRegistration.Checked;
                season.CurrentSchedule = chkSchedules.Checked;

                // Set dates
                if (DateTime.TryParse(mskORStart.Text, out date))
                    season.SignUpsDate = date;
                if (DateTime.TryParse(mskOREnd.Text, out  date))
                    season.SignUpsEND = date;

                // Set fees
                decimal fee;
                season.ParticipationFee = Decimal.TryParse(txtPlayersFee.Text, out fee) ? fee : 0;
                season.SponsorFee = Decimal.TryParse(mskSponsorFee.Text, out fee) ? fee : 0;
                season.ConvenienceFee = Decimal.TryParse(mskSponsorFeeDiscounted.Text, out fee) ? fee : 0;

                season.CreatedUser = Session["UserName"].ToString();
                if (rowId == 0)
                    repSeason.Insert(season);
                else
                    repSeason.Update(season);

            }
            catch (Exception e)
            {
                lblError.Text = "SaveRecord::" + e.Message;
            }
        }
Esempio n. 6
0
        private void LoadRecord(int rowId)
        {
            var repSeason = new SeasonRepository(new CSBCDbContext());
            var season = repSeason.GetById(rowId);

            try
            {
                //season.TimeZone = Session["TimeZone"]
                txtSeasonID.Value = rowId.ToString();
                txtName.Text = season.Description;
                mskStartDate.Text = season.FromDate.Value.ToString("yyyy-MM-dd");
                mskEndDate.Text = season.ToDate.Value.ToString("yyyy-MM-dd");
                chkNewSchool.Checked = Convert.ToBoolean(season.NewSchoolYear);
                chkCurrentSeason.Checked = Convert.ToBoolean(season.CurrentSeason);
                chkRegistration.Checked = Convert.ToBoolean(season.CurrentSignUps);
                var curReg = Convert.ToBoolean(season.CurrentSignUps);

                //mskORStart.Enabled = curReg;
                //mskOREnd.Enabled = curReg;
                if (season.SignUpsDate != null)
                    mskORStart.Text = season.SignUpsDate.Value.ToString("yyyy-MM-dd");
                if (season.SignUpsEND != null)
                    mskOREnd.Text = season.SignUpsEND.Value.ToString("yyyy-MM-dd");

                chkSchedules.Checked = Convert.ToBoolean(season.CurrentSchedule);
                if (season.ParticipationFee != null)
                    txtPlayersFee.Text = Convert.ToDecimal(string.Format("{0:F2}", season.ParticipationFee)).ToString();
                if (season.SponsorFee != null)
                    mskSponsorFee.Text = Convert.ToDecimal(string.Format("{0:F2}", season.SponsorFee)).ToString();
                if (season.ConvenienceFee != null)
                    mskSponsorFeeDiscounted.Text = Convert.ToDecimal(string.Format("{0:F2}", season.ConvenienceFee)).ToString();
            }
            catch (Exception ex)
            {
                lblError.Text = "LoadRecord::" + ex.Message;
            }
        }
Esempio n. 7
0
 private decimal GetSeasonFee()
 {
     decimal functionReturnValue = 0;
     var oSeason = new SeasonRepository(new CSBCDbContext());
     functionReturnValue = 0;
     try
     {
         var season = oSeason.GetById(Master.SeasonId);
         functionReturnValue = Convert.ToDecimal(season.ParticipationFee);
     }
     catch (Exception ex)
     {
         lblError.Text = "GetSeasonFee::" + ex.Message;
     }
     return functionReturnValue;
 }