/// <summary> /// Initializes a new instance of the <see cref="TourMainViewModel"/> class. /// constructor for tour viewmodel /// </summary> /// <param name="tourRepo"> tourrepository</param> /// <param name="placeRepo">place repository</param> /// <param name="pltconRepo">pltcon repository</param> /// <param name="programRepo">propgram repository</param> /// <param name="prtconRepo">prtcon repository</param> /// <param name="tourguideRepo">tourguide repository</param> public TourMainViewModel( IRepository <Tour> tourRepo, IRepository <Place> placeRepo, IRepository <PLTCON> pltconRepo, IRepository <Program> programRepo, IRepository <PRTCON> prtconRepo, IRepository <Tourguide> tourguideRepo) { this.CreateCountryList(); this.tourBL = new TourBL(tourRepo, programRepo, placeRepo, pltconRepo, prtconRepo); this.tourguideBL = new TourguideBL(tourguideRepo); this.searchCategories = new List <string>(); foreach (TourTerms item in Enum.GetValues(typeof(TourTerms))) { this.searchCategories.Add(item.ToString()); } this.PlaceListAll = new ObservableCollection <Place>(); this.programListAll = new ObservableCollection <Program>(); this.TourGuideList = new ObservableCollection <Tourguide>(); this.TourPlaceList = new ObservableCollection <Place>(); this.TourProgramList = new ObservableCollection <Program>(); this.GetAllPlaces(); this.GetAllPrograms(); this.GetAllTourGuides(); }
private void FormListTourMini_Load(object sender, EventArgs e) { TourBL tourBL = new TourBL(); var get_tour = tourBL.GetAllTour(); dataGridView1.DataSource = get_tour; }
public ActionResult EditConcert(int id) { TourBL tourBL = new TourBL(); List <Tour> postList = tourBL.GetTour(); Tour tour = postList.Where(u => u.TourId == id).Single(); return(View(tour)); }
private void FormTourManager_Load(object sender, EventArgs e) { TourBL tourBL = new TourBL(); var a = tourBL.GetAllTours(); dataGridView1.DataSource = a; comboBox1.Text = "Active"; }
public ActionResult Tour() { TourBL tourBL = new TourBL(); TourVM tour = new TourVM(); tour.tourList = tourBL.GetTour(); return(View(tour)); }
public TourBLTest() { this.CreateTestdataArrays(); this.tourRepository = new FakeRepository <Tour>(tours); this.programRepository = new FakeRepository <Program>(programs); this.placeRepository = new FakeRepository <Place>(places); this.pltconRepository = new FakeRepository <PLTCON>(pltcons); this.prtconRepository = new FakeRepository <PRTCON>(prtcons); this.bl = new TourBL(tourRepository, programRepository, placeRepository, pltconRepository, prtconRepository); }
public ActionResult EditConcert(Tour t) { TourBL tourBL = new TourBL(); if (ModelState.IsValid) { tourBL.EditConcert(t); return(RedirectToAction("Tour", "Home")); } return(View()); }
public ActionResult DeleteConcert(int id) { TourBL tourBL = new TourBL(); List <Tour> postList = tourBL.GetTour(); Tour tour = postList.Where(u => u.TourId == id).Single(); tourBL.DeleteConcert(tour); TourVM t = new TourVM(); t.tourList = tourBL.GetTour(); return(RedirectToAction("Tour", "Home", t)); }
private void FormEditOrder_Load(object sender, EventArgs e) { TourBL tourBL = new TourBL(); OrderTourBL orderTourBL = new OrderTourBL(); var get_ordertour = orderTourBL.GetAllOrderActive(); dataGridView1.DataSource = get_ordertour; comboBox2.DataSource = tourBL.GetAllTour(); comboBox2.DisplayMember = "IDTour"; textBox1.Enabled = false; textBox2.Enabled = false; textBox3.Enabled = false; textBox4.Enabled = false; textBox5.Enabled = false; //comboBox1.DataSource = get_ordertour; //comboBox1.DisplayMember = "OrderID"; }
private void button1_Click(object sender, EventArgs e) { TourBL tourBL = new TourBL(); Tour tour = new Tour(); try { DateTime ngaydi = Convert.ToDateTime(dateTimePicker1.Value.ToString("MM/dd/yyyy")); int songay = Convert.ToInt32(textBox5.Text); int khuyenmai = Convert.ToInt32(textBox6.Text); int gia = Convert.ToInt32(textBox7.Text); if (textBox1.Text == null) { MessageBox.Show("Mã Tour Không Được Bỏ Trống"); } else if (ngaydi <= DateTime.Now) { MessageBox.Show("Ngày Bạn Chọn Không Hợp Lệ"); } else { if (tourBL.InsertTour(textBox1.Text, textBox2.Text, textBox3.Text, textBox4.Text, songay, ngaydi, khuyenmai, gia, comboBox1.Text) == true) { var a = tourBL.GetAllTours(); dataGridView1.DataSource = a; MessageBox.Show("Tour Đã Được Thêm!"); reload(); } else { MessageBox.Show("Thêm Thất Bại!"); } } } catch (System.Exception) { MessageBox.Show("Bạn Chưa Nhập Đầy Đủ"); } }
/// <summary> /// Initializes a new instance of the <see cref="OrderMainViewModel"/> class. /// Constructor for order iew model /// </summary> /// <param name="orderRepository">in param</param> /// <param name="customerRepository">customer</param> /// <param name="tourRepository">tour</param> /// <param name="programRepository">program</param> /// <param name="placeRepository">place</param> /// <param name="pltconRepository">plt</param> /// <param name="prtconRepository">prt</param> public OrderMainViewModel( IRepository <Order> orderRepository, IRepository <Customer> customerRepository, IRepository <Tour> tourRepository, IRepository <Program> programRepository, IRepository <Place> placeRepository, IRepository <PLTCON> pltconRepository, IRepository <PRTCON> prtconRepository) { this.orderBL = new OrderBL(orderRepository, customerRepository, tourRepository); this.tourBL = new TourBL(tourRepository, programRepository, placeRepository, pltconRepository, prtconRepository); this.customerBL = new CustomerBL(customerRepository); this.searchCategories = new List <string>(); foreach (OrderTerms item in Enum.GetValues(typeof(OrderTerms))) { this.searchCategories.Add(item.ToString()); } this.GetAllCustomers(); this.GetAllTours(); }