Exemplo n.º 1
0
        public JsonResult GetPkgItems()
        {
            ReturnedData data = new ReturnedData();
            try
            {
                int pkgId = NullHelper.Convert<int>(Request["id"], -1);
                PkgItemsMgm pkgMgm = new PkgItemsMgm();
                PackageMgm pkMgm = new PackageMgm();

                var pkg = pkMgm.GetPackageByID(pkgId);
                var pkgitem = pkgMgm.GetItemsByPkgID(pkgId);
                data.Success = true;
                data.Message = pkg.TotalPrice.ToString();
                data.Data = pkgitem;
            }
            catch (Exception ex)
            {
                data.Success = false;
                data.Message = "系统错误,请联系维护人员";
                data.Error = ex.ToString();
                LogHandler.Error(ex.Message.ToString());
            }
            return Json(data, JsonRequestBehavior.AllowGet);
        }
Exemplo n.º 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);
        }