Beispiel #1
0
        private ReturnedData EditePkg(int id, string pkgName, decimal pkgPrice)
        {
            ReturnedData data   = new ReturnedData();
            PackageMgm   pkgMgm = new PackageMgm();

            try
            {
                var pkg = pkgMgm.GetPackageByID(id);
                if (pkg.PackageID > 0)
                {
                    pkg.PackageName      = pkgName;
                    pkg.TotalPrice       = pkgPrice;
                    pkg.LastModifiedDate = DateTime.Now;
                    pkg.LastModifierID   = Emp.UserName;
                    pkgMgm.EditPackage(pkg);
                    data.Success = true;
                    data.Message = "套餐基本信息修改成功";
                    LogHandler.Info("用户:" + Emp.UserName + "于 " + pkg.CreatedDate.ToString() + " 修改套餐基本信息,项目名:" + pkgName);
                }
                else
                {
                    data.Success = false;
                    data.Message = "所选套餐项目不存在,请刷新网页后重试";
                }
            }
            catch (Exception ex)
            {
                data.Success = false;
                data.Message = "套餐基本信息修改失败";
                LogHandler.Error("套餐基本信息修改错误:" + ex.Message.ToString());
            }
            return(data);
        }
Beispiel #2
0
 //套餐基本信息页
 public ActionResult DetailPkg()
 {
     try
     {
         int pkgId = NullHelper.Convert <int>(Request["id"], -1);
         if (pkgId > 0)
         {
             PackageMgm pkgMgm = new PackageMgm();
             var        pkg    = pkgMgm.GetPackageByID(pkgId);
             ViewBag.pkgName  = pkg.PackageName;
             ViewBag.pkgPrice = pkg.TotalPrice;
             ViewBag.pkgId    = pkg.PackageID;
         }
         else
         {
             ViewBag.pkgName  = "";
             ViewBag.pkgPrice = "";
             ViewBag.pkgId    = -1;
         }
     }
     catch (Exception ex)
     {
         LogHandler.Error(ex.Message.ToString());
     }
     return(View());
 }
Beispiel #3
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));
        }