public ActionResult StationAssociatesGridData(GridSettings gridSettings, long stationId, string hdFlag)
 {
     using (var dataTable = CRCDataAccess.GetStationAssociates(stationId, hdFlag))
     {
         return(InfJqGridData(dataTable, gridSettings));
     }
 }
 public ActionResult StationNotesGridData(GridSettings gridSettings, long stationId)
 {
     using (var dataTable = CRCDataAccess.GetStationNotes(stationId))
     {
         return(InfJqGridData(dataTable, gridSettings));
     }
 }
        public ActionResult AddEditStation(long?stationId, string copyInd)
        {
            var viewModel = new AddEditStationViewModel();

            if (stationId.HasValue)
            {
                var drStation = CRCDataAccess.GetStation(stationId.Value);
                drStation.MapTo(viewModel);

                viewModel.EnabledInd = !(drStation["DisabledDate"] is DateTime);
                viewModel.CopyInd    = copyInd.Equals("Y", StringComparison.OrdinalIgnoreCase) ? "Y" : "N";

                using (var dtStationAffiliates = CRCDataAccess.GetStationAffiliates(stationId.Value))
                {
                    viewModel.AffiliateIds = dtStationAffiliates.AsEnumerable().Select(row => (long)row["AffiliateId"]);
                }
            }
            else
            {
                //Set default values when adding a new station
                viewModel.EnabledInd       = true;
                viewModel.MemberStatusId   = InfLookupHelper.ReverseLookup("MemberStatus", "MemberStatusName", "Full");
                viewModel.MinorityStatusId = InfLookupHelper.ReverseLookup("MinorityStatus", "MinorityStatusName", "None");
                viewModel.StatusDate       = DateTime.UtcNow.AddHours(InfDate.GetUtcOffSet);
                //viewModel.TimeZoneId = InfLookupHelper.ReverseLookup("TimeZone", "TimeZoneCode", "Eastern Standard Time");
                viewModel.MaxNumberOfUsers = 4;
            }

            return(View(viewModel));
        }
Exemplo n.º 4
0
        public ActionResult AddEditProducerContact(AddEditProducerContactViewModel viewModel)
        {
            if (ModelState.IsValid)
            {
                CRCDataAccess.SaveProducer(
                    viewModel.ProducerId,
                    viewModel.SalutationId,
                    viewModel.FirstName,
                    viewModel.MiddleName,
                    viewModel.LastName,
                    viewModel.Suffix,
                    viewModel.Role,
                    viewModel.Email,
                    viewModel.Phone,
                    viewModel.EnabledInd ? (DateTime?)null : DateTime.UtcNow,
                    viewModel.EnabledInd ? (long?)null : CRCUser.UserId,
                    CRCUser.UserId);

                return(Json(true));
            }
            else
            {
                return(PartialView(viewModel));
            }
        }
