using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using ABC.DanhMuc.NhomNCC;
using ABC.NhomNCC;


namespace ABC.GiaoDich
{
    
    public partial class ChonNhom_Form : DevExpress.XtraEditors.XtraForm {        
        
        public ChonNhom_Form()
        {           

            InitializeComponent();  
            this.Text = "Chọn nhóm lái";
            _ID1.Properties.DataSource = DuLieu.List_Nhom_NCC.Tables[0];
            simpleButton1.Click += new EventHandler(simpleButton1_Click);
            btn_themNCC.Click += new EventHandler(btn_themNCC_Click);
            simpleButton2.Click += new EventHandler(simpleButton2_Click);
        }
        public string tennhom;

        void simpleButton2_Click(object sender, EventArgs e)
        {
            this.Text = "All";
            this.Close();
        }
        NhomNCC_Forms _NhomNCC_Forms;
        void btn_themNCC_Click(object sender, EventArgs e)
        {
            _NhomNCC_Forms = new NhomNCC_Forms();
            //_NhomNCC_Forms.FormClosed += new FormClosedEventHandler(_NhomNCC_Forms_FormClosed);
            //_NhomNCC_Forms.ShowDialog();
        }
        NhomNCC_Class _NhomNCC_Class = new NhomNCC_Class();
        void _NhomNCC_Forms_FormClosed(object sender, FormClosedEventArgs e)
        {
            _NhomNCC_Class.get_store("sp_NhomNCC_Load");
            _ID1.Properties.DataSource = DuLieu.List_Nhom_NCC.Tables[0];
        }

        void simpleButton1_Click(object sender, EventArgs e)
        {
            try
            {
                tennhom = _ID1.Text;
                this.Text = _ID1.EditValue.ToString();

                this.Close();
            }
            catch
            {
                msgbox.dialog_OK_info("Bạn chưa chọn nhóm lái.");
            }
        }

     


     

    }
}
