Example #1
0
        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));
        }
Example #2
0
        public JsonResult GetItemsByPkgId()
        {
            List <PkgItemVO> result = new List <PkgItemVO>();

            try
            {
                int id = NullHelper.Convert <int>(Request["id"], -1);
                //var mocker = new BizMocker();
                PkgItemsMgm pkgItemMgm = new PkgItemsMgm();
                result = pkgItemMgm.GetItemsByPkgID(id);
                foreach (var item in result)
                {
                    item.DT_RowId  = item.PackageItemID.ToString();
                    item.Operation = "<a href='javascript:void(0)' onclick=\"PackageItems.Del("
                                     + item.DT_RowId + ",'" + PageValidateHelper.FilterParams(item.ItemName) + "')\"><i class='fa fa-times'></i> 删除</a>";
                }
            }
            catch (Exception ex)
            {
                LogHandler.Error(ex.Message.ToString());
            }

            return(Json(result, JsonRequestBehavior.AllowGet));
        }