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); } }
protected void ddlSite_SelectedIndexChanged(object sender, EventArgs e) { ddlBatch.DataSource = AdminHelper.GetBatchesForSite(ddlSite.SelectedItem.Text); ddlBatch.DataTextField = "startDate"; ddlBatch.DataValueField = "batchId"; ddlBatch.DataBind(); PopulateGrid(); }
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."); }