Example #1
0
        public DataSet GetSummaryRpt(string yrmo, string plancode)
        {
            IPBA_DAL dobj = new IPBA_DAL();
            string   tierexp;
            int      count = 0;

            string[] typecds  = { "STD", "CHG", "RETRO", "MANCHG", "MANRETRO" };
            string[] programs = { "Active", "Active Pilot", "COBRA", "COBRA Pilot", "Retiree", "Retiree Pilot" };
            string[] tiercds  = { "E", "C", "S", "F" };
            DataSet  dsTemp   = new DataSet(); dsTemp.Clear();
            DataSet  dsTemp1  = new DataSet(); dsTemp1.Clear();
            DataSet  dsSum    = new DataSet(); dsSum.Clear();

            System.Type typeDecimal = System.Type.GetType("System.Decimal");
            System.Type typeInt     = System.Type.GetType("System.Int32");
            DataTable   tblSum      = dsSum.Tables.Add("Summary");
            DataRow     row;
            DataColumn  col;

            col = new DataColumn("PlanYr"); tblSum.Columns.Add(col);
            col = new DataColumn("Classification"); tblSum.Columns.Add(col);
            col = new DataColumn("Coverage Tier"); tblSum.Columns.Add(col);
            col = new DataColumn("Emps", typeInt); tblSum.Columns.Add(col);
            col = new DataColumn("Rate", typeDecimal); tblSum.Columns.Add(col);
            col = new DataColumn("Total", typeDecimal); tblSum.Columns.Add(col);

            dsTemp  = dobj.GetDetData(yrmo, plancode);
            dsTemp1 = dobj.GetAdjData(yrmo, plancode); dsTemp.Merge(dsTemp1); dsTemp1.Clear();
            dsTemp1 = GetCobraAdjustments(yrmo, plancode); dsTemp.Merge(dsTemp1); dsTemp1.Clear();
            dsTemp1 = GetManualAdjustments(yrmo, plancode); dsTemp.Merge(dsTemp1); dsTemp1.Clear();

            foreach (string typecd in typecds)
            {
                foreach (string program in programs)
                {
                    foreach (string tiercd in tiercds)
                    {
                        tierexp = GetTierExp(tiercd, program);
                        count   = GetEmpCount(typecd, program, tiercd, dsTemp);
                        if (count != 0)
                        {
                            row                   = tblSum.NewRow();
                            row["PlanYr"]         = yrmo.Substring(0, 4);
                            row["Classification"] = GetClassification(typecd, program);
                            row["Coverage Tier"]  = tierexp;
                            row["Emps"]           = count;
                            row["Rate"]           = dobj.GetRate(yrmo, program, plancode, tiercd);
                            if (typecd.Equals("CHG") || typecd.Equals("MANCHG"))
                            {
                                row["Total"] = count * dobj.GetRate(yrmo, program, plancode, tiercd);
                            }
                            else
                            {
                                row["Total"] = GetTotalAmt(typecd, program, tiercd, dsTemp);
                            }
                            tblSum.Rows.Add(row);
                        }
                        if (typecd.Equals("CHG") || typecd.Equals("MANCHG"))
                        {
                            tierexp = GetTierExp(tiercd, program);
                            count   = GetEmpCountPriorCHG(typecd, program, tiercd, dsTemp);
                            if (count != 0)
                            {
                                row                   = tblSum.NewRow();
                                row["PlanYr"]         = yrmo.Substring(0, 4);
                                row["Classification"] = GetClassification(typecd, program);
                                row["Coverage Tier"]  = tierexp;
                                row["Emps"]           = (-1) * count;
                                row["Rate"]           = dobj.GetRate(yrmo, program, plancode, tiercd);
                                row["Total"]          = (-1) * count * dobj.GetRate(yrmo, program, plancode, tiercd);
                                tblSum.Rows.Add(row);
                            }
                        }
                    }
                    count = GetEmpCount(typecd, program, dsTemp);
                    if (count != 0)
                    {
                        row = tblSum.NewRow();
                        row["Classification"] = "***";
                        row["Coverage Tier"]  = "SUB TOTAL:";
                        row["Emps"]           = GetSumEmpCount(GetClassification(typecd, program), dsSum);
                        row["Total"]          = GetTotalAmt(typecd, program, dsTemp);
                        tblSum.Rows.Add(row);
                    }
                }
            }
            if (tblSum.Rows.Count > 0)
            {
                row = tblSum.NewRow();
                row["Classification"] = "*****";
                row["Coverage Tier"]  = "GRAND TOTAL:";
                row["Emps"]           = GetSumEmpCount(dsSum);
                row["Total"]          = GetTotalAmt(dsTemp);
                tblSum.Rows.Add(row);
            }

            return(dsSum);
        }
