Ejemplo n.º 1
0
        /// <summary>
        /// 获取工厂行为报表
        /// </summary>
        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;
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 获取工厂登陆报表
 /// </summary>
 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;
 }