protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                InventoryStatusController    inventory     = new InventoryStatusController();
                List <InventoryStatusReport> inventoryList = inventory.GetInventoryList();


                // Microsoft
                DataSetReorderBySupplier ds2 = new DataSetReorderBySupplier();
                DataTable t2 = ds2.DataTable4;

                DataRow r2;
                foreach (InventoryStatusReport s in inventoryList)
                {
                    r2 = t2.NewRow();

                    r2["ItemCode"]          = s.ItemCode;
                    r2["ItemName"]          = s.ItemName;
                    r2["Description"]       = s.Description;
                    r2["Location"]          = s.Location;
                    r2["Balance"]           = s.Balance;
                    r2["UnitOfMeasurement"] = s.UnitOfMeasurement;
                    r2["ReorderLevel"]      = s.ReorderLevel;
                    t2.Rows.Add(r2);
                }

                ReportDataSource rds = new ReportDataSource("DataSet1", t2);
                reportViewer1.LocalReport.DataSources.Clear();
                reportViewer1.LocalReport.DataSources.Add(rds);
                reportViewer1.LocalReport.Refresh();
            }
        }
Beispiel #2
0
        protected void btnGenerate_Click(object sender, EventArgs e)
        {
            if (phMonth.Controls.Count == 1)
            {
                TextBox month =
                    Master.FindControl("body").FindControl("textbox" + 1) as TextBox;
                if (month.Text != "")
                {
                    monthList.Add(month.Text);
                }
            }
            else
            {
                for (int i = 1; i <= phMonth.Controls.Count; i++)
                {
                    TextBox month =
                        Master.FindControl("body").FindControl("textbox" + i) as TextBox;
                    if (month.Text != "")
                    {
                        if (monthList.Count != 0)
                        {
                            if (!CheckDuplicate(month.Text))
                            {
                                monthList.Add(month.Text);
                            }
                        }
                        else
                        {
                            monthList.Add(month.Text);
                        }
                    }
                }
            }

            if (monthList.Count > 0)
            {
                supplierOrderReport = generateReorderController.GetReportBySupplier(ddlItems.SelectedValue, monthList);
            }
            DataSetReorderBySupplier ds2 = new DataSetReorderBySupplier();
            DataTable t2 = ds2.DataTable1;

            DataRow r2;

            foreach (SupplierOrderReport s in supplierOrderReport)
            {
                r2 = t2.NewRow();
                r2["OrderDate"]     = CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(s.OrderDate.Month) + "-" + s.OrderDate.Year;
                r2["SupplierOne"]   = s.SupplierOne;
                r2["SupplierTwo"]   = s.SupplierTwo;
                r2["SupplierThree"] = s.SupplierThree;
                t2.Rows.Add(r2);
            }

            ReportDataSource rds = new ReportDataSource("DataSet1", t2);

            ReportViewer1.LocalReport.DataSources.Clear();
            ReportViewer1.LocalReport.DataSources.Add(rds);
            ReportViewer1.LocalReport.Refresh();
            pnlContents.Visible = true;
        }
