Exemplo n.º 1
0
        private void tabControl1_MouseDown(object sender, MouseEventArgs e)
        {
            for (int i = 0; i < tabControl1.TabPages.Count; i++)
            {
                Rectangle r = tabControl1.GetTabRect(i);

                Rectangle close = new Rectangle(r.Right - 16, r.Top + 1, 14, 15);

                if (close.Contains(e.Location))
                {
                    if ((int)tabControl1.TabPages[i].Tag != 0)
                    {
                        int     idtab = (int)tabControl1.TabPages[i].Tag;
                        infoTab tabf  = clstab.current(idtab);
                        if (tabf != null && tabf.action != ActionForm.KHONG)
                        {
                            if (MessageBox.Show("Có dữ liệu chưa được lưu. Bạn có chắc muốn đóng?", "Thông Báo", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                            {
                                clstab.removeTab(idtab);
                                this.tabControl1.TabPages.RemoveAt(i);
                                break;
                            }
                        }
                        else
                        {
                            clstab.removeTab(idtab);
                            this.tabControl1.TabPages.RemoveAt(i);
                            break;
                        }
                    }
                }
            }
        }
Exemplo n.º 2
0
        private void changeData(int index)
        {
            infoTab nhanvien = clstab.current(3);

            if (nhanvien != null)
            {
                nhanvien.callBackChangeData(index);
            }
        }
        public void setTab(infoTab tab)
        {
            this.tab = tab;

            this.tab.AddNew  = new infoTab.EventButton(Them);
            this.tab.Cancel  = new infoTab.EventButton(HuyBo);
            this.tab.Save    = new infoTab.EventButton(LuuLai);
            this.tab.Delete  = new infoTab.EventButton(Xoa);
            this.tab.Edit    = new infoTab.EventButton(Sua);
            this.tab.Refresh = new infoTab.EventButton(CapNhat);
            this.tab.Print   = new infoTab.EventButton(In);
        }
Exemplo n.º 4
0
        private void EnableButton()
        {
            infoTab tabcurrent = clstab.current();

            if (tabcurrent != null)
            {
                EnableButton(tabcurrent.Them, tabcurrent.Sua, tabcurrent.Sua, tabcurrent.Luu, tabcurrent.Luu, tabcurrent.CapNhat, tabcurrent.In);
            }
            else
            {
                EnableButton(false, false, false, false, false, false, false);
            }
        }
        public FrmPhongBan(string CurrentRowSelected)
        {
            this.StartPosition   = FormStartPosition.CenterScreen;
            this.FormBorderStyle = FormBorderStyle.FixedSingle;
            this.MaximizeBox     = false;
            InitializeComponent();

            this.tab = new infoTab();


            this.isUpdate           = true;
            this.CurrentRowSelected = CurrentRowSelected;
            txtTenPhong.Enabled     = false;
            HiddenIconTextBox();

            btnLuu.Visible  = true;
            btnHuy.Visible  = true;
            btnThem.Visible = true;
            btnSua.Visible  = true;
            btnDong.Visible = true;

            EnableButtonUpdate(true);
        }
Exemplo n.º 6
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            infoTab tabcurrent = clstab.current();

            tabcurrent.Print();
        }
Exemplo n.º 7
0
        private void btnRefresh_Click(object sender, EventArgs e)
        {
            infoTab tabcurrent = clstab.current();

            tabcurrent.Refresh();
        }
Exemplo n.º 8
0
        private void btnCancel_Click(object sender, EventArgs e)
        {
            infoTab tabcurrent = clstab.current();

            tabcurrent.Cancel();
        }
Exemplo n.º 9
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            infoTab tabcurrent = clstab.current();

            tabcurrent.Save();
        }
Exemplo n.º 10
0
        private void btnAddNew_Click(object sender, EventArgs e)
        {
            infoTab tabcurrent = clstab.current();

            tabcurrent.AddNew();
        }