Exemplo n.º 5
0
        public RawDataViewModel()
        {
            DurationList = new[] { "18 hours", "24 hours", "Custom" }.ToSelectListItems();

            GetStartHoursList("StartHours");

            GetStartHoursList("EndingHours");

            GetMonthList();

            YearList = CRCDataAccess.GetScheduleYearsList(2).ToSelectListItems().SetSelected(DateTime.UtcNow.Year);

            StationStatusList = new[] { "Flagship and Non-100%(Partial) Repeater", "100% Repeater", "All Statuses" }.ToSelectListItems();

            GetStationStatusList();

            GetMemberStatusList();

            //StationList = CRCDataAccess.GetStationsList().ToSelectListItems().OrderBy(li => li.Text).AddBlankFirstItem();

            StationList = CRCDataAccess.GetStationsList().ToSelectListItems().AddBlankFirstItem();

            //FormatTypeList = new[] { "Excel", "CSV", "PDF" }.ToSelectListItems();

            FormatTypeList = new[] { "Excel", "CSV" }.ToSelectListItems();

            GetBandList();
        }
 public SearchByProgramProducerViewModel()
 {
     ProgramSearch = new ProgramSearch();
     //ProgramFirstLetterList = GetCharacterList().ToSelectListItems().OrderBy(li => li.Text);
     //ProgramList = CRCDataAccess.ProgramCalendarSearch("*", "StartsWith").ToSelectListItems();
     ProducerList = CRCDataAccess.GetProducersList().ToSelectListItems().OrderBy(li => li.Text).AddBlankFirstItem();
 }
        public ActionResult DMAMetro(ImportDocumentViewModel viewModel)
        {
            if (ModelState.IsValid)
            {
                StreamReader streamReader = new StreamReader(viewModel.Document.InputStream);
                CsvReader    csvReader    = new CsvReader(streamReader);
                csvReader.Configuration.RegisterClassMap <ImportStationMap>();
                IEnumerable <ImportStationViewModel> records = csvReader.GetRecords <ImportStationViewModel>().ToList();
                long rank = 0;
                foreach (var rec in records)
                {
                    if (!rec.Band.Equals("ER", StringComparison.CurrentCultureIgnoreCase) && rec.Market.Length != 0 && rec.Rank.Length != 0 && viewModel.ImportType != null)
                    {
                        if (viewModel.ImportType.Equals("DMA"))
                        {
                            //rank = Int64.Parse(rec.Rank.Replace("t", ""));
                            rec.Result = CRCDataAccess.UpdateDMAMarket(rec.CallLetters, rec.Band, rec.Market, rec.Rank, CRCUser.UserId);
                        }
                        else
                        {
                            rec.Result = CRCDataAccess.UpdateMetroMarket(rec.CallLetters, rec.Band, rec.Market, rec.Rank.Replace("t", ""), CRCUser.UserId);
                        }
                    }
                }

                viewModel.Results = records.ToList();
                return(PartialView(viewModel));
            }
            else
            {
                return(PartialView(viewModel));
            }
        }
 public ActionResult SearchSchedulesGridDataManage(GridSettings gridSettings, int?month, int?year, string status)
 {
     using (var dataTable = CRCDataAccess.SearchSchedulesManage(null, month, year, status))
     {
         return(InfJqGridData(dataTable, gridSettings));
     }
 }
 public ActionResult BandGridData(GridSettings gridSettings)
 {
     using (var dataTable = CRCDataAccess.GetBands())
     {
         return(InfJqGridData(dataTable, gridSettings));
     }
 }
Exemplo n.º 10
0
 public ActionResult CarriageTypeGridData(GridSettings gridSettings)
 {
     using (var dataTable = CRCDataAccess.GetCarriageTypes())
     {
         return(InfJqGridData(dataTable, gridSettings));
     }
 }
