Beispiel #1
0
        private void RebuildAllowanceChart(string FiscalYear)
        {
            var detailedAllowance = FundAllowance.GetDetailedAllowanceForFiscalYear(FiscalYear);

            if (!detailedAllowance.Any())
            {
                lblChartMsg.Text = "There is no allowed amount for selected fiscal year.";
            }
            else
            {
                lblChartMsg.Text = "Allowance amount for selected fiscal year:";
            }

            /*
             * FSAllowanceUI objUI = new FSAllowanceUI();
             * objUI.DBTable = ds.Tables[0];
             * objUI.ChartTable = tblChart;
             * objUI.ReadOnly = !(Page.User.IsInRole(((int)UserRoles.urFSBDAdminAllowanceWR).ToString()));
             * objUI.DrawTableNCR(false);
             * tblChart = objUI.ChartTable;
             */

            //get History:

            var ds = FundAllowance.GetAllowanceHistory(FiscalYear, HistoryActions.haAddNewAllowanceAmount,
                                                       HistoryActions.haUpdateAllowance);

            if (ds != null && ds.Tables[0].Rows.Count > 0)
            {
                lblMessage.Text = String.Format("Last updated by {0} on {1}.",
                                                ds.Tables[0].Rows[0]["UpdateUserName"].ToString(),
                                                String.Format("{0:MMMM dd, yyyy}", ds.Tables[0].Rows[0]["ActionDate"]));
            }
        }
        private void BuildAllowanceReportTable()
        {
            //check if user's role allows to get this report:
            if (!(User.IsInRole(((int)UserRoles.urFSBDAdminAllowanceWR).ToString()) || User.IsInRole(((int)UserRoles.urFSBDAdminAllowanceRO).ToString()) ||
                  User.IsInRole(((int)UserRoles.urFSBDPowerReader).ToString())))
            {
                throw new Exception("You are not authorized to review this data.");
            }

            var FY = Request.QueryString["FY"];
            var dt = FundAllowance.GetDetailedAllowanceForFiscalYear(FY).ToDataSet().Tables[0];

            /*
             * FSAllowanceUI objUI = new FSAllowanceUI();
             * objUI.DBTable = dt;
             * objUI.ChartTable = Sheet;
             * objUI.DrawTableNCR(true);
             * Sheet = objUI.ChartTable;
             */

            var           tr = new HtmlTableRow();
            HtmlTableCell td;

            if (dt.Rows.Count == 0)
            {
                td = CreateCell("There is no allowed amount for fiscal year " + FY, "title2", CELL_ALIGN_LEFT);
            }
            else
            {
                td = CreateCell("Allowance amount for fiscal year " + FY, "title2", CELL_ALIGN_LEFT);
            }
            td.ColSpan = 15;
            tr.Cells.Add(td);
            Sheet.Rows.Insert(0, tr);
            tr         = new HtmlTableRow();
            td         = CreateCell("", "", CELL_ALIGN_LEFT);
            td.ColSpan = 15;
            tr.Cells.Add(td);
            Sheet.Rows.Insert(1, tr);
            p_iHeaderLines = 3;
        }