Ejemplo n.º 1
0
        string GetEligFileHeader(string hraPlanNum)
        {
            StringBuilder sb = new StringBuilder();

            sb.Append("PUTSY");
            sb.Append(HRA.GetFixedLengthString(hraPlanNum, 6));
            sb.Append(HRA.GetFixedLengthString("CENSUS", 9));
            sb.Append(' ', 60);

            return(sb.ToString());
        }
Ejemplo n.º 2
0
        string GetEligFileFooter(int counter, string hraPlanNum)
        {
            string strcntr = counter.ToString();

            strcntr = strcntr.PadLeft(11, '0');
            StringBuilder sb = new StringBuilder();

            sb.Append("PUTE");
            sb.Append(' ', 1);
            sb.Append(HRA.GetFixedLengthString(hraPlanNum, 6));
            sb.Append(HRA.GetFixedLengthString("CENSUS", 9));
            sb.Append(' ', 29);
            sb.Append(strcntr);
            sb.Append(' ', 20);

            return(sb.ToString());
        }
Ejemplo n.º 3
0
        public string GetEligFile()
        {
            DataSet       empds     = new DataSet();
            DataSet       dshrainfo = new DataSet();
            StringBuilder sb        = new StringBuilder();
            HRAOperDAL    dobj      = new HRAOperDAL();

            empds.Clear();
            dshrainfo.Clear();
            int    counter = 0;
            string start, end;
            string hraPlanNum = HRAOperDAL.GetHRAPlanNum();


            /**************  Header of Elig File   ************************************/

            sb.Append(GetEligFileHeader(hraPlanNum) + Environment.NewLine);


            /**************  Build Records   ******************************************/

            empds = dobj.GetEmployeeInfo();

            foreach (DataRow row in empds.Tables[0].Rows)
            {
                //start and end of each line
                start = "813" + "  " + hraPlanNum.PadLeft(6, '0') + " " + row["ssn"].ToString().Trim().PadLeft(9, '0');
                end   = "";
                end   = end.PadRight(24, ' ') + Environment.NewLine;

                //participant info
                dshrainfo = getHRaPartInfo(row);

                foreach (DataRow row1 in dshrainfo.Tables[0].Rows)
                {
                    if (row1["codeid"].ToString() != "N/A" && row1["codeid"].ToString() != "RET")
                    {
                        sb.Append(start + row1["codeid"].ToString().PadLeft(3, '0') + HRA.GetFixedLengthString(row1["value"].ToString(), 32) + end);
                        counter++;
                    }
                }
            }

            /*****************  (Footer) Trailer Record   *****************************/

            sb.Append(GetEligFileFooter(counter, hraPlanNum));


            return(sb.ToString());
        }