/// <summary> /// APP_VersionInfo加载数据 /// </summary> /// <param name="id"></param> /// <returns></returns> public ActionResult Create(int?id) { APP_VersionInfoModel model = null; ViewBag.IsTrueModel = SelectCommon.GetIsTrueModel(); ViewBag.GetAppModel = SelectCommon.GetAppModel(); if (id.HasValue) { SearchAPP_VersionInfoModel spmodel = new SearchAPP_VersionInfoModel(); spmodel.ID = id.Value; spmodel.PagedIndex = 0; spmodel.PagedSize = 100; var result = this._aPP_VersionInfoService.GetAPP_VersionInfoList(spmodel).Data as List <APP_VersionInfoModel>; if (result != null && result.Count > 0) { model = result[0]; } } else { model = new APP_VersionInfoModel(); } return(PartialView(model)); }
/// <summary> /// 列表APP_VersionInfo /// </summary> /// <param name="model"></param> /// <returns></returns> public JsonResult List(SearchAPP_VersionInfoModel model) { model.PagedIndex = model.PagedIndex == 0 ? 0 : model.PagedIndex; model.PagedSize = model.PagedSize == 0 ? 10 : model.PagedSize; var result = this._aPP_VersionInfoService.GetAPP_VersionInfoList(model); List <APP_VersionInfoModel> ds = result.Data; var data = new { rows = ds, total = ds.Count, }; return(Json(data, JsonRequestBehavior.AllowGet)); }
/// <summary> /// 获取APP版本信息表 /// </summary> /// <param name="model">model</param> /// <returns></returns> public ResultModel GetAPP_VersionInfoList(SearchAPP_VersionInfoModel model) { var tb = _database.Db.APP_VersionInfo; var where = new SimpleExpression(1, 1, SimpleExpressionType.Equal); // if (model.ID > 0) { // where = new SimpleExpression(where, tb.ID == model.ID, SimpleExpressionType.And); } if (!string.IsNullOrEmpty(model.APPName)) { // where = new SimpleExpression(where, tb.APPName.Like("%" + model.APPName.Trim() + "%"), SimpleExpressionType.And); } if (model.APPTypeID > 0) { // where = new SimpleExpression(where, tb.APPTypeID == model.APPTypeID, SimpleExpressionType.And); } if (!string.IsNullOrEmpty(model.PackageName)) { // where = new SimpleExpression(where, tb.PackageName.Like("%" + model.PackageName.Trim() + "%"), SimpleExpressionType.And); } if (model.Platform > 0) { // where = new SimpleExpression(where, tb.Platform == model.Platform, SimpleExpressionType.And); } if (!string.IsNullOrEmpty(model.VersionName)) { // where = new SimpleExpression(where, tb.PackageName.Like("%" + model.VersionName.Trim() + "%"), SimpleExpressionType.And); } if (!string.IsNullOrEmpty(model.VersionNO)) { // where = new SimpleExpression(where, tb.PackageName.Like("%" + model.VersionNO.Trim() + "%"), SimpleExpressionType.And); } if (model.BeginCreateDT != null) { // 开始时间 where = new SimpleExpression(where, tb.CreateDT >= model.BeginCreateDT, SimpleExpressionType.And); } if (model.EndCreateDT != null) { // 结束时间 where = new SimpleExpression(where, tb.CreateDT < model.EndCreateDT, SimpleExpressionType.And); } //dynamic pc; var query = tb .Query() //.LeftJoin(_database.Db.YH_User, out pc) //.On(_database.Db.YH_User.UserID == tb.UserID) .Select( tb.ID, tb.APPName, tb.DownloadURL, tb.Platform, tb.PackageName, tb.VersionNO, tb.VersionName, tb.FileSize, tb.UpdateInfo, tb.UpdateInfoEN, tb.UpdateInfoTH, tb.IsForceUpdate, tb.CreateBy, tb.CreateDT, tb.UpdateBy, tb.UpdateDT ) .Where(where) .OrderByCreateDTDescending(); var result = new ResultModel { Data = new SimpleDataPagedList <APP_VersionInfoModel>(query, model.PagedIndex, model.PagedSize) }; return(result); }