public virtual ActionResult GetList() { var rooms = _mRoomRepository.GetAll(); StringBuilder sb = new StringBuilder(); MRoom mRoom = new MRoom(); sb.AppendFormat("{0}:{1};", string.Empty, "-Pilih Ruangan-"); for (int i = 0; i < rooms.Count; i++) { mRoom = rooms[i]; sb.AppendFormat("{0}:{1}", mRoom.Id, mRoom.RoomName); if (i < rooms.Count - 1) { sb.Append(";"); } } return(Content(sb.ToString())); }
public static BillingFormViewModel CreateBillingViewModel(IMRoomRepository mRoomRepository, IMEmployeeRepository mEmployeeRepository, IMCustomerRepository mCustomerRepository, ITTransRoomRepository transRoomRepository) { BillingFormViewModel viewModel = new BillingFormViewModel(); viewModel.RoomsList = GetRoomViewModel(transRoomRepository, mCustomerRepository, mRoomRepository.GetAll()); //var listCustomer = mCustomerRepository.GetAll(); //MCustomer mCustomer = new MCustomer(); ////mCustomer.SupplierName = "-Pilih Supplier-"; //listCustomer.Insert(0, mCustomer); //var custs = from cust in listCustomer // select new { Id = cust.Id, Name = cust.PersonId != null ? cust.PersonId.PersonName : "-Pilih Konsumen-" }; //viewModel.CustomerList = new SelectList(custs, "Id", "Name"); //var listEmployee = mEmployeeRepository.GetAll(); //MEmployee employee = new MEmployee(); ////mCustomer.SupplierName = "-Pilih Supplier-"; //listEmployee.Insert(0, employee); //var employees = from emp in listEmployee // select new { Id = emp.Id, Name = emp.PersonId != null ? emp.PersonId.PersonName : "-Pilih Terapis-" }; //viewModel.TherapistList = new SelectList(employees, "Id", "Name"); TTrans trans = new TTrans(); trans.SetAssignedIdTo(Guid.NewGuid().ToString()); trans.TransDiscount = 0; trans.TransDate = DateTime.Today; viewModel.Trans = trans; TTransRoom transRoom = new TTransRoom(); transRoom.RoomInDate = DateTime.Now; transRoom.RoomOutDate = DateTime.Now; viewModel.TransRoom = transRoom; return(viewModel); }