public JsonResult GetAllPackages() { List <PackageVO> result = new List <PackageVO>(); try { PackageMgm pkgMgm = new PackageMgm(); //BizMocker mocker = new BizMocker(); result = pkgMgm.GetAllPackages(); foreach (var item in result) { item.DT_RowId = item.PackageID.ToString(); item.Operation = "<a href='javascript:void(0)' onclick='Package.Edit(" + item.DT_RowId + ")'><i class='fa fa-pencil'></i> 编辑</a> | <a href='javascript:void(0)' onclick='Package.Del(" + item.DT_RowId + ")'><i class='fa fa-times'></i> 删除</a>"; item.TotalPriceDesc = item.TotalPrice.ToString() + " 元"; item.DetailOpt = "<a href='javascript:void(0)' onclick=\"Package.Detail(" + item.DT_RowId + ", '" + PageValidateHelper.FilterParams(item.PackageName) + "')\"><i class='fa fa-search'></i> 查看</a>"; } } catch (Exception ex) { LogHandler.Error(ex.Message.ToString()); } return(Json(result, JsonRequestBehavior.AllowGet)); }
private List <SelectListItem> GetPackage(List <SelectListItem> ddllist, params object[] where) { PackageMgm pkgMgm = new PackageMgm(); List <PackageVO> list = pkgMgm.GetAllPackages(); if (list.Count > 0) { list.ForEach(ct => { ddllist.Add(new SelectListItem() { Text = ct.PackageName, Value = ct.PackageID.ToString() }); }); } else { if (ddllist.Count <= 0) { ddllist.Add(new SelectListItem() { Text = "--无可用套餐选择--", Value = "-1" }); } } return(ddllist); }