Example #1
0
        private void PopulateGrid()
        {
            if (ddlSite.SelectedIndex < 1)
            {
                return;
            }

            if (gvDocuments.Visible)
            {
                PopulateDocumentsGrid();
            }
            else if (gvSendTo.Visible)
            {
                PopulateSendToGrid();
            }
            else if (pnlRunNewBatch.Visible)
            {
                List <Batch> batches = AdminHelper.GetBatchesForSite(ddlSite.SelectedItem.Text);
                if (batches != null)
                {
                    lLastBatchRun.Text = "the last batch run date of " + batches[0].endDate.ToString("g");
                }
                else
                {
                    lLastBatchRun.Text = "the default time period of " + ConfigurationManager.AppSettings["DaysToCheckIfNoPreviousBatchRun"] + " days ago since there is no previous batch";
                }

                int numNewBatchDocuments = PopulateNewBatchDocumentsRepeater();
                pnlNoNewBatchDocuments.Visible   = (numNewBatchDocuments == 0);
                pnlNewBatchDocumentsHead.Visible = (numNewBatchDocuments > 0);
                rNewBatchDocuments.Visible       = (numNewBatchDocuments > 0);
                bRunBatch.Visible = (numNewBatchDocuments > 0);
            }
        }
Example #2
0
        protected void ddlSite_SelectedIndexChanged(object sender, EventArgs e)
        {
            ddlBatch.DataSource     = AdminHelper.GetBatchesForSite(ddlSite.SelectedItem.Text);
            ddlBatch.DataTextField  = "startDate";
            ddlBatch.DataValueField = "batchId";
            ddlBatch.DataBind();

            PopulateGrid();
        }
Example #3
0
        public void GetBatchesForSiteTest()
        {
            string       site     = Constants.site;
            List <Batch> expected = null; // TODO: Initialize to an appropriate value
            List <Batch> actual;

            actual = AdminHelper.GetBatchesForSite(site);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }