private void btnTourDelete_Click(object sender, EventArgs e) { TourBLL.Delete(Int32.Parse(tbTourID.Text)); Thread threadLoadTourDataGridView = new Thread(new ThreadStart(() => LoadTourDataGridView())); threadLoadTourDataGridView.Start(); }
private void btnTourEdit_Click(object sender, EventArgs e) { if (TourMode != OperationType.Edit) { LoadTourMode(OperationType.Edit); return; } try { var tour = new Core.Models.Tour(tbTourName.Text, Int32.Parse(tbTourPrice.Text == "" ? "-1" : tbTourPrice.Text), tbTourDescription.Text, Int32.Parse(cbTourType.SelectedValue.ToString())); int id = Int32.Parse(tbTourID.Text); tour.Id = id; TourBLL.Update(tour); MessageBox.Show($"Sửa tour {id} thành công"); LoadTourMode(OperationType.View); Thread threadLoadTourDataGridView = new Thread(new ThreadStart(() => LoadTourDataGridView())); threadLoadTourDataGridView.Start(); } catch (FormatException) { MessageBox.Show("Giá tour không được chứa chữ"); } catch (Exception ex) { GUIExtensionMethod.HandleError(ex); } }
private void btnTourAdd_Click(object sender, EventArgs e) { if (TourMode != OperationType.Add) { LoadTourMode(OperationType.Add); return; } try { var tour = new Core.Models.Tour(tbTourName.Text, Int32.Parse(tbTourPrice.Text.Equals("") ? "-1" : tbTourPrice.Text), tbTourDescription.Text, Int32.Parse(cbTourType.SelectedValue.ToString())); TourBLL.Add(tour); MessageBox.Show($"Thêm tour thành công"); LoadTourMode(OperationType.View); Thread threadLoadTourDataGridView = new Thread(new ThreadStart(() => LoadTourDataGridView())); threadLoadTourDataGridView.Start(); } catch (FormatException) { MessageBox.Show("Giá tiền không được để số"); } catch (Exception ex) { GUIExtensionMethod.HandleError(ex); } }
public TinhHinhTour() { InitializeComponent(); tour = new TourBLL(); tk = new ThongKeBLL(); loadMaTour(); dgvTinhHinhTour.ReadOnly = true; }
public ThongKeDoanhThu() { InitializeComponent(); tour = new TourBLL(); doan = new DoanBLL(); tk = new ThongKeBLL(); loadMaTour(); dgvDoanhThu.ReadOnly = true; }
public ThongKeChiPhi() { InitializeComponent(); tour = new TourBLL(); doan = new DoanBLL(); tk = new ThongKeBLL(); loadMaTour(); loaddMaDoan(); dgvDsCp.ReadOnly = true; }
public ThemTour() { InitializeComponent(); tour = new TourBLL(); ddBLL = new DiaDiemBLL(); giaBLL = new GiaBLL(); LoadLoaiTour(); showAllDD(); dgvGia.ReadOnly = true; GridViewDD2.ReadOnly = true; }
public DsTour() { InitializeComponent(); tour = new TourBLL(); gia = new GiaBLL(); dd = new DiaDiemBLL(); dgvDsTour.ReadOnly = true; dgvDiaDiem.ReadOnly = true; dgvDiaDiem1.ReadOnly = true; dgvGia.ReadOnly = true; }
protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); JavaScriptSerializer js = new JavaScriptSerializer(); List <TourItem> items = null; if (string.IsNullOrEmpty(TourSettingsId)) { items = new List <TourItem>(); } else { try { TourSettings settings = (TourSettings)Parent.FindControl(TourSettingsId); items = settings.Items; foreach (var item in items) { if (item.SourceType == TourItem.SourceTypeOption.HelpFile) { setContentFromFile(item); } } } catch (Exception ex) { log.Error("Error getting tour settings", ex); items = new List <TourItem>(); } } ItemsHiddenField.Value = js.Serialize(items); try { bool wasViewed = TourBLL.CheckIfUserViewTour(UserId, TourId); if (!wasViewed) { ShowTourHiddenField.Value = "true"; } else { ShowTourHiddenField.Value = "false"; } } catch (Exception ex) { log.Error("Error checking tour visibility", ex); } }
private void LoadTours() { var tours = TourBLL.ListTours(); //Back to main thread update UI if (InvokeRequired) { BeginInvoke(new Action(() => { cbGroupTour.DataSource = tours; cbGroupTour.DisplayMember = "Name"; cbGroupTour.ValueMember = "Id"; })); } }
public ThemDoan() { InitializeComponent(); tour = new TourBLL(); doan = new DoanBLL(); LoadMaTour(); ShowMaDoan(); LoadMaNhanVien(); LoadTenNhiemVu(); LoadMaKH(); LoadTenCP(); dtGioDi.Format = DateTimePickerFormat.Custom; dtGioDi.CustomFormat = "MM/dd/yyyy HH:mm:ss"; dtGioVe.Format = DateTimePickerFormat.Custom; dtGioVe.CustomFormat = "MM/dd/yyyy HH:mm:ss"; dgvNV.ReadOnly = true; dgvKH.ReadOnly = true; dgvChiPhi.ReadOnly = true; }
// Handle Event Tour public void LoadTourDataGridView(string type = null, string value = null) { if (InvokeRequired) { BeginInvoke(new Action(() => { dgvTourList.ShowLoading(true); })); } var tourData = TourBLL.ListTours(type, value); var dataSource = tourData.Select(t => new TourDataSource( t.Id, t.CurrentPrice, t.Name, t.Description, t.TourType.Name, t.TourTypeId)).ToList(); if (InvokeRequired) { BeginInvoke(new Action(() => { dgvTourList.ShowLoading(false); dgvTourList.DataSource = dataSource; //ConfigTourDataGridView dgvTourList.Columns["TourTypeId"].Visible = false; dgvTourList.Columns["Id"].HeaderText = "Mã"; dgvTourList.Columns["Name"].HeaderText = "Tên"; dgvTourList.Columns["CurrentPrice"].HeaderText = "Giá gốc"; dgvTourList.Columns["TourTypeName"].HeaderText = "Loại"; dgvTourList.Columns["Description"].HeaderText = "Mô tả"; dgvTourList.Columns["CurrentPrice"].DefaultCellStyle.Format = "N0"; })); } }