Exemple #1
0
 private void Xoa()
 {
     try
     {
         if (vtIndex != -1)  //khi click lên tiêu đề header của datagrid thì bỏ qua
         {
             if (MSG.BanCoChacChanMuonXoaKhong() == System.Windows.Forms.DialogResult.Yes)
             {
                 GiamTaiSanCoDinh temp = Utils.DataGridViewRow_to_GiamTaiSanCoDinh(DataGridView.Rows[vtIndex]);
                 int kq = GiamTaiSanCoDinhBiz.DeleteGiamTaiSanCoDinh(temp);
                 if (kq > 0)
                 {
                     MSG.XoaThanhCong();
                 }
                 else
                 {
                     MSG.XoaThatBai();
                 }
                 if (kq <= 0)
                 {
                     MSG.XoaThatBai();
                 }
                 HienThi();
             }
         }
     }
     catch (Exception ex)
     {
         MSG.Error(ex);
     }
 }
Exemple #2
0
        private void DataGridViewCTPhuTungKemTheo_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                int vtIndex = e.RowIndex;
                if (vtIndex != -1)  //khi click lên tiêu đề header của datagrid thì bỏ qua
                {
                    if (isEditChiTietPhuTung)
                    {
                        MSG.MESSAGE("Bạn đang sửa Phụ tùng!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        return;
                    }

                    txtMaPhuTungKemTheo.Text     = LPhuTungKemTheo[vtIndex].MaPhuTungKemTheo;
                    txtTenPhuTungKemTheo.Text    = LPhuTungKemTheo[vtIndex].TenPhuTungKemTheo;
                    txtDonViTinh.Text            = LPhuTungKemTheo[vtIndex].DVT;
                    txtSoLuong.Text              = LPhuTungKemTheo[vtIndex].SoLuong.ToString();
                    txtGiaTri.Text               = LPhuTungKemTheo[vtIndex].GiaTri.ToString();
                    txtGhiChuPhuTungKemTheo.Text = LPhuTungKemTheo[vtIndex].GhiChu.ToString();

                    LPhuTungKemTheo.RemoveAt(vtIndex);
                    DataGridViewCTPhuTungKemTheo.DataSource = LPhuTungKemTheo.ToArray();
                    FixDataGirdView(DataGridViewCTPhuTungKemTheo, true);
                    isEditChiTietPhuTung = true;
                }
            }
            catch (Exception ex)
            {
                MSG.Error(ex);
            }
        }
 private void Xoa()
 {
     try
     {
         if (vtIndex != -1)  //khi click lên tiêu đề header của datagrid thì bỏ qua
         {
             if (MSG.BanCoChacChanMuonXoaKhong() == System.Windows.Forms.DialogResult.Yes)
             {
                 BoPhanHachToan temp = Utils.DataGridViewRow_to_BoPhanHachToan(DataGridView.Rows[vtIndex]);
                 int            kq   = BoPhanHachToanBiz.DeleteBoPhanHachToan(temp);
                 //if (kq > 0) MSG.XoaThanhCong();
                 //else MSG.XoaThatBai();
                 if (kq <= 0)
                 {
                     MSG.XoaThatBai();
                 }
                 HienThi();
             }
         }
     }
     catch (Exception ex)
     {
         MSG.Error(ex);
     }
 }
Exemple #4
0
        private void DataGridViewCTNguonVon_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                int vtIndex = e.RowIndex;
                if (vtIndex != -1)  //khi click lên tiêu đề header của datagrid thì bỏ qua
                {
                    if (isEditChiTietTaiSan)
                    {
                        MSG.MESSAGE("Bạn đang sửa Nguồn vốn!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        return;
                    }

                    txtNguonVon.Text         = LChiTietTaiSan[vtIndex].MaNguonVon;
                    txtNgayChungTu.Text      = LChiTietTaiSan[vtIndex].NgayChungTu.ToString("dd/MM/yyyy");
                    txtSoChungTu.Text        = LChiTietTaiSan[vtIndex].SoChungTu;
                    txtNguyenGia.Text        = LChiTietTaiSan[vtIndex].NguyenGia.ToString();
                    txtGiaTriDaKhauHao.Text  = LChiTietTaiSan[vtIndex].GiaTriDaKhauHao.ToString();
                    txtGiaTriConLai.Text     = LChiTietTaiSan[vtIndex].GiaTriConLai.ToString();
                    txtGiaTriKhauHao1Ky.Text = LChiTietTaiSan[vtIndex].GiaTriKhauHao1Ky.ToString();
                    txtDienGiai.Text         = LChiTietTaiSan[vtIndex].DienGiai;

                    LChiTietTaiSan.RemoveAt(vtIndex);
                    DataGridViewCTNguonVon.DataSource = LChiTietTaiSan.ToArray();
                    FixDataGirdView(DataGridViewCTNguonVon, false);
                    isEditChiTietTaiSan = true;
                }
            }
            catch (Exception ex)
            {
                MSG.Error(ex);
            }
        }
