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); }
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); }
public async Task <ClientsItem> UpsertAsync(ClientsItem client) { using (var conn = await GetOpenConnectionAsync()) { conn.Update <ClientsItem>(client); } return(null); }
public async Task <ClientsItem> CreateAsync(ClientsItem client) { using (var conn = await GetOpenConnectionAsync()) { client.Id = Guid.NewGuid(); conn.Insert(client); } return(client); }
public async Task <IEnumerable <ReservationItem> > CreateAsyncWithNewClient(ReservationItem reservation, ClientsItem client) { using (var conn = await GetOpenConnectionAsync()) { return(await conn.QueryAsync <ReservationItem>( param : new { Id = reservation.Id, FullName = client.FullName, CarId = reservation.CarId, RentalStartDate = reservation.RentalStartDate, RentalEndDate = reservation.RentalEndDate, PickUpLocation = reservation.PickUpLocation, DropOffLocation = reservation.DropOffLocation, TotalPrice = reservation.TotalPrice }, sql : SpCreateWithNewClient, commandType : CommandType.StoredProcedure)); } }