Beispiel #1
0
        public static List <ClientsBaseEntity> GetClientsAgentActionReport(int type, string begintime, string endtime, string clientId)
        {
            List <ClientsBaseEntity> list = new List <ClientsBaseEntity>();
            DataSet ds = ClientDAL.BaseProvider.GetClientsAgentActionReport(type, begintime, endtime, clientId);

            if (ds.Tables.Count > 0)
            {
                foreach (DataColumn dc in ds.Tables[0].Columns)
                {
                    if (dc.ColumnName != "ReportDate")
                    {
                        List <ClientsItem> item = new List <ClientsItem>();

                        foreach (DataRow dr in ds.Tables[0].Rows)
                        {
                            ClientsItem model = new ClientsItem();
                            model.Name  = dr["ReportDate"].ToString();
                            model.Value = int.Parse(dr[dc.ColumnName].ToString());
                            item.Add(model);
                        }
                        ClientsBaseEntity clientloginEntity = new ClientsBaseEntity
                        {
                            Name  = GetCloumnName(dc.ColumnName),
                            Items = item
                        };
                        list.Add(clientloginEntity);
                    }
                }
            }
            return(list);
        }
Beispiel #2
0
        public static List <ClientsBaseEntity> GetClientsLoginReport(int type, string begintime, string endtime)
        {
            List <ClientsBaseEntity> list = new List <ClientsBaseEntity>();
            DataSet ds = ClientDAL.BaseProvider.GetClientsLoginReport(type, begintime, endtime);
            int     k  = 0;

            foreach (DataTable dt in ds.Tables)
            {
                List <ClientsItem> item = new List <ClientsItem>();
                foreach (DataRow dr in dt.Rows)
                {
                    ClientsItem model = new ClientsItem();
                    model.Name  = dr["ReportDate"].ToString();
                    model.Value = int.Parse(dr["Num"].ToString());
                    item.Add(model);
                }
                if (item.Any())
                {
                    ClientsBaseEntity clientloginEntity = new ClientsBaseEntity
                    {
                        Name  = (k == 0 ? "登录次数" : (k == 1 ? "登陆人数" : "登陆工厂数")),
                        Items = item
                    };
                    list.Add(clientloginEntity);
                }
                k++;
            }
            return(list);
        }