Exemplo n.º 1
0
 private void cbbLocal_Load()
 {
     cbbLocal.DataSource    = DiaDiemDL.All();
     cbbLocal.DisplayMember = "TenDD";
     cbbLocal.ValueMember   = "ID";
     cbbLocal.SelectedIndex = 0;
 }
Exemplo n.º 2
0
        private void btnNewLocal_Click(object sender, EventArgs e)
        {
            Localfrm frm = new Localfrm();

            frm.ShowDialog();
            if (frm.DialogResult == System.Windows.Forms.DialogResult.OK)
            {
                cbbLocal_Load(DiaDiemDL.All());
            }
        }
Exemplo n.º 3
0
        private void Localsfrm_Load(object sender, EventArgs e)
        {
            grbManager.Visible = false;
            if (Powers == PowersLog.Administrator || Powers == PowersLog.Designer)
            {
                grbManager.Visible = true;
            }

            cbbColumn_Load();
            lvLocals_Load(DiaDiemDL.All());
        }
Exemplo n.º 4
0
        private void itemAdd_ItemClick(object sender, DevExpress.XtraEditors.TileItemEventArgs e)
        {
            Localfrm frm = new Localfrm();

            frm.ShowDialog();
            if (frm.DialogResult == System.Windows.Forms.DialogResult.OK)
            {
                lvLocals_Load(DiaDiemDL.All());
                cbbCounty.DataSource = DiaDiemDL.AllCountries();
            }
        }
Exemplo n.º 5
0
        private void bntNewScenic_Click(object sender, EventArgs e)
        {
            Scenicfrm frm = new Scenicfrm();

            frm.ShowDialog();
            if (frm.DialogResult == System.Windows.Forms.DialogResult.OK)
            {
                int i = cbbLocal.SelectedIndex;
                cbbLocal_Load(DiaDiemDL.All());
                cbbLocal.SelectedIndex = i;
            }
        }
Exemplo n.º 6
0
 private void itemUpdate_ItemClick(object sender, DevExpress.XtraEditors.TileItemEventArgs e)
 {
     if (lvLocals.SelectedItems.Count > 0)
     {
         Localfrm frm = new Localfrm();
         frm.Code = MyConvert.ToInt32(lvLocals.SelectedItems[0].SubItems[0].Text);
         frm.ShowDialog();
         if (frm.DialogResult == System.Windows.Forms.DialogResult.OK)
         {
             lvLocals_Load(DiaDiemDL.All());
             cbbCounty.DataSource = DiaDiemDL.AllCountries();
         }
     }
 }
Exemplo n.º 7
0
 private void Tourfrm_Load(object sender, EventArgs e)
 {
     tvtours_Load(Tour.All());
     listDes    = new List <DiemDen>();
     listScenic = new List <DiemDL>();
     cbbLocal_Load(DiaDiemDL.All());
     cbbSupplier_Load(NCCPTien.All());
     cbbStatus.SelectedIndex = 0;
     if (_ID != 0)
     {
         btnUpdateTour.Enabled = true;
         Controls_LoadUp();
     }
 }
Exemplo n.º 8
0
        private void Controls_LoadUp()
        {
            Tour t = Tour.Single(_ID);

            txtCode.Text       = t.ID.ToString();
            txtName.Text       = t.TenTour;
            txtStartPlace.Text = t.XuatPhat;
            int i = 0;

            foreach (var item in cbbStatus.Items)
            {
                if (item.ToString() == t.TrangThai)
                {
                    cbbStatus.SelectedIndex = i;
                    break;
                }
                i++;
            }
            btnAddTour.Enabled    = false;
            btnUpdateTour.Enabled = true;
            //btnDeleteTour.Enabled = true;

            //
            listScenic = new List <DiemDL>();
            listDes    = DiemDen.FindByMTour(ID);
            lvDestination.Items.Clear();
            foreach (DiemDen j in listDes)
            {
                ListViewItem item = lvDestination.Items.Add(j.TenDD);
                item.SubItems.Add(j.TenDiem);
                item.SubItems.Add(j.TenKS);
                item.SubItems.Add(j.TenPT);
                item.SubItems.Add(j.TenNCC);
                listScenic.Add(DiemDL.Single(j.MDiemDL));
            }
            cbbLocal_Load(DiaDiemDL.All());
            cbbLocal.SelectedIndex = 0;
            cbbHotel.Items.Clear();
            cbbHotel.Text = "";
            tvHotel.Nodes.Clear();
        }
Exemplo n.º 9
0
 private void btnAll_Click(object sender, EventArgs e)
 {
     lvLocals_Load(DiaDiemDL.All());
 }