示例#1
0
        private void lbl_ThemQuocGia_Click(object sender, EventArgs e)
        {
            UCs.ThemQuocGia oThemQuocGia = new ThemQuocGia("QLNS_ThongTinNV");
            oThemQuocGia.Dock = DockStyle.Fill;
            Forms.Popup fPopup = new Forms.Popup("Thêm quốc gia", oThemQuocGia);
            fPopup.ShowDialog();
            if (nNewQuocGiaID > 0)
            {
                int?x = null;

                if (comB_Tinh.SelectedValue != Convert.DBNull && comB_Tinh.SelectedValue != null)
                {
                    x = Convert.ToInt16(comB_Tinh.SelectedValue);
                }

                dtQuocGia = oQuocGia.GetData();

                comB_QuocGia.DataSource    = dtQuocGia;
                comB_QuocGia.DisplayMember = "ten_quoc_gia";
                comB_QuocGia.ValueMember   = "id";

                if (x != null)
                {
                    comB_QuocGia.SelectedValue = x;
                }
                nNewQuocGiaID = 0;
            }
        }
示例#2
0
        private void lbl_ThemQuocGia_Click(object sender, EventArgs e)
        {
            UCs.ThemQuocGia oThemQuocGia = new ThemQuocGia("QLNS_ThongTinNV_Phu");
            oThemQuocGia.Dock = DockStyle.Fill;
            Forms.Popup fPopup = new Forms.Popup("Thêm quốc gia", oThemQuocGia);
            fPopup.ShowDialog();
            if (nNewQuocGiaID > 0)
            {
                Label    lbl = ((Label)sender);
                ComboBox com = null;
                switch (lbl.Name)
                {
                case "lbl_ThemQueQuan_QuocGia":
                    com = comB_QueQuan_QuocGia;
                    break;

                case "lbl_ThemNoiSinh_QuocGia":
                    com = comB_NoiSinh_QuocGia;
                    break;

                case "lbl_ThemQuocGia_HoKhau":
                    com = comB_HoKhau_QuocGia;
                    break;

                case "lb_ThemQuocTich_QuocGia":
                    com = comB_QuocTich;
                    break;


                default:
                    break;
                }
                int?x = null;

                if (com.SelectedValue != Convert.DBNull && com.SelectedValue != null)
                {
                    x = Convert.ToInt16(com.SelectedValue);
                }

                dtQuocGia = oQuocGia.GetData();

                FillQuocGiaComb();

                if (x != null)
                {
                    com.SelectedValue = x;
                }
                nNewQuocGiaID = 0;
            }
        }
示例#3
0
        private void lbl_ThemQuocGia_Click(object sender, EventArgs e)
        {
            UCs.ThemQuocGia oThemQuocGia = new ThemQuocGia("QLNS_DaoTaoBoiDuong");
            oThemQuocGia.Dock = DockStyle.Fill;
            Forms.Popup fPopup = new Forms.Popup("Thêm quốc gia", oThemQuocGia);
            fPopup.ShowDialog();
            if (nNewQuocGiaID > 0)
            {
                Label lbl = ((Label)sender);
                ComboBox com = null;
                switch (lbl.Name)
                {
                    case "lbl_ThemQuocGia_DaoTao":
                        com = comB_QuocGia_DaoTao;
                        break;

                    case "lbl_ThemQuocGia_BoiDuong":
                        com = comB_QuocGia_BoiDuong;
                        break;

                    default:
                        break;
                }
                int? x = null;

                if (com.SelectedValue != Convert.DBNull && com.SelectedValue != null)
                    x = Convert.ToInt16(com.SelectedValue);

                dtQuocGia = oQuocGia.GetData();

                com.DataSource = dtQuocGia;
                com.DisplayMember = "ten_quoc_gia";
                com.ValueMember = "id";

                if (x != null)
                {
                    com.SelectedValue = x;
                }
                nNewQuocGiaID = 0;
            }
        }
示例#4
0
        private void lbl_ThemQuocGia_Click(object sender, EventArgs e)
        {
            UCs.ThemQuocGia oThemQuocGia = new ThemQuocGia("QLNS_ThongTinNV_Phu");
            oThemQuocGia.Dock = DockStyle.Fill;
            Forms.Popup fPopup = new Forms.Popup("Thêm quốc gia", oThemQuocGia);
            fPopup.ShowDialog();
            if (nNewQuocGiaID > 0)
            {
                Label lbl = ((Label)sender);
                ComboBox com = null;
                switch (lbl.Name)
                {
                    case "lbl_ThemQueQuan_QuocGia":
                        com = comB_QueQuan_QuocGia;
                        break;

                    case "lbl_ThemNoiSinh_QuocGia":
                        com = comB_NoiSinh_QuocGia;
                        break;

                    case "lbl_ThemQuocGia_HoKhau":
                        com = comB_HoKhau_QuocGia;
                        break;

                    case "lb_ThemQuocTich_QuocGia":
                        com = comB_QuocTich;
                        break;
                        

                    default:
                        break;
                }
                int? x = null;

                if (com.SelectedValue != Convert.DBNull && com.SelectedValue != null)
                    x = Convert.ToInt16(com.SelectedValue);

                dtQuocGia = oQuocGia.GetData();

                FillQuocGiaComb();

                if (x != null)
                {
                    com.SelectedValue = x;
                }
                nNewQuocGiaID = 0;
            }
        }
示例#5
0
        private void lbl_ThemQuocGia_Click(object sender, EventArgs e)
        {
            UCs.ThemQuocGia oThemQuocGia = new ThemQuocGia("QLNS_ThongTinNV");
            oThemQuocGia.Dock = DockStyle.Fill;
            Forms.Popup fPopup = new Forms.Popup("Thêm quốc gia", oThemQuocGia);
            fPopup.ShowDialog();
            if (nNewQuocGiaID > 0)
            {
                int? x = null;

                if (comB_Tinh.SelectedValue != Convert.DBNull && comB_Tinh.SelectedValue != null)
                    x = Convert.ToInt16(comB_Tinh.SelectedValue);

                dtQuocGia = oQuocGia.GetData();

                comB_QuocGia.DataSource = dtQuocGia;
                comB_QuocGia.DisplayMember = "ten_quoc_gia";
                comB_QuocGia.ValueMember = "id";

                if (x!= null)
                {
                    comB_QuocGia.SelectedValue = x;
                }
                nNewQuocGiaID = 0;


            }
        }