public dynamic GetDatainfoList([FromUri] DataInfoModel1 model) { DataInfoMapper mapper = new DataInfoMapper(); var dict = mapper.GetDatainfoList(model, this.System_Station_ID); return(Success(dict, model.PageIndex == 1 ? mapper.selectDatainfoCount(model, this.System_Station_ID) : 0)); }
public dynamic AddDatainfo(DataInfoModel1 model) { W_DataInfo newModel = new W_DataInfo(); if (model != null) { if (model.BusType == 0) { newModel.BusType = 0; newModel.BusID = model.Course_ID; } else if (model.BusType == 1) { newModel.BusType = 1; newModel.BusID = model.CourseChapters_ID; } else if (model.BusType == 2) { newModel.BusType = 2; newModel.BusID = model.CourseUnit_ID; } newModel.Title = model.Title; newModel.Path = model.Path; newModel.DownCount = model.DownCount; newModel.DataSize = model.DataSize; newModel.DataInfoType = model.DataInfoType; newModel.Content = model.Content; newModel.AddPerson = this.AccountID; newModel.AddTime = DateTime.Now.ToString(); newModel.System_Station_ID = this.System_Station_ID; DataInfoMapper mapper = new DataInfoMapper(); var dict = mapper.AddDataInfo(newModel); if (dict) { return(Success("操作成功")); } else { return(Success("操作失败")); } } else { return(Success("操作失败")); } }
/// <summary> /// 获取全部资料列表总条数 BY SZF /// </summary> /// <param name="model"></param> /// <param name="System_Station_ID"></param> /// <returns></returns> public int selectDatainfoCount(DataInfoModel1 model, int System_Station_ID) { return(SqlMapper.QueryForObject <int>("selectDatainfoCount", new { Course_ID = model.Course_ID, System_Station_ID, pageStatus = 0 })); }
/// <summary> /// 获取全部资料列表 BY SZF /// </summary> /// <param name="model"></param> /// <param name="System_Station_ID"></param> /// <returns></returns> public IList GetDatainfoList(DataInfoModel1 model, int System_Station_ID) { return(QueryForList("selectDatainfoList", new { Course_ID = model.Course_ID, System_Station_ID, pageIndex = (model.PageIndex - 1) * model.PageSize, pageSize = model.PageSize, pageStatus = model.PageStatus })); }