Ejemplo n.º 1
0
 public static void RemoveProgramProducer(long programProducerId)
 {
     using (var sqlHelper = new InfSqlHelper())
     {
         sqlHelper.ExecuteNonQueryProcedure(
             "dbo.PSP_ProgramProducer_DELETE",
             new SqlParameter("@ProgramProducerId", programProducerId));
     }
 }
Ejemplo n.º 2
0
 public static void DeleteSchedule(long scheduleId)
 {
     using (var sqlHelper = new InfSqlHelper())
     {
         sqlHelper.ExecuteNonQueryProcedure(
             "dbo.PSP_Schedule_Del",
             new SqlParameter("@ScheduleId", scheduleId));
     }
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Saves a success status for the specified InfEmail record.
 /// </summary>
 public static void SaveSuccessStatus(long InfEmailId)
 {
     using (var sqlHelper = new InfSqlHelper())
     {
         sqlHelper.ExecuteNonQueryProcedure(
             "dbo.PSP_InfEmailSuccess_Update",
             new SqlParameter("@InfEmailId", InfEmailId));
     }
 }
 public static void DeleteScheduleNewscast(long scheduleNewscastId, long lastUpdatedUserId)
 {
     using (var sqlHelper = new InfSqlHelper())
     {
         sqlHelper.ExecuteNonQueryProcedure(
             "dbo.PSP_ScheduleNewscast_Del",
             new SqlParameter("@ScheduleNewscastId", scheduleNewscastId),
             new SqlParameter("@LastUpdatedUserId", lastUpdatedUserId));
     }
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Saves an error status for the specified InfEmail record.
 /// </summary>
 public static void SaveErrorStatus(long InfEmailId, string lastError)
 {
     using (var sqlHelper = new InfSqlHelper())
     {
         sqlHelper.ExecuteNonQueryProcedure(
             "dbo.PSP_InfEmailError_Update",
             new SqlParameter("@InfEmailId", InfEmailId),
             new SqlParameter("@LastError", lastError));
     }
 }
Ejemplo n.º 6
0
 public static void SaveScheduleStatus(long scheduleId, string status, long lastUpdateduserId)
 {
     using (var sqlHelper = new InfSqlHelper())
     {
         sqlHelper.ExecuteNonQueryProcedure(
             "dbo.PSP_ScheduleCalendarStatus_Save",
             new SqlParameter("@ScheduleId", scheduleId),
             new SqlParameter("@ScheduleStatus", status),
             new SqlParameter("@LastUpdatedUserId", lastUpdateduserId));
     }
 }
Ejemplo n.º 7
0
 public static void SaveProgramProducer(long programId, long?producerId, long lastUpdatedUserId)
 {
     using (var sqlHelper = new InfSqlHelper())
     {
         sqlHelper.ExecuteNonQueryProcedure(
             "dbo.PSP_ProgramProducer_Save",
             new SqlParameter("@ProgramId", programId),
             new SqlParameter("@ProducerId", producerId),
             new SqlParameter("@LastUpdatedUserId", lastUpdatedUserId));
     }
 }
 public static void SaveCRCUserPassword(long userId, string password, long lastUpdatedUserId)
 {
     using (var sqlHelper = new InfSqlHelper())
     {
         sqlHelper.ExecuteNonQueryProcedure(
             "dbo.PSP_CRCUserPassword_Save",
             new SqlParameter("@UserId", userId),
             new SqlParameter("@Password", password),
             new SqlParameter("@LastUpdatedUserId", lastUpdatedUserId));
     }
 }
Ejemplo n.º 9
0
 public static void SubmitSchedule(long scheduleId, string dNAInd, string disableValidation, long lastUpdatedUserId)
 {
     using (var sqlHelper = new InfSqlHelper())
     {
         sqlHelper.ExecuteNonQueryProcedure(
             "dbo.PSP_ScheduleCalendar_Save",
             new SqlParameter("@ScheduleId", scheduleId),
             new SqlParameter("@DNAInd", dNAInd),
             new SqlParameter("@disableValidation", disableValidation),
             new SqlParameter("@LastUpdatedUserid", lastUpdatedUserId));
     }
 }
Ejemplo n.º 10
0
 public static void DeleteStationNote(long stationNoteId, DateTime?deletedDate, long?deletedUserId, DateTime lastUpdatedDate, long lastUpdatedUserId)
 {
     using (var sqlHelper = new InfSqlHelper())
     {
         sqlHelper.ExecuteNonQueryProcedure(
             "dbo.PSP_StationNote_Del",
             new SqlParameter("@StationNoteId", stationNoteId),
             new SqlParameter("@DeletedDate", deletedDate),
             new SqlParameter("@DeletedUserId", deletedUserId),
             new SqlParameter("@LastUpdatedDate", lastUpdatedDate),
             new SqlParameter("@LastUpdatedUserId", lastUpdatedUserId));
     }
 }
        public static void SaveStationUser(long stationId, long userId, bool primaryUserInd, bool gridWritePermissionsInd, long lastUpdatedUserId)
        {
            using (var sqlHelper = new InfSqlHelper())
            {
                sqlHelper.ExecuteNonQueryProcedure(
                    "dbo.PSP_StationUser_Save",
                    new SqlParameter("@StationId", stationId),
                    new SqlParameter("@UserId", userId),
                    new SqlParameter("@PrimaryUserInd", primaryUserInd ? "Y" : "N"),
                    new SqlParameter("@GridWritePermissionsInd", gridWritePermissionsInd ? "Y" : "N"),
                    new SqlParameter("@LastUpdatedUserId", lastUpdatedUserId));
            }

            InfSqlHelper.ExpireCache("dbo.PSP_StationsForUserId_Get");
        }
Ejemplo n.º 12
0
 public void Log(InfLogEntry logEntry)
 {
     using (var transaction = new TransactionScope(TransactionScopeOption.Suppress))
     {
         using (var sqlHelper = new InfSqlHelper())
         {
             sqlHelper.ExecuteNonQueryProcedure(
                 "dbo.PSP_InfLog_Insert",
                 new SqlParameter("@SerialNumber", logEntry.SerialNumber),
                 new SqlParameter("@LogLevel", logEntry.LogLevel),
                 new SqlParameter("@Source", logEntry.Source),
                 new SqlParameter("@Message", logEntry.Message),
                 new SqlParameter("@UserName", logEntry.UserName),
                 new SqlParameter("@ServerAddress", logEntry.ServerAddress),
                 new SqlParameter("@ServerHostname", logEntry.ServerHostname),
                 new SqlParameter("@ClientAddress", logEntry.ClientAddress),
                 new SqlParameter("@ClientHostname", logEntry.ClientHostname));
         }
     }
 }
Ejemplo n.º 13
0
 public static void SaveCRCUserDataMigration(long?userId, string email, long?salutationId, string firstName, string middleName,
                                             string lastName, string suffix, string jobTitle, string addressLine1, string addressLine2, string city, long?stateId, string county, string country, string zipCode, string phone, string fax,
                                             bool administratorInd, bool crcManagerInd, DateTime?disabledDate, long?disabledUserId, long lastUpdatedUserId, string password)
 {
     using (var sqlHelper = new InfSqlHelper())
     {
         try
         {
             sqlHelper.ExecuteNonQueryProcedure(
                 "dbo.DT_CRCUsers_Save",
                 new SqlParameter("@UserId", userId),
                 new SqlParameter("@Email", email),
                 new SqlParameter("@SalutationId", salutationId),
                 new SqlParameter("@FirstName", firstName),
                 new SqlParameter("@MiddleName", middleName),
                 new SqlParameter("@LastName", lastName),
                 new SqlParameter("@Suffix", suffix),
                 new SqlParameter("@JobTitle", jobTitle),
                 new SqlParameter("@AddressLine1", addressLine1),
                 new SqlParameter("@AddressLine2", addressLine2),
                 new SqlParameter("@City", city),
                 new SqlParameter("@StateId", stateId),
                 new SqlParameter("@County", county),
                 new SqlParameter("@Country", country),
                 new SqlParameter("@ZipCode", zipCode),
                 new SqlParameter("@Phone", phone),
                 new SqlParameter("@Fax", fax),
                 new SqlParameter("@AdministratorInd", administratorInd ? "Y" : "N"),
                 new SqlParameter("@CRCManagerInd", crcManagerInd ? "Y" : "N"),
                 new SqlParameter("@DisabledDate", disabledDate),
                 new SqlParameter("@DisabledUserId", disabledUserId),
                 new SqlParameter("@LastUpdatedUserId", lastUpdatedUserId),
                 new SqlParameter("@Password", password));
         }
         catch (Exception ex)
         {
             Console.WriteLine("Could Not Insert User: "******" - " + ex.Message);
         }
     }
 }
Ejemplo n.º 14
0
        static void Main(string[] args)
        {
            //Set Connection String For legacy DB
            LegacySqlHelper.DefaultConnectionString = ConfigurationManager.ConnectionStrings["Legacy"].ConnectionString;
            LegacySqlHelper.DefaultCommandTimeout   = TimeSpan.FromSeconds(3);

            InfSqlHelper.DefaultConnectionString = ConfigurationManager.ConnectionStrings["Dev"].ConnectionString;
            InfSqlHelper.DefaultCommandTimeout   = TimeSpan.FromSeconds(3);
            Console.Write("Beginning. Press Any key to continue(Where's the 'Any' key?): ");
            Console.ReadKey();

            Console.WriteLine("Beginning data transfer... ");

            using (var sqlHelper = new InfSqlHelper())
            {
                using (var transactionScope = new TransactionScope())
                {
                    Console.WriteLine("Transferring Users to the CRCUser Table... ");
                    TransferCRCUsers();
                    Console.WriteLine("CRCUser Transfer Complete------- ");
                    Console.Write("Transfer complete. Press any key to transfer Grid data to Schedules.");
                    Console.ReadKey();
                    sqlHelper.ExecuteNonQueryProcedure("dbo.DT_Station", new SqlParameter("@UserId", userId));
                    sqlHelper.ExecuteNonQueryProcedure("dbo.DT_Affiliate", new SqlParameter("@UserId", userId));
                    //dbo.Band -- Transfered via ReferenceTableData.sql
                    //dbo.CarriageType -- Transfered via ReferenceTableData.sql
                    //dbo.DMAMarket -- Transfered via ReferenceTableData.sql
                    //Inf Tables --No Data Migration for these??
                    //dbo.LicenseeType -- Transfered via ReferenceTableData.sql
                    sqlHelper.ExecuteScalarProcedure("dbo.DT_MajorFormat", new SqlParameter("@UserId", userId));
                    //dbo.MemberStatus -- Transfered via ReferenceTableData.sql
                    //dbo.MetroMarket -- Transfered via ReferenceTableData.sql
                    //dbo.MinorityStatus Transfered via ReferenceTableData.sql
                    sqlHelper.ExecuteScalarProcedure("dbo.DT_ProgramSource", new SqlParameter("@UserId", userId));
                    sqlHelper.ExecuteScalarProcedure("dbo.DT_ProgramFormatType", new SqlParameter("@UserId", userId)); //crc3.dbo.ProgramFormat
                    sqlHelper.ExecuteScalarProcedure("dbo.DT_Producer", new SqlParameter("@UserId", userId));
                    sqlHelper.ExecuteScalarProcedure("dbo.DT_Program", new SqlParameter("@UserId", userId));
                    sqlHelper.ExecuteScalarProcedure("dbo.DT_ProgramProducer", new SqlParameter("@UserId", userId)); //crc.dbo.ProgramFormat --Info for this stored in crc3.dbo.Program
                    //dbo.repeaterStatus -- Transfered via ReferenceTableData.sql
                    //dbo.Salutation -- Transfered via ReferenceTableData.sql
                    //dbo.State -- Transfered via ReferenceTableData.sql
                    sqlHelper.ExecuteScalarProcedure("dbo.DT_StationAffiliate", new SqlParameter("@UserId", userId));
                    sqlHelper.ExecuteScalarProcedure("dbo.DT_StationNote", new SqlParameter("@UserId", userId));
                    sqlHelper.ExecuteScalarProcedure("dbo.DT_StationUser", new SqlParameter("@UserId", userId));
                    //dbo.TimeZone -- Transfered via ReferenceTableData.sql
                    Console.WriteLine("Transferring Grid data to Schedules...Please wait.");
                    sqlHelper.ExecuteNonQueryProcedure("dbo.DT_GridToSchedule");
                    Console.WriteLine("Transfer complete. Press any key to transfer PERegular1 Partition.");
                    Console.ReadKey();

                    Console.WriteLine("Transferring PERegular1 Partition data to ScheduleProgram...Please wait.");
                    sqlHelper.ExecuteNonQueryProcedure("dbo.DT_PERegularToScheduleProgram1");
                    Console.WriteLine("Transfer complete. Press any key to transfer PERegular2 Partition.");
                    Console.ReadKey();

                    Console.WriteLine("Transferring PERegular2 Partition data to ScheduleProgram...Please wait.");
                    sqlHelper.ExecuteNonQueryProcedure("dbo.DT_PERegularToScheduleProgram2");
                    Console.WriteLine("Transfer complete. Press any key to transfer PERegular3 Partition");
                    Console.ReadKey();

                    Console.WriteLine("Transferring PERegular3 Partition data to ScheduleProgram...Please wait.");
                    sqlHelper.ExecuteNonQueryProcedure("dbo.DT_PERegularToScheduleProgram3");
                    Console.WriteLine("Transfer complete. Press any key to transfer PERegular4 Partition");
                    Console.ReadKey();

                    Console.WriteLine("Transferring PERegular4 Partition data to ScheduleProgram...Please wait.");
                    sqlHelper.ExecuteNonQueryProcedure("dbo.DT_PERegularToScheduleProgram4");
                    Console.WriteLine("Transfer complete. Press any key to transfer PEModular Partition");
                    Console.ReadKey();

                    Console.WriteLine("Transferring PEModular Partition data to ScheduleNewscast...Please wait.");
                    sqlHelper.ExecuteNonQueryProcedure("dbo.DT_PEModularToScheduleNewscast");
                    Console.WriteLine("Transfer complete. Press any key to continue");
                    Console.ReadKey();

                    transactionScope.Complete();
                }
            }
        }