Exemplo n.º 11
0
 public LeadInLeadOutViewModel()
 {
     CarriageType       = new[] { "Regular", "NPR Newscasts" }.ToSelectListItems();
     ProgramEnabledList = new[] { "Yes", "No", "Both" }.ToSelectListItems();
     //ProgramList = new[] { "abc", "abc", "abc" }.ToSelectListItems();
     ProgramList      = CRCDataAccess.GetProgramLookup_ED("Yes").ToSelectListItems("ProgramID", "ProgramName").OrderBy(li => li.Text).AddBlankFirstItem();;
     MonthsFromList   = CRCDataAccess.GetMonthsList().ToSelectListItems("MonthNumber", "MonthName").SetSelected(DateTime.UtcNow.Month);
     YearsFromList    = CRCDataAccess.GetScheduleYearsList(2).ToSelectListItems().SetSelected(DateTime.UtcNow.Year);
     MonthsToList     = CRCDataAccess.GetMonthsList().ToSelectListItems("MonthNumber", "MonthName").SetSelected(DateTime.UtcNow.Month);
     YearsToList      = CRCDataAccess.GetScheduleYearsList(2).ToSelectListItems().SetSelected(DateTime.UtcNow.Year);
     ReportFormatList = new[] { "Excel", "CSV", "PDF" }.ToSelectListItems();
     //BandList = new[] { "Terrestrial", "Terrestrial & HD Multicast", "HD Multicast", "HD All" }.ToSelectListItems();
     GetBandList();
     StationEnabledList = new[] { "Yes", "No", "Both" }.ToSelectListItems();
     MemberStatusList   = CRCDataAccess.GetMemberStatusEnabled().ToSelectListItems().OrderBy(li => li.Text).AddBlankFirstItem();
     StationList        = CRCDataAccess.GetStationsList().ToSelectListItems("StationId", "DisplayName").OrderBy(li => li.Text).AddBlankFirstItem();
     StationStateList   = CRCDataAccess.GetStates().ToSelectListItems("StateId", "Abbreviation").OrderBy(li => li.Text).AddBlankFirstItem();
     StationCityList    = CRCDataAccess.GetCities().ToSelectListItems("City", "City").OrderBy(li => li.Text).AddBlankFirstItem();
     DaysList           = new[] { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" }.ToSelectListItems();
     StartTimeList      = new[] {
         "12:00 AM", "12:15 AM", "12:30 AM", "12:45 AM", "1:00 AM", "1:15 AM", "1:30 AM", "1:45 AM", "2:00 AM", "2:15 AM", "2:30 AM", "2:45 AM", "3:00 AM", "3:15 AM", "3:30 AM", "3:45 AM", "4:00 AM", "4:15 AM", "4:30 AM", "4:45 AM", "5:00 AM", "5:15 AM", "5:30 AM", "5:45 AM", "6:00 AM", "6:15 AM", "6:30 AM", "6:45 AM", "7:00 AM", "7:15 AM", "7:30 AM", "7:45 AM", "8:00 AM", "8:15 AM", "8:30 AM", "8:45 AM", "9:00 AM", "9:15 AM", "9:30 AM", "9:45 AM", "10:00 AM", "10:15 AM", "10:30 AM", "10:45 AM", "11:00 AM", "11:15 AM", "11:30 AM", "11:45 AM", "12:00 PM", "12:15 PM", "12:30 PM", "12:45 PM", "1:00 PM", "1:15 PM", "1:30 PM", "1:45 PM", "2:00 PM", "2:15 PM", "2:30 PM", "2:45 PM", "3:00 PM", "3:15 PM", "3:30 PM", "3:45 PM", "4:00 PM", "4:15 PM", "4:30 PM", "4:45 PM", "5:00 PM", "5:15 PM", "5:30 PM", "5:45 PM", "6:00 PM", "6:15 PM", "6:30 PM", "6:45 PM", "7:00 PM", "7:15 PM", "7:30 PM", "7:45 PM", "8:00 PM", "8:15 PM", "8:30 PM", "8:45 PM", "9:00 PM", "9:15 PM", "9:30 PM", "9:45 PM", "10:00 PM", "10:15 PM", "10:30 PM", "10:45 PM", "11:00 PM", "11:15 PM", "11:30 PM", "11:45 PM"
     }.ToSelectListItems();
     EndTimeList = new[] {
         "12:15 AM", "12:30 AM", "12:45 AM", "1:00 AM", "1:15 AM", "1:30 AM", "1:45 AM", "2:00 AM", "2:15 AM", "2:30 AM", "2:45 AM", "3:00 AM", "3:15 AM", "3:30 AM", "3:45 AM", "4:00 AM", "4:15 AM", "4:30 AM", "4:45 AM", "5:00 AM", "5:15 AM", "5:30 AM", "5:45 AM", "6:00 AM", "6:15 AM", "6:30 AM", "6:45 AM", "7:00 AM", "7:15 AM", "7:30 AM", "7:45 AM", "8:00 AM", "8:15 AM", "8:30 AM", "8:45 AM", "9:00 AM", "9:15 AM", "9:30 AM", "9:45 AM", "10:00 AM", "10:15 AM", "10:30 AM", "10:45 AM", "11:00 AM", "11:15 AM", "11:30 AM", "11:45 AM", "12:00 PM", "12:15 PM", "12:30 PM", "12:45 PM", "1:00 PM", "1:15 PM", "1:30 PM", "1:45 PM", "2:00 PM", "2:15 PM", "2:30 PM", "2:45 PM", "3:00 PM", "3:15 PM", "3:30 PM", "3:45 PM", "4:00 PM", "4:15 PM", "4:30 PM", "4:45 PM", "5:00 PM", "5:15 PM", "5:30 PM", "5:45 PM", "6:00 PM", "6:15 PM", "6:30 PM", "6:45 PM", "7:00 PM", "7:15 PM", "7:30 PM", "7:45 PM", "8:00 PM", "8:15 PM", "8:30 PM", "8:45 PM", "9:00 PM", "9:15 PM", "9:30 PM", "9:45 PM", "10:00 PM", "10:15 PM", "10:30 PM", "10:45 PM", "11:00 PM", "11:15 PM", "11:30 PM", "11:45 PM", "Midnight"
     }.ToSelectListItems();
 }
Exemplo n.º 12
0
 public ActionResult ProducerContactGridData(GridSettings gridSettings)
 {
     using (var dataTable = CRCDataAccess.GetProducers())
     {
         return(InfJqGridData(dataTable, gridSettings));
     }
 }
Exemplo n.º 13
0
 public ActionResult MajorFormatsGridData(GridSettings gridSettings)
 {
     using (var dataTable = CRCDataAccess.GetMajorFormats())
     {
         return(InfJqGridData(dataTable, gridSettings));
     }
 }
Exemplo n.º 14
0
 public ActionResult SearchByProgramProducerGridData(GridSettings gridSettings, long?programId, long?producerId)
 {
     using (var dataTable = CRCDataAccess.SearchProgramProducers(programId, producerId))
     {
         return(InfJqGridData(dataTable, gridSettings));
     }
 }
Exemplo n.º 15
0
        public ActionResult ResetPassword(string token)
        {
            var viewModel = new ResetPasswordViewModel();

            viewModel.Token = token;

            if (string.IsNullOrWhiteSpace(token))
            {
                viewModel.Status = ResetPasswordStatus.NoTokenProvided;
            }
            else
            {
                var drUser = CRCDataAccess.GetCRCUserByResetPasswordToken(token);
                if (drUser == null)
                {
                    viewModel.Status = ResetPasswordStatus.TokenInvalid;
                }
                else
                {
                    viewModel.Status = ResetPasswordStatus.TokenValid;
                    viewModel.Email  = drUser["Email"].ToString();
                }
            }

            return(View(viewModel));
        }
Exemplo n.º 16
0
 public ActionResult ProgrammingSchedulesGridData(GridSettings gridSettings, long stationId)
 {
     using (var dataTable = CRCDataAccess.SearchSchedules(stationId, null, null, null))
     {
         return(InfJqGridData(dataTable, gridSettings));
     }
 }
Exemplo n.º 17
0
 public ActionResult CRCUsersGridData(GridSettings gridSettings, string userEnabled, string stationEnabled, string userName, long?repeaterStatusId, string userRole, string band, string userPermission, long?stationId)
 {
     using (var dataTable = CRCDataAccess.SearchUsers(userEnabled, stationEnabled, userName, repeaterStatusId, userRole, band, userPermission, stationId))
     {
         return(InfJqGridData(dataTable, gridSettings));
     }
 }
Exemplo n.º 18
0
        public ActionResult SendPasswordResetEmail(string userEmail)
        {
            var drResetPassword = CRCDataAccess.SaveCRCUserPasswordReset(userEmail, null);

            if (drResetPassword != null)
            {
                InfEmail.AddToQueue(
                    "Reset Password",
                    new
                {
                    ResetPasswordLink   = string.Format(CultureInfo.InvariantCulture, "{0}?token={1}", Url.Action("ResetPassword", "Home", null, Request.Url.Scheme), drResetPassword["Token"].ToString()),
                    CRCUserFirstName    = drResetPassword["CRCUserFirstName"].ToString(),
                    CRCUserLastName     = drResetPassword["CRCUserLastName"].ToString(),
                    CRCUserEmail        = drResetPassword["CRCUserEmail"].ToString(),
                    CRCManagerFirstName = drResetPassword["CRCManagerFirstName"].ToString(),
                    CRCManagerLastName  = drResetPassword["CRCManagerLastName"].ToString(),
                    CRCManagerEmail     = drResetPassword["CRCManagerEmail"].ToString(),
                    CRCManagerPhone     = drResetPassword["CRCManagerPhone"].ToString(),
                    CRCManagerJobTitle  = drResetPassword["CRCManagerJobTitle"].ToString()
                },
                    CRCUser != null ? CRCUser.UserId : (long)drResetPassword["UserId"]);

                return(Json(true));
            }

            return(Json(false));
        }
Exemplo n.º 19
0
 public ActionResult ManageStationLinksGridData(GridSettings gridSettings, long userId)
 {
     using (var dataTable = CRCDataAccess.GetStationsForUserId(userId))
     {
         return(InfJqGridData(dataTable, gridSettings));
     }
 }
Exemplo n.º 20
0
 public ActionResult AddEditStationLinkGridData(GridSettings gridSetting, long userId)
 {
     using (var dataTable = CRCDataAccess.GetStationListForGrid(userId))
     {
         return(InfJqGridData(dataTable, gridSetting));
     }
 }
Exemplo n.º 21
0
 public ActionResult ManageProgramProducersGridData(GridSettings gridSettings, long programId)
 {
     using (var dataTable = CRCDataAccess.GetProgramProducersByProgramId(programId))
     {
         return(InfJqGridData(dataTable, gridSettings));
     }
 }
Exemplo n.º 22
0
        public ActionResult ForgotPassword(ForgotPasswordViewModel viewModel)
        {
            if (ModelState.IsValid)
            {
                var drResetPassword = CRCDataAccess.SaveCRCUserPasswordReset(viewModel.Email, null);
                if (drResetPassword != null)
                {
                    InfEmail.AddToQueue(
                        "Reset Password",
                        new
                    {
                        ResetPasswordLink   = string.Format(CultureInfo.InvariantCulture, "{0}?token={1}", Url.Action("ResetPassword", "Home", null, Request.Url.Scheme), drResetPassword["Token"].ToString()),
                        CRCUserFirstName    = drResetPassword["CRCUserFirstName"].ToString(),
                        CRCUserLastName     = drResetPassword["CRCUserLastName"].ToString(),
                        CRCUserEmail        = drResetPassword["CRCUserEmail"].ToString(),
                        CRCManagerFirstName = drResetPassword["CRCManagerFirstName"].ToString(),
                        CRCManagerLastName  = drResetPassword["CRCManagerLastName"].ToString(),
                        CRCManagerEmail     = drResetPassword["CRCManagerEmail"].ToString(),
                        CRCManagerPhone     = drResetPassword["CRCManagerPhone"].ToString(),
                        CRCManagerJobTitle  = drResetPassword["CRCManagerJobTitle"].ToString()
                    },
                        CRCUser != null ? CRCUser.UserId : (long)drResetPassword["UserId"]);

                    viewModel.Status = true;
                    return(View(viewModel));
                }
            }

            viewModel.Status = false;
            return(View(viewModel));
        }
Exemplo n.º 23
0
 public ActionResult ProgramFormatTypeGridData(GridSettings gridSettings)
 {
     using (var dataTable = CRCDataAccess.GetProgramFormatTypes())
     {
         return(InfJqGridData(dataTable, gridSettings));
     }
 }
 public ActionResult MinorityStatusGridData(GridSettings gridSettings)
 {
     using (var dataTable = CRCDataAccess.GetMinorityStatuses())
     {
         return(InfJqGridData(dataTable, gridSettings));
     }
 }
Exemplo n.º 25
0
 public ActionResult SearchByProgramGridData(GridSettings gridSettings, long?programId, long?programSourceId, string enabled, long?programFormatTypeId, long?majorFormatId)
 {
     using (var dataTable = CRCDataAccess.SearchPrograms(programId, programSourceId, programFormatTypeId, majorFormatId, enabled))
     {
         return(InfJqGridData(dataTable, gridSettings));
     }
 }
Exemplo n.º 26
0
        public ActionResult NewUserRequest(
            string First_Name_NU,
            string Last_Name_NU,
            string Email_NU,
            string Phone_NU,
            string Call_Letters_NU,
            string Title_NU
            )
        //public ActionResult NewUserRequest(
        //	string emailBody
        //)
        {
            var viewModel    = new SignInViewModel();
            var drCRCManager = CRCDataAccess.GetCRCManager();

            if (drCRCManager != null)
            {
                viewModel.CRCManagerEmail      = drCRCManager["Email"].ToString();
                viewModel.CRCManagerPhone      = drCRCManager["Phone"].ToString();
                viewModel.CRCManagerFirstName  = drCRCManager["FirstName"].ToString();
                viewModel.CRCManagerMiddleName = drCRCManager["MiddleName"].ToString();
                viewModel.CRCManagerLastName   = drCRCManager["LastName"].ToString();
                viewModel.userId = Convert.ToInt64(drCRCManager["UserId"]);
                //viewModel.Email = Session["useremail"].ToString();
            }
            string UserEmail = CRCUser.Email;
            string emailBody = viewModel.CRCManagerFirstName + " - Please Add the User below to station: " + Call_Letters_NU + "\n\n";

            emailBody += "First Name: " + "  " + First_Name_NU;
            emailBody += "\n" + "Last Name:" + "  " + Last_Name_NU;
            emailBody += "\n" + "Email: " + "  " + Email_NU;
            emailBody += "\n" + "Phone: " + "  " + Phone_NU;
            emailBody += "\n" + "Call Letters: " + "  " + Call_Letters_NU;
            emailBody += "\n" + "Title: " + "  " + Title_NU;
            emailBody += "\n" + "Submitted By:" + "  " + UserEmail;



            InfEmail.AddToQueue(UserEmail, viewModel.CRCManagerEmail, "New CRC User Request: " + Call_Letters_NU, emailBody, 1);
            //try
            //{
            //	CRCDataAccess.RemoveUserStationLink(userId, stationId);
            //}
            //catch (EntitySqlException e)
            //{
            //	Console.Write(e);
            //}


            //if (primaryUserId.HasValue)
            //{

            //	if (userId == primaryUserId)
            //	{
            //		CRCDataAccess.UpdatePrimaryUserStatus(stationId);
            //	}
            //}
            return(Json("1", JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 27
0
        public ActionResult CalendarPrint(long scheduleId)
        {
            var viewModel = new CalendarPrintViewModel();
            var dataRow   = CRCDataAccess.GetSchedule(scheduleId, CRCUser.UserId);

            dataRow.MapTo(viewModel);
            return(View(viewModel));
        }
 public ActionResult StationsGridData(GridSettings gridSettings, long?stationId, long?repeaterStatusId, long?metroMarketId, string enabled, long?memberStatusId, long?dmaMarketId, string bandId, long?stateId, long?licenseeTypeId, long?affiliateId)
 {
     using (var dataTable = CRCDataAccess.SearchStations(stationId, repeaterStatusId, metroMarketId, enabled, memberStatusId, dmaMarketId, bandId, stateId, licenseeTypeId, affiliateId))
     {
         return(InfJqGridData(dataTable, gridSettings));
         //return null;
     }
 }
 public ActionResult StationsGridDataReport(GridSettings gridSettings, long?stationId, long?repeaterStatusId, long?metroMarketId, string enabled, long?memberStatusId, long?dmaMarketId, string bandId, long?stateId, long?licenseeTypeId, long?affiliateId)
 {
     using (var dataTable = CRCDataAccess.SearchStations(stationId, repeaterStatusId, metroMarketId, enabled, memberStatusId, dmaMarketId, bandId, stateId, licenseeTypeId, affiliateId))
     {
         //return InfJqGridData(dataTable, gridSettings);
         ConvertToXLSX(dataTable, "test", false, -1);
         return(null);
     }
 }
Exemplo n.º 30
0
 public ParticipatingStationViewModel()
 {
     CurrentSeasonList = new[] { "Winter", "Spring", "Summer", "Fall" }.ToSelectListItems();
     CurrentYearList   = CRCDataAccess.GetScheduleYearsList(2).ToSelectListItems().SetSelected(DateTime.UtcNow.Year);
     PastSeasonList    = new[] { "Winter", "Spring", "Summer", "Fall" }.ToSelectListItems();
     PastYearList      = CRCDataAccess.GetScheduleYearsList(2).ToSelectListItems().SetSelected(DateTime.UtcNow.Year);
     GetBandList();
     FormatList = new[] { "EXCEL", "PDF", "CSV" }.ToSelectListItems();
 }