Example #2
0
        public DataSet GetAdjustmentRpt(string yrmo, string plancode)
        {
            IPBA_DAL dobj  = new IPBA_DAL();
            int      count = 0;

            string[]  typecds  = { "CHG", "RETRO" };
            string[]  programs = { "Active", "Active Pilot", "COBRA", "COBRA Pilot", "Retiree", "Retiree Pilot" };
            DataSet   dsTemp   = new DataSet(); dsTemp.Clear();
            DataSet   dsAdj    = new DataSet(); dsAdj.Clear();
            DataTable tblAdj   = dsAdj.Tables.Add("Adjustments");

            System.Type typeDecimal = System.Type.GetType("System.Decimal");
            DataRow[]   rows;
            DataRow     row;
            DataColumn  col;

            col = new DataColumn("Py"); tblAdj.Columns.Add(col);
            col = new DataColumn("Class"); tblAdj.Columns.Add(col);
            col = new DataColumn("Type"); tblAdj.Columns.Add(col);
            col = new DataColumn("SSN"); tblAdj.Columns.Add(col);
            col = new DataColumn("Name"); tblAdj.Columns.Add(col);
            col = new DataColumn("YRMO"); tblAdj.Columns.Add(col);
            col = new DataColumn("Comments"); tblAdj.Columns.Add(col);
            col = new DataColumn("Months"); tblAdj.Columns.Add(col);
            col = new DataColumn("Amount", typeDecimal); tblAdj.Columns.Add(col);
            col = new DataColumn("Flag"); tblAdj.Columns.Add(col);

            dsTemp = dobj.GetAdjData(yrmo, plancode);
            dsTemp.Merge(GetCobraAdjustments(yrmo, plancode));
            dsTemp.Merge(GetManualAdjustments(yrmo, plancode));

            foreach (string program in programs)
            {
                foreach (string typecd in typecds)
                {
                    rows = GetAdjRows(typecd, program, dsTemp);
                    foreach (DataRow row1 in rows)
                    {
                        row             = tblAdj.NewRow();
                        row["Py"]       = row1["Py"];
                        row["Class"]    = program;
                        row["Type"]     = row1["Type"];
                        row["SSN"]      = row1["SSN"];
                        row["Name"]     = row1["Name"];
                        row["YRMO"]     = row1["YRMO"];
                        row["Comments"] = row1["Comments"];
                        row["Months"]   = row1["Months"];
                        row["Amount"]   = row1["Rate"];
                        row["Flag"]     = row1["flag"];
                        tblAdj.Rows.Add(row);
                    }
                    count = GetAdjEmpCount(typecd, program, dsTemp);
                    if (count != 0)
                    {
                        row             = tblAdj.NewRow();
                        row["Comments"] = "***";
                        row["Amount"]   = GetAdjTotalAmt(typecd, program, dsTemp);
                        tblAdj.Rows.Add(row);
                    }
                }
                count = GetEmpCount(program, dsTemp);
                if (count != 0)
                {
                    row           = tblAdj.NewRow();
                    row["Class"]  = "*** SUB TOTAL:";
                    row["Amount"] = GetTotalAmt(program, dsTemp);
                    tblAdj.Rows.Add(row);
                }
            }
            if (tblAdj.Rows.Count > 0)
            {
                row           = tblAdj.NewRow();
                row["Class"]  = "*** GRAND TOTAL:";
                row["Amount"] = GetTotalAmt(dsTemp);
                tblAdj.Rows.Add(row);
            }

            return(dsAdj);
        }