/// <summary> /// 列表 /// </summary> /// <param name="pn">分页下标</param> /// <returns></returns> public ActionResult List(DishesSpecVM vm, int pn = 1) { //查询 var data = _dishesService.GetById(vm.Id); vm.BusinessInfoId = data.BusinessInfoId; vm.DishesSpecList = data.DishesSpecList; return(View(vm)); }
/// <summary> /// 编辑 /// </summary> /// <returns></returns> public ActionResult Edit(DishesSpecVM vm) { vm.DishesSpec = _DishesSpecService.GetById(vm.Id) ?? new DishesSpec(); if (vm.Id == 0) { var data = _dishesService.GetById(vm.DishesId); vm.BusinessInfoId = data.BusinessInfoId; } else { vm.DishesId = vm.DishesSpec.DishesId; vm.BusinessInfoId = vm.DishesSpec.BusinessInfoId; } return(View(vm)); }
/// <summary> /// 编辑 /// </summary> /// <returns></returns> public ActionResult DetailList(DishesSpecVM vm) { vm.DishesSpec = _DishesSpecService.GetById(vm.Id) ?? new DishesSpec(); //if (vm.Id == 0) //{ // var data = _dishesService.GetById(vm.DishesId); // vm.BusinessInfoId = data.BusinessInfoId; //} //else //{ // vm.DishesId = vm.DishesSpec.DishesId; // vm.BusinessInfoId = vm.DishesSpec.BusinessInfoId; //} return(View(vm)); }
/// <summary> /// 编辑 /// </summary> /// <returns></returns> public ActionResult EditDetail(DishesSpecVM vm) { vm.DishesSpecDetail = _DishesSpecDetailService.GetById(vm.Id) ?? new DishesSpecDetail(); if (vm.Id > 0) { vm.DishesSpecId = vm.DishesSpecDetail.DishesSpecId; } //if (vm.Id == 0) //{ // var data = _DishesSpecDetailService.GetById(vm.DishesSpecId); // vm.BusinessInfoId = data.BusinessInfoId; //} //else //{ // vm.DishesId = vm.DishesSpec.DishesId; // vm.BusinessInfoId = vm.DishesSpec.BusinessInfoId; //} return(View(vm)); }