public static IEnumerable <ConfigHistory> SelectOprLogByObjectTypeAndAftervalue(string objectType, string afterValue) { IEnumerable <ConfigHistory> result = null; switch (objectType) { case "TireTJ": case "T-ListAct": result = DALLogger.SelectOprLogByObjectTypeAndAftervalue(objectType, afterValue); break; default: using (var client = new OprLogClient()) { var oprlist = client.SelectOrderOprLog(0, objectType); if (oprlist != null && oprlist.Result.Count() > 0) { var tempList = oprlist.Result.Where(t => t.AfterValue.Equals(afterValue) || t.AfterValue.Equals(afterValue + ",")).ToList(); //AutoMapper初始化配置文件 var config = new MapperConfiguration(cfg => cfg.CreateMap <OprLogModel, ConfigHistory>()); var mapper = config.CreateMapper(); //集合类型转换 result = mapper.Map <IEnumerable <ConfigHistory> >(tempList); } } break; } return(result); }
public static IEnumerable <ConfigHistory> SelectOprLogByParams(string objectType, string objectId) { OperationResult <IEnumerable <OprLogModel> > oprlist = null; using (var client = new OprLogClient()) { oprlist = client.SelectOrderOprLog(int.Parse(objectId), objectType); } //AutoMapper初始化配置文件 var config = new MapperConfiguration(cfg => cfg.CreateMap <OprLogModel, ConfigHistory>()); var mapper = config.CreateMapper(); //集合类型转换 return(mapper.Map <IEnumerable <ConfigHistory> >(oprlist.Result)); }
/// <summary> /// 活动表的操作历史记录的查看 /// </summary> /// <param name="activeID"></param> /// <returns></returns> public static IEnumerable <OprLogModel> HistoryActions(int activeID, string type) { //return DALWebActivityDetail.HistoryActions(activeID, type).Rows.Cast<DataRow>().Select(row => new ConfigHistory(row)); using (var client = new OprLogClient()) { var result = client.SelectOrderOprLog(activeID, type); if (result.Success) { return(result.Result); } else { return(new List <OprLogModel>()); } } }
public List <ConfigHistory> GetOprLog(int pkid, DateTime startTime, DateTime endTime) { OperationResult <IEnumerable <OprLogModel> > oprlist = null; using (var client = new OprLogClient()) { oprlist = client.SelectOrderOprLog(pkid, "CVPage"); } var tempList = oprlist.Result.Where(t => t.ChangeDatetime >= startTime && t.ChangeDatetime <= endTime).ToList(); //AutoMapper初始化配置文件 var config = new MapperConfiguration(cfg => cfg.CreateMap <OprLogModel, ConfigHistory>()); var mapper = config.CreateMapper(); //集合类型转换 return(mapper.Map <IEnumerable <ConfigHistory> >(tempList).ToList()); }
public ActionResult SelectOprLog(string type)//轮胎到店 1 轮胎非到店2 保养到店3 保养非到店4 轮毂到店 5 轮毂非到店6 { var content = ""; OperationResult <IEnumerable <OprLogModel> > oprlist = null; using (var client = new OprLogClient()) { oprlist = client.SelectOrderOprLog(int.Parse(type), "SetYunFei"); } if (oprlist.Result == null || oprlist.Result.Count() == 0) { content = "暂无记录"; } else { foreach (OprLogModel model in oprlist.Result) { content += "<span style='display:block;margin-bottom:5px;'>操作人:" + model.Author + " 操作:" + model.Operation + " 操作时间:" + model.ChangeDatetime + "</span>"; } } return(Content(content)); }