public ActionResult Index(List<SelectedItem> selItems, booking bookingDetails, FormCollection frm) { string tset = Convert.ToString(frm["testValue"]); BookingViewModel bookingViewModel = new BookingViewModel(); bookingViewModel.bookingServices = new booking(); bookingViewModel.serviceBillDeskDetails = db.ServiceBillDesks.ToList(); bookingViewModel.SelectedItem = selItems; return View(bookingViewModel); }
public ActionResult Index(int SBId = 0) { NailModel db = new NailModel(); List<SelectedItem> selectedItemList = new List<SelectedItem>(); //Total No of serviceItems selected for (int i = 0; i < 15; i++) { selectedItemList.Add(new SelectedItem()); } if (SBId > 0) { ServiceBillDesk serviceBillDeskItem = db.ServiceBillDesks.Find(SBId); if (serviceBillDeskItem != null) { // SelectedItem item = new SelectedItem(); selectedItemList[0].ServiceName = serviceBillDeskItem.ServiceMaster.ServiceType; selectedItemList[0].serviceVeriation = serviceBillDeskItem.ServiceVeriation.ServiceVariation; selectedItemList[0].timeDuration = serviceBillDeskItem.ServiceDuration; selectedItemList[0].price = serviceBillDeskItem.ServicePrice; selectedItemList[0].NoOfPerson = serviceBillDeskItem.ServiceQuantity; selectedItemList[0].ServiceBillDeskId = serviceBillDeskItem.ID; //selectedItemList.Add(item); //ViewBag.ServiceItem = serviceBillDeskItem; ViewBag.IsItems = true; } } BookingViewModel bookingViewModel = new BookingViewModel(); bookingViewModel.bookingServices = new booking(); bookingViewModel.serviceBillDeskDetails = db.ServiceBillDesks.ToList(); bookingViewModel.SelectedItem = selectedItemList; // db.ServiceBillDesks.Where(x => x.ServiceMaster.ParentServiceId>0).GroupBy(s => s.ServiceID).ToList(); return View(bookingViewModel); }