Exemple #5
0
        private void btnPhuTungKemTheoOK_Click(object sender, EventArgs e)
        {
            try
            {
                PhuTungKemTheo temp = new PhuTungKemTheo();
                temp.MaTaiSan = txtMaTaiSan.Text.ToUpper();

                temp.MaPhuTungKemTheo  = txtMaPhuTungKemTheo.Text.ToUpper();
                temp.TenPhuTungKemTheo = txtTenPhuTungKemTheo.Text;
                temp.DVT     = txtDonViTinh.Text;
                temp.SoLuong = double.Parse(txtSoLuong.Text);
                temp.GiaTri  = double.Parse(txtGiaTri.Text);
                temp.GhiChu  = txtGhiChuPhuTungKemTheo.Text;

                //Check lỗi phụ tùng kèm theo

                LPhuTungKemTheo.Add(temp);
                DataGridViewCTPhuTungKemTheo.DataSource = LPhuTungKemTheo.ToArray();
                FixDataGirdView(DataGridViewCTPhuTungKemTheo, true);
                ResetPhuTungKemTheo();
                if (isEditChiTietPhuTung)
                {
                    isEditChiTietPhuTung = false;
                }
            }
            catch (Exception ex)
            {
                MSG.Error(ex);
            }
        }
Exemple #6
0
        private void btnNguonVonOK_Click(object sender, EventArgs e)
        {
            try
            {
                ChiTietTaiSan temp = new ChiTietTaiSan();
                temp.MaTaiSan = txtMaTaiSan.Text.ToUpper();

                temp.MaNguonVon       = txtNguonVon.Text.ToUpper();
                temp.NgayChungTu      = DateTime.Parse(txtNgayChungTu.Text);
                temp.SoChungTu        = txtSoChungTu.Text;
                temp.NguyenGia        = double.Parse(txtNguyenGia.Text);
                temp.GiaTriDaKhauHao  = double.Parse(txtGiaTriDaKhauHao.Text);
                temp.GiaTriConLai     = double.Parse(txtGiaTriConLai.Text);
                temp.GiaTriKhauHao1Ky = double.Parse(txtGiaTriKhauHao1Ky.Text);
                temp.DienGiai         = txtDienGiai.Text;

                //Check lỗi nguồn vốn

                LChiTietTaiSan.Add(temp);
                DataGridViewCTNguonVon.DataSource = LChiTietTaiSan.ToArray();
                FixDataGirdView(DataGridViewCTNguonVon, false);
                ResetNguonVon();
                if (isEditChiTietTaiSan)
                {
                    isEditChiTietTaiSan = false;
                }
            }
            catch (Exception ex)
            {
                MSG.Error(ex);
            }
        }
        private void btnDongY_Click(object sender, EventArgs e)
        {
            try
            {
                DieuChuyenBoPhanSuDung temp = new DieuChuyenBoPhanSuDung();
                temp.DieuChuyenBoPhanSuDungID = idDieuChuyenBoPhanSuDung;
                temp.MaTaiSan       = txtMaTaiSan.Text;
                temp.Nam            = txtNam.Text;
                temp.Ky             = txtKy.Text;
                temp.MaBoPhanSuDung = txtBoPhanSuDung.Text;
                temp.TKTaiSan       = txtTKTaiSan.Text;
                temp.TKKhauHao      = txtTKKhauHao.Text;
                temp.TKChiPhi       = txtTKChiPhi.Text;

                bool ThatBai = false;
                if (Them)
                {//Thêm
                    if (!CheckLoi(temp))
                    {
                        return;
                    }

                    int kq = DieuChuyenBoPhanSuDungBiz.AddDieuChuyenBoPhanSuDung(temp);
                    if (kq > 0)
                    {
                        MSG.ThemThanhCong();
                    }
                    else
                    {
                        ThatBai = true;
                        MSG.ThemThatBai();
                    }
                }
                else
                {//Sửa
                    temp.DieuChuyenBoPhanSuDungID = idDieuChuyenBoPhanSuDung;
                    int kq = DieuChuyenBoPhanSuDungBiz.EditDieuChuyenBoPhanSuDung(temp);
                    if (kq > 0)
                    {
                        MSG.SuaThanhCong();
                    }
                    else
                    {
                        ThatBai = true;
                        MSG.SuaThatBai();
                    }
                }
                if (ThatBai && MSG.MESSAGE("Bạn có muốn sửa lại dữ liệu không?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    return;
                }
                this.Close();
            }
            catch (Exception ex)
            {
                MSG.Error(ex);
            }
        }
Exemple #8
0
        private void btnDongY_Click(object sender, EventArgs e)
        {
            try
            {
                GiamTaiSanCoDinh temp = new GiamTaiSanCoDinh();
                temp.GiamTaiSanCoDinhID   = idGiamTaiSanCoDinh;
                temp.MaTaiSan             = txtMaTaiSan.Text;
                temp.MaLyDoTangGiamTaiSan = txtLyDoTangGiamTaiSan.Text;
                temp.NgayGiam             = DateTime.Parse(txtNgayGiamTaiSan.Text);
                temp.NgayKetThucKhauHao   = DateTime.Parse(txtNgayKetThucKhauHao.Text);
                temp.SoChungTu            = txtSoChungTu.Text;
                temp.LyDo = txtLyDo.Text;

                bool ThatBai = false;
                if (Them)
                {//Thêm
                    if (!CheckLoi(temp))
                    {
                        return;
                    }

                    int kq = GiamTaiSanCoDinhBiz.AddGiamTaiSanCoDinh(temp);
                    if (kq > 0)
                    {
                        MSG.ThemThanhCong();
                    }
                    else
                    {
                        ThatBai = true;
                        MSG.ThemThatBai();
                    }
                }
                else
                {//Sửa
                    temp.GiamTaiSanCoDinhID = idGiamTaiSanCoDinh;
                    int kq = GiamTaiSanCoDinhBiz.EditGiamTaiSanCoDinh(temp);
                    if (kq > 0)
                    {
                        MSG.SuaThanhCong();
                    }
                    else
                    {
                        ThatBai = true;
                        MSG.SuaThatBai();
                    }
                }
                if (ThatBai && MSG.MESSAGE("Bạn có muốn sửa lại dữ liệu không?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    return;
                }
                this.Close();
            }
            catch (Exception ex)
            {
                MSG.Error(ex);
            }
        }
Exemple #9
0
        private void btnDongY_Click(object sender, EventArgs e)
        {
            try
            {
                ThoiKhauHaoTaiSan temp = new ThoiKhauHaoTaiSan();
                temp.ThoiKhauHaoTaiSanID = idThoiKhauHaoTaiSan;
                temp.MaTaiSan            = txtMaTaiSan.Text;
                temp.NgayThoiKhauHao     = DateTime.Parse(txtNgayThoiKhauHao.Text);

                bool ThatBai = false;
                if (Them)
                {//Thêm
                    if (!CheckLoi(temp))
                    {
                        return;
                    }

                    int kq = ThoiKhauHaoTaiSanBiz.AddThoiKhauHaoTaiSan(temp);
                    if (kq > 0)
                    {
                        MSG.ThemThanhCong();
                    }
                    else
                    {
                        ThatBai = true;
                        MSG.ThemThatBai();
                    }
                }
                else
                {//Sửa
                    temp.ThoiKhauHaoTaiSanID = idThoiKhauHaoTaiSan;
                    int kq = ThoiKhauHaoTaiSanBiz.EditThoiKhauHaoTaiSan(temp);
                    if (kq > 0)
                    {
                        MSG.SuaThanhCong();
                    }
                    else
                    {
                        ThatBai = true;
                        MSG.SuaThatBai();
                    }
                }
                if (ThatBai && MSG.MESSAGE("Bạn có muốn sửa lại dữ liệu không?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    return;
                }
                this.Close();
            }
            catch (Exception ex)
            {
                MSG.Error(ex);
            }
        }
 private void Them()
 {
     try
     {
         frmXuLyDMBoPhanHachToan frm = new frmXuLyDMBoPhanHachToan();
         frm.StartPosition = FormStartPosition.CenterScreen;
         frm.ShowDialog();
         HienThi();
         if (Ldata.Count != 0)
         {
             DataGridView.Rows[vtIndex == -1 ? 0 : vtIndex].Selected = true;                     //nếu ko có phần tử nào thì thôi
         }
     }
     catch (Exception ex)
     {
         MSG.Error(ex);
     }
 }
Exemple #11
0
 private void txtTenSearch_TextChanged(object sender, EventArgs e)
 {
     try
     {
         List <GiamTaiSanCoDinh> Ltemp = new List <GiamTaiSanCoDinh>();
         string search = txtTenSearch.Text.ToUpper();
         foreach (GiamTaiSanCoDinh item in Ldata)
         {
             if (item.SoChungTu.ToUpper().Contains(search))
             {
                 Ltemp.Add(item);
             }
         }
         DataGridView.DataSource = Ltemp.ToArray();
         FixDataGirdView();
     }
     catch (Exception ex)
     {
         MSG.Error(ex);
     }
 }
 private void Sua()
 {
     try
     {
         if (vtIndex != -1)  //khi click lên tiêu đề header của datagrid thì bỏ qua
         {
             frmXuLyDMBoPhanHachToan frm = new frmXuLyDMBoPhanHachToan(DataGridView.Rows[vtIndex]);
             frm.StartPosition = FormStartPosition.CenterScreen;
             frm.ShowDialog();
             HienThi();
             if (Ldata.Count != 0)
             {
                 DataGridView.Rows[vtIndex == -1 ? 0 : vtIndex].Selected = true;                     //nếu ko có phần tử nào thì thôi
             }
         }
     }
     catch (Exception ex)
     {
         MSG.Error(ex);
     }
 }
 private void txtTenSearch_TextChanged(object sender, EventArgs e)
 {
     try
     {
         List <BoPhanHachToan> Ltemp = new List <BoPhanHachToan>();
         string search = txtTenSearch.Text.ToUpper();
         foreach (BoPhanHachToan item in Ldata)
         {
             if (item.TenBoPhanHachToan.ToUpper().Contains(search))
             {
                 Ltemp.Add(item);
             }
         }
         DataGridView.DataSource = Ltemp.ToArray();
         FixDataGirdView();
     }
     catch (Exception ex)
     {
         MSG.Error(ex);
     }
 }
Exemple #14
0
 private void txtTenSearch_TextChanged(object sender, EventArgs e)
 {
     try
     {
         List <ThoiKhauHaoTaiSan> Ltemp = new List <ThoiKhauHaoTaiSan>();
         string search = txtTenSearch.Text.ToUpper();
         foreach (ThoiKhauHaoTaiSan item in Ldata)
         {
             if (item.NgayThoiKhauHao.ToString("MM/dd/yyyy").Contains(search))
             {
                 Ltemp.Add(item);
             }
         }
         DataGridView.DataSource = Ltemp.ToArray();
         FixDataGirdView();
     }
     catch (Exception ex)
     {
         MSG.Error(ex);
     }
 }
 private void txtMaSearch_TextChanged(object sender, EventArgs e)
 {
     try
     {
         List <DieuChinhGiaTriTaiSan> Ltemp = new List <DieuChinhGiaTriTaiSan>();
         string search = txtMaSearch.Text.ToUpper();
         foreach (DieuChinhGiaTriTaiSan item in Ldata)
         {
             if (item.MaNguonVon.ToUpper().Contains(search))
             {
                 Ltemp.Add(item);
             }
         }
         DataGridView.DataSource = Ltemp.ToArray();
         FixDataGirdView();
     }
     catch (Exception ex)
     {
         MSG.Error(ex);
     }
 }
Exemple #16
0
 private void DataGridView_KeyDown(object sender, KeyEventArgs e)
 {
     try
     {
         if (e.KeyCode == Keys.Enter)
         {
             vtIndex = DataGridView.SelectedRows[0].Index;
             if (vtIndex == -1)
             {
                 return;
             }
             DongY();
             this.Close();
         }
         else
         {
             e.Handled = false;
         }
     }
     catch (Exception ex)
     {
         MSG.Error(ex);
     }
 }
 private bool Default()
 {
     MSG.Error("No Function Tool", "Error");
     return(false);
 }
Exemple #18
0
        private void btnDongY_Click(object sender, EventArgs e)
        {
            try
            {
                TaiSan temp = new TaiSan();
                temp.MaTaiSan             = txtMaTaiSan.Text;
                temp.TenTaiSan            = txtTenTaiSan.Text;
                temp.MaLoaiTaiSan         = txtNhomTaiSan.Text;
                temp.MaLyDoTangGiamTaiSan = txtLyDoTang.Text;
                temp.NgayTangTaiSan       = !string.IsNullOrEmpty(txtNgayTangTaiSan.Text) ? DateTime.Parse(txtNgayTangTaiSan.Text) : new DateTime(1753, 1, 1);
                temp.NgayTinhKhauHao      = !string.IsNullOrEmpty(txtNgayTinhKhauHao.Text) ? DateTime.Parse(txtNgayTinhKhauHao.Text) : new DateTime(1753, 1, 1);
                temp.SoKyKhauHao          = txtSoKyKhauHao.Text;
                temp.MaBoPhanHachToan     = txtBoPhanHachToan.Text;
                temp.MaPhanXuong          = txtMaPhanXuong.Text;
                temp.MaPhi          = txtMaPhi.Text;
                temp.MaBoPhanSuDung = txtBoPhanSuDung.Text;
                temp.TKTaiSan       = txtTKTaiSan.Text;
                temp.TKKhauHao      = txtTKKhauHao.Text;
                temp.TKChiPhi       = txtTKChiPhi.Text;
                temp.PhanNhom1      = txtPhanNhom1.Text;
                temp.PhanNhom2      = txtPhanNhom2.Text;
                temp.PhanNhom3      = txtPhanNhom3.Text;

                temp.TenKhac           = txtTenKhac.Text;
                temp.SoHieuTaiSan      = txtSoHieuTaiSan.Text;
                temp.ThongSoKyThuat    = txtThongSoKyThuat.Text;
                temp.NuocSanXuat       = txtNuocSanXuat.Text;
                temp.NamSanXuat        = txtNamSanXuat.Text;
                temp.NgayDuaVaoSuDung  = !string.IsNullOrEmpty(txtNgayDuaVaoSuDung.Text) ? DateTime.Parse(txtNgayDuaVaoSuDung.Text) : new DateTime(1753, 1, 1);
                temp.NgayDinhChiSuDung = !string.IsNullOrEmpty(txtNgayDinhChiSuDung.Text) ? DateTime.Parse(txtNgayDinhChiSuDung.Text) : new DateTime(1753, 1, 1);
                temp.LyDoDinhChi       = txtLyDoDinhChi.Text;
                temp.GhiChu            = txtGhiChu.Text;

                temp.Lchitiettaisan.AddRange(LChiTietTaiSan);
                temp.Lphutungkemtheo.AddRange(LPhuTungKemTheo);

                bool ThatBai = false;
                if (Them)
                {//Thêm
                    if (!CheckLoi(temp))
                    {
                        return;
                    }

                    int kq = TaiSanBiz.AddTaiSan(temp);
                    if (kq > 0)
                    {
                        MSG.ThemThanhCong();
                    }
                    else
                    {
                        ThatBai = true;
                        MSG.ThemThatBai();
                    }
                }
                else
                {//Sửa
                    int kq = TaiSanBiz.EditTaiSan(temp);
                    if (kq > 0)
                    {
                        MSG.SuaThanhCong();
                    }
                    else
                    {
                        ThatBai = true;
                        MSG.SuaThatBai();
                    }
                }
                if (ThatBai && MSG.MESSAGE("Bạn có muốn sửa lại dữ liệu không?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    return;
                }
                this.Close();
            }
            catch (Exception ex)
            {
                MSG.Error(ex);
            }
        }
Exemple #19
0
        private void btnDongY_Click(object sender, EventArgs e)
        {
            try
            {
                DieuChinhGiaTriTaiSan temp = new DieuChinhGiaTriTaiSan();
                temp.MaLyDoTangGiamTaiSan = txtMaLyDoTangGiamTaiSan.Text;
                List <LyDoTangGiamTaiSan> L = LyDoTangGiamTaiSanBiz.getListLyDoTangGiamTaiSan(temp.MaLyDoTangGiamTaiSan);
                temp.Loai             = (L.Count > 0) ? L[0].LoaiTangGiamTaiSan : true; //mặc định tăng
                temp.MaTaiSan         = txtMaTaiSan.Text;
                temp.Nam              = txtNam.Text;
                temp.Ky               = txtKy.Text;
                temp.NgayChungTu      = DateTime.Parse(txtNgayChungTu.Text);
                temp.SoChungTu        = txtSoChungTu.Text;
                temp.MaNguonVon       = txtMaNguonVon.Text;
                temp.NguyenGia        = double.Parse(txtNguyenGia.Text);
                temp.GiaTriDaKhauHao  = double.Parse(txtGiaTriDaKhauHao.Text);
                temp.GiaTriConLai     = double.Parse(txtGiaTriConLai.Text);
                temp.GiaTriKhauHao1Ky = double.Parse(txtGiaTriKhauHao1Ky.Text);
                temp.DienGiai         = txtDienGiai.Text;

                bool ThatBai = false;
                if (Them)
                {//Thêm
                    if (!CheckLoi(temp))
                    {
                        return;
                    }

                    int kq = DieuChinhGiaTriTaiSanBiz.AddDieuChinhGiaTriTaiSan(temp);
                    if (kq > 0)
                    {
                        MSG.ThemThanhCong();
                    }
                    else
                    {
                        ThatBai = true;
                        MSG.ThemThatBai();
                    }
                }
                else
                {//Sửa
                    temp.DieuChinhGiaTriTaiSanID = idDieuChinhGiaTriTaiSan;
                    int kq = DieuChinhGiaTriTaiSanBiz.EditDieuChinhGiaTriTaiSan(temp);
                    if (kq > 0)
                    {
                        MSG.SuaThanhCong();
                    }
                    else
                    {
                        ThatBai = true;
                        MSG.SuaThatBai();
                    }
                }
                if (ThatBai && MSG.MESSAGE("Bạn có muốn sửa lại dữ liệu không?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    return;
                }
                this.Close();
            }
            catch (Exception ex)
            {
                MSG.Error(ex);
            }
        }
Exemple #20
0
        //------------------------------------------>
        private void txtTenSearch_TextChanged(object sender, EventArgs e)
        {
            try
            {
                switch (chose)
                {
                case CONFIG.ConstFrm.frmDMLoaiTaiSan:
                {
                    List <LoaiTaiSan> Ltemp  = new List <LoaiTaiSan>();
                    string            search = txtMaSearch.Text.ToUpper();
                    foreach (LoaiTaiSan item in Lloaitaisan)
                    {
                        if (item.TenLoaiTaiSan.ToUpper().Contains(search))
                        {
                            Ltemp.Add(item);
                        }
                    }
                    DataGridView.DataSource = Ltemp.ToArray();
                    FixDataGirdView();
                    break;
                }

                case CONFIG.ConstFrm.frmDMTaiSan:
                {
                    List <TaiSan> Ltemp  = new List <TaiSan>();
                    string        search = txtTenSearch.Text.ToUpper();
                    foreach (TaiSan item in Ltaisan)
                    {
                        if (item.TenTaiSan.ToUpper().Contains(search))
                        {
                            Ltemp.Add(item);
                        }
                    }
                    DataGridView.DataSource = Ltemp.ToArray();
                    FixDataGirdView();
                    break;
                }

                case CONFIG.ConstFrm.frmDMPhanNhomTaiSan:
                {
                    List <PhanNhomTaiSan> Ltemp = new List <PhanNhomTaiSan>();
                    string search = txtTenSearch.Text.ToUpper();
                    foreach (PhanNhomTaiSan item in Lphannhomtaisan)
                    {
                        if (item.TenPhanNhomTaiSan.ToUpper().Contains(search))
                        {
                            Ltemp.Add(item);
                        }
                    }
                    DataGridView.DataSource = Ltemp.ToArray();
                    FixDataGirdView();
                    break;
                }

                case CONFIG.ConstFrm.frmDMLyDoTangGiamTaiSan:
                {
                    List <LyDoTangGiamTaiSan> Ltemp = new List <LyDoTangGiamTaiSan>();
                    string search = txtTenSearch.Text.ToUpper();
                    foreach (LyDoTangGiamTaiSan item in Llydotanggiamtaisan)
                    {
                        if (item.TenLyDoTangGiamTaiSan.ToUpper().Contains(search))
                        {
                            Ltemp.Add(item);
                        }
                    }
                    DataGridView.DataSource = Ltemp.ToArray();
                    FixDataGirdView();
                    break;
                }

                case CONFIG.ConstFrm.frmDMBoPhanHachToan:
                {
                    List <BoPhanHachToan> Ltemp = new List <BoPhanHachToan>();
                    string search = txtTenSearch.Text.ToUpper();
                    foreach (BoPhanHachToan item in Lbophanhachtoan)
                    {
                        if (item.TenBoPhanHachToan.ToUpper().Contains(search))
                        {
                            Ltemp.Add(item);
                        }
                    }
                    DataGridView.DataSource = Ltemp.ToArray();
                    FixDataGirdView();
                    break;
                }

                case CONFIG.ConstFrm.frmDMPhanXuong:
                {
                    List <PhanXuong> Ltemp  = new List <PhanXuong>();
                    string           search = txtTenSearch.Text.ToUpper();
                    foreach (PhanXuong item in Lphanxuong)
                    {
                        if (item.TenPhanXuong.ToUpper().Contains(search))
                        {
                            Ltemp.Add(item);
                        }
                    }
                    DataGridView.DataSource = Ltemp.ToArray();
                    FixDataGirdView();
                    break;
                }

                case CONFIG.ConstFrm.frmDMPhi:
                {
                    List <Phi> Ltemp  = new List <Phi>();
                    string     search = txtTenSearch.Text.ToUpper();
                    foreach (Phi item in Lphi)
                    {
                        if (item.TenPhi.ToUpper().Contains(search))
                        {
                            Ltemp.Add(item);
                        }
                    }
                    DataGridView.DataSource = Ltemp.ToArray();
                    FixDataGirdView();
                    break;
                }

                case CONFIG.ConstFrm.frmDMBoPhanSuDung:
                {
                    List <BoPhanSuDung> Ltemp = new List <BoPhanSuDung>();
                    string search             = txtTenSearch.Text.ToUpper();
                    foreach (BoPhanSuDung item in Lbophansusung)
                    {
                        if (item.TenBoPhanSuDung.ToUpper().Contains(search))
                        {
                            Ltemp.Add(item);
                        }
                    }
                    DataGridView.DataSource = Ltemp.ToArray();
                    FixDataGirdView();
                    break;
                }

                case CONFIG.ConstFrm.frmDMNguonVon:
                {
                    List <NguonVon> Ltemp  = new List <NguonVon>();
                    string          search = txtTenSearch.Text.ToUpper();
                    foreach (NguonVon item in Lnguonvon)
                    {
                        if (item.TenNguonVon.ToUpper().Contains(search))
                        {
                            Ltemp.Add(item);
                        }
                    }
                    DataGridView.DataSource = Ltemp.ToArray();
                    FixDataGirdView();
                    break;
                }

                default:
                    break;
                }
            }
            catch (Exception ex)
            {
                MSG.Error(ex);
            }
        }