Ejemplo n.º 1
0
        private void InitilizeTest()
        {
            _testType = new PrivateType(typeof(BillingReports));
            _testType.SetStaticField("currentReport", new BillingReport {
            });
            var billingReport = new BillingReports();

            _privateTestObject = new PrivateObject(billingReport);
            InitializeAllControls(billingReport);
            InitilizeFakes();
            _privateTestObject.Invoke("Page_Load", new object[] { null, null });
            _listBillingReport     = new List <BillingReport>();
            _listBillingReportItem = new List <BillingReportItem>();
            BillingReports.dtFlatRateItems.Rows.Clear();
            var dataRow = BillingReports.dtFlatRateItems.NewRow();

            dataRow["ID"]        = "-1";
            dataRow["ItemName"]  = "1";
            dataRow["Amount"]    = "1";
            dataRow["IsDeleted"] = "false";
            BillingReports.dtFlatRateItems.Rows.Add(dataRow);
            dataRow              = BillingReports.dtFlatRateItems.NewRow();
            dataRow["ID"]        = "1";
            dataRow["ItemName"]  = "1";
            dataRow["Amount"]    = "1";
            dataRow["IsDeleted"] = "false";
            BillingReports.dtFlatRateItems.Rows.Add(dataRow);
            dataRow              = BillingReports.dtFlatRateItems.NewRow();
            dataRow["ID"]        = "1";
            dataRow["ItemName"]  = "1";
            dataRow["Amount"]    = "1";
            dataRow["IsDeleted"] = "true";
            BillingReports.dtFlatRateItems.Rows.Add(dataRow);
            _lstbxCustomers.SelectedIndex = 0;
            _lstbxBlastColumns.Items.Add("sendtime");
            _lstbxBlastColumns.Items.Add("blastfield1");
            _lstbxBlastColumns.Items.Add("blastfield2");
            _lstbxBlastColumns.Items.Add("blastfield3");
            _lstbxBlastColumns.Items.Add("blastfield4");
            _lstbxBlastColumns.Items.Add("blastfield5");
            _lstbxBlastColumns.Items.Add("fromemail");
            _lstbxBlastColumns.Items.Add("fromname");
            _lstbxBlastColumns.Items.Add("emailsubject");
            _lstbxBlastColumns.Items.Add("groupname");
            _lstbxBlastColumns.SelectedIndex = 0;
            _txtRunToDate.Text   = "1.1.2018";
            _txtRunFromDate.Text = "1.1.2018";
        }
Ejemplo n.º 2
0
        //Methods
        private void GetReportsFromNamespace(Assembly assembly, string nameSpace)
        {
            List <Type> reportTypes = assembly.GetTypes().Where(t => t.IsClass && string.Equals(t.Namespace, nameSpace, StringComparison.Ordinal)).ToList();

            object[] repParams = new object[] { _rss };
            foreach (Type t in reportTypes)
            {
                IReport instance = (IReport)Activator.CreateInstance(t, repParams);

                switch (instance.Category)
                {
                case ReportCategories.Billing:
                    BillingReports.Add(instance);
                    break;

                case ReportCategories.OHP:
                    OHPReports.Add(instance);
                    break;

                default:
                    break;
                }
            }
        }