Beispiel #3
0
        protected void btnGenerate_Click(object sender, EventArgs e)
        {
            try
            {
                var monthList = new List <String>();
                if (monthList.Count == 1)
                {
                    TextBox month =
                        Master.FindControl("body").FindControl("textbox" + 1) as TextBox;
                    if (month.Text != "")
                    {
                        monthList.Add(month.Text);
                    }
                }
                else
                {
                    for (int i = 1; i <= phMonth.Controls.Count; i++)
                    {
                        TextBox month =
                            Master.FindControl("body").FindControl("textbox" + i) as TextBox;
                        if (month.Text != "")
                        {
                            monthList.Add(month.Text);
                        }
                    }
                }
                if (monthList.Count > 0)
                {
                    departmentRequisitionReportList = generateRequisitionTrendReportController.GetReportByDepartment(monthList);
                }


                // Microsoft
                DataSetReorderBySupplier ds2 = new DataSetReorderBySupplier();
                DataTable t2 = ds2.Tables.Add("SupplierOrderReport");
                t2.Columns.Add("RequisitionDate", Type.GetType("System.String"));
                t2.Columns.Add("CommerceDept", Type.GetType("System.Int32"));
                t2.Columns.Add("ComputerScience", Type.GetType("System.Int32"));
                t2.Columns.Add("EnglishDept", Type.GetType("System.Int32"));
                t2.Columns.Add("RegistrarDept", Type.GetType("System.Int32"));
                t2.Columns.Add("ZoologyDept", Type.GetType("System.Int32"));

                DataRow r2;
                foreach (DepartmentRequisitionReport d in departmentRequisitionReportList)
                {
                    r2 = t2.NewRow();
                    r2["RequisitionDate"] = CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(d.RequisitionDate.Month) + "-" + d.RequisitionDate.Year;
                    r2["CommerceDept"]    = d.CommerceDept;
                    r2["ComputerScience"] = d.ComputerScience;
                    r2["EnglishDept"]     = d.EnglishDept;
                    r2["RegistrarDept"]   = d.RegistrarDept;
                    r2["ZoologyDept"]     = d.ZoologyDept;
                    t2.Rows.Add(r2);
                }
                ReportDataSource rds = new ReportDataSource("DataSet1", t2);
                ReportViewer1.LocalReport.DataSources.Clear();
                ReportViewer1.LocalReport.DataSources.Add(rds);
                ReportViewer1.LocalReport.Refresh();
                pnlContents.Visible = true;
            }
            catch
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Something wrong!')", true);
            }
        }
        protected void btnGenerate_Click(object sender, EventArgs e)
        {
            var monthList          = new List <String>();
            var categoryStringList = new List <String>();

            if (phMonth.Controls.Count == 1)
            {
                TextBox month =
                    Master.FindControl("body").FindControl("textbox" + 1) as TextBox;
                if (month.Text != "")
                {
                    monthList.Add(month.Text);
                }
            }
            else
            {
                for (int i = 1; i <= phMonth.Controls.Count; i++)
                {
                    TextBox month =
                        Master.FindControl("body").FindControl("textbox" + i) as TextBox;
                    if (month.Text != "")
                    {
                        monthList.Add(month.Text);
                    }
                }
            }

            for (int i = 1; i <= phCategory.Controls.Count; i++)
            {
                CheckBox category =
                    Master.FindControl("body").FindControl("checkBox" + i) as CheckBox;
                if (category.Checked)
                {
                    categoryStringList.Add(category.Text);
                }
            }
            if (monthList.Count > 0)
            {
                categpryOrderReport = generateReorderController.GetReportByCategory(categoryStringList, monthList);
            }
            DataSetReorderBySupplier ds2 = new DataSetReorderBySupplier();
            DataTable t = ds2.DataTable2;

            foreach (CategoryOrderReport c in categpryOrderReport)
            {
                DataRow r2 = t.NewRow();
                r2["OrderDate"] = CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(c.OrderDate.Month) + "-" + c.OrderDate.Year;
                r2["Clip"]      = c.Clip;
                r2["Envelope"]  = c.Envelope;
                r2["Eraser"]    = c.Eraser;
                r2["Exercise"]  = c.Exercise;
                r2["File"]      = c.File;
                r2["Pen"]       = c.Pen;
                r2["Puncher"]   = c.Puncher;
                r2["Pad"]       = c.Pad;
                r2["Paper"]     = c.Paper;
                r2["Ruler"]     = c.Ruler;
                r2["Scissors"]  = c.Scissors;
                r2["Tape"]      = c.Tape;
                r2["Sharpener"] = c.Sharpener;
                r2["Shorthand"] = c.Shorthand;
                r2["Stapler"]   = c.Stapler;
                r2["Tacks"]     = c.Tacks;
                r2["Tparency"]  = c.Tparency;
                r2["Tray"]      = c.Tray;
                t.Rows.Add(r2);
            }
            ReportDataSource rds = new ReportDataSource("DataSet1", t);

            ReportViewer2.LocalReport.DataSources.Clear();
            ReportViewer2.LocalReport.DataSources.Add(rds);
            ReportViewer2.LocalReport.Refresh();
            pnlContents.Visible = true;
        }