Esempio n. 1
0
        private void drpbx_IngestionSource_SelectedValueChanged(object sender, EventArgs e)
        {
            bool result = true;


            SQLFunction sqlfunc = new SQLFunction();

            lstbx_MediaType.Items.Clear();
            lstbx_Publisher.Items.Clear();

            if (Grd_MetaDataPub.ColumnCount > 0)
            {
                Grd_MetaDataPub.DataSource = null;
                Grd_MetaDataPub.Columns.Clear();

                btn_Injestion.BackColor = Color.DimGray;
                btn_Injestion.Enabled   = false;
                btn_Injestion.Refresh();
                System.Windows.Forms.Application.DoEvents();

                btn_Ingestion2.BackColor = Color.DimGray;
                btn_Ingestion2.Enabled   = false;
                btn_Ingestion2.Refresh();
                System.Windows.Forms.Application.DoEvents();


                btn_ErrorLog.BackColor = Color.DimGray;
                btn_ErrorLog.Enabled   = false;
                btn_ErrorLog.Refresh();
                System.Windows.Forms.Application.DoEvents();
            }



            if (drpbx_IngestionSource.SelectedValue.ToString() == "Recorded Books")
            {
                lbl_CompanySelected.Text = "RB";
                lbl_CompanySelected.Refresh();
                System.Windows.Forms.Application.DoEvents();

                ErrorLogCount("RB");
                Check_TitleCount("RB");

                btn_RoyaltyRateDiscount.Visible = true;
                btn_RoyaltyRateDiscount.Enabled = true;

                lbl_Message.Text = "";
                #region 'Populate the MediaType'
                result = sqlfunc.PopulateMediaType("RB", lstbx_MediaType);
                #endregion
            }
            else if (drpbx_IngestionSource.SelectedValue.ToString() == "W F Howes")
            {
                lbl_CompanySelected.Text = "WFH";
                lbl_CompanySelected.Refresh();
                System.Windows.Forms.Application.DoEvents();


                if (System.Configuration.ConfigurationManager.AppSettings["Platform"].ToString().ToLower() != "dev")
                {
                    ImpersonateUser iU = new ImpersonateUser();
                    // TODO: Replace credentials
                    iU.Impersonate();
                }
                ErrorLogCount("WFH");
                Check_TitleCount("WFH");

                btn_RoyaltyRateDiscount.Visible = false;
                btn_RoyaltyRateDiscount.Enabled = false;

                lbl_Message.Text = "";
                #region 'Populate the MediaType'
                result = sqlfunc.PopulateMediaType("WFH", lstbx_MediaType);
                #endregion
            }
            else
            {
                lbl_CompanySelected.Text = "";
                lbl_CompanySelected.Refresh();
                System.Windows.Forms.Application.DoEvents();

                lbl_Message.Text = "";

                lstbx_MediaType.Items.Clear();
                lstbx_Publisher.Items.Clear();
            }

            if (!result)
            {
                lbl_Message.Text = "There has been some problem with your request. Please Check the Error Logs";
            }
        }