예제 #1
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            switch (content)
            {
            case "NhanVien":
                MaintainNhanVien maintainNhanVien = new MaintainNhanVien(this);
                maintainNhanVien.Show();
                break;

            case "HangHoa":
                MaintainHangHoa maintainHangHoa = new MaintainHangHoa(this);
                maintainHangHoa.Show();
                break;

            case "PhanXuong":
                MaintainPhanXuong maintainPhanXuong = new MaintainPhanXuong(this);
                maintainPhanXuong.Show();
                break;

            case "NhaPhanPhoi":
                MaintainNPP maintainNPP = new MaintainNPP(this);
                maintainNPP.Show();
                break;

            case "LoaiHangHoa":
                MaintainLoaiHangHoa maintainLoaiHangHoa = new MaintainLoaiHangHoa(this, null);
                maintainLoaiHangHoa.Show();
                break;

            case "HoaDonNhap":
                MaintainHoaDonNhap hoaDonNhap = new MaintainHoaDonNhap(this);
                hoaDonNhap.Show();
                break;

            case "HoaDonXuat":
                MaintainHoaDonXuat hoaDonXuat = new MaintainHoaDonXuat(this);
                hoaDonXuat.Show();
                break;
            }
        }
예제 #2
0
        private void btnEdit_Click(object sender, EventArgs e)
        {
            string id = dgvData.CurrentRow.Cells[0].FormattedValue.ToString().Trim();

            switch (content)
            {
            case "NhanVien":
                MaintainNhanVien maintainNhanVien = new MaintainNhanVien(this);
                maintainNhanVien.BindToDialog(id);
                maintainNhanVien.Show();
                break;

            case "HangHoa":
                MaintainHangHoa maintainHangHoa = new MaintainHangHoa(this);
                maintainHangHoa.BindToDialog(id);
                maintainHangHoa.Show();
                break;

            case "PhanXuong":
                MaintainPhanXuong maintainPhanXuong = new MaintainPhanXuong(this);
                maintainPhanXuong.BindToDialog(id);
                maintainPhanXuong.Show();
                break;

            case "NhaPhanPhoi":
                MaintainNPP maintainNPP = new MaintainNPP(this);
                maintainNPP.BindToDialog(id);
                maintainNPP.Show();
                break;

                /*case "LoaiHangHoa":
                 *  MaintainLoaiHangHoa maintainLoaiHangHoa = new MaintainLoaiHangHoa(this, null);
                 *  maintainLoaiHangHoa.BindToDialog(id);
                 *  maintainLoaiHangHoa.Show();
                 *  break;*/
            }
        }