Beispiel #1
0
        // This method will get column names which has totals and type of totals....
        public static List <ColumnTotals> Listoftotals(string tot)
        {
            List <ColumnTotals> totals = new List <ColumnTotals>();
            ColumnTotals        tt;

            // To check fot totals........
            if (tot != null)
            {
                foreach (string whole in tot.Split(','))
                {
                    tt            = new ColumnTotals();
                    tt.Totaltype  = whole.Split('@')[1];
                    tt.ColumnName = whole.Split('@')[0];

                    totals.Add(tt);
                }
            }



            return(totals);
        }
        // this method will get all the header totals required for KPI and dashboard
        public static List <ColumnTotals> GetHeaderValues(string name, string section)
        {
            IEnumerable <tbl_ReportTotal> reptotals = DbContext.tbl_ReportTotals.Where(s => s.Report_Name == name & s.Report_Type == section);

            List <ColumnTotals> totals = new List <ColumnTotals>();

            try
            {
                foreach (tbl_ReportTotal t1 in reptotals)
                {
                    foreach (string individual in t1.Report_Totals.ToString().Split(','))
                    {
                        ColumnTotals c1        = new ColumnTotals();
                        string[]     seperator = individual.Split('@', '#');
                        c1.Friendlyname = seperator[0];
                        c1.Totaltype    = seperator[1];
                        c1.ColumnName   = seperator[2];
                        totals.Add(c1);
                    }
                }
            }
            catch { }
            return(totals);
        }