Beispiel #1
0
        bool CheckLoi(LyDoTangGiamTaiSan data)
        {
            bool kq = true;

            if (Them)
            {
                //mã lý do tăng giảm tài sản rỗng
                if (string.IsNullOrEmpty(data.MaLyDoTangGiamTaiSan))
                {
                    MSG.ErrorStand("Bạn chưa nhập mã lý do tăng giảm tài sản!");
                    txtMa.Focus();
                    return(false);
                }
                //mã lý do tăng giảm tài sản đã có trong cơ sở dữ liệu
                foreach (LyDoTangGiamTaiSan item in frmDMLyDoTangGiamTaiSan.Ldata)
                {
                    if (item.MaLyDoTangGiamTaiSan.ToUpper().Equals(txtMa.Text.ToUpper()))
                    {
                        MSG.ErrorStand("Mã lý do tăng giảm tài sản đã có trong cơ sở dữ liệu!");
                        txtMa.Focus();
                        return(false);
                    }
                }
            }
            //Loại tăng giảm tài sản chỉ có thể là 1 hoặc 2
            List <string> IN = new List <string>()
            {
                "1", "2"
            };

            if (!IN.Contains(cbbLoaiTangGiamTaiSan.Text))
            {
                MSG.ErrorStand("Loại tăng giảm tài sản chỉ có thể nhận một trong hai giá trị 1 hoặc 2");
                cbbLoaiTangGiamTaiSan.Focus();
                return(false);
            }
            return(kq);
        }
Beispiel #2
0
        bool CheckLoi(PhanNhomTaiSan data)
        {
            bool kq = true;

            if (Them)
            {
                //mã phân nhóm tài sản rỗng
                if (string.IsNullOrEmpty(data.MaPhanNhomTaiSan))
                {
                    MSG.ErrorStand("Bạn chưa nhập mã phân nhóm tài sản!");
                    txtMa.Focus();
                    return(false);
                }
                //mã phân nhóm tài sản đã có trong cơ sở dữ liệu
                foreach (PhanNhomTaiSan item in frmDMPhanNhomTaiSan.Ldata)
                {
                    if (item.MaPhanNhomTaiSan.ToUpper().Equals(txtMa.Text.ToUpper()))
                    {
                        MSG.ErrorStand("Mã phân nhóm tài sản đã có trong cơ sở dữ liệu!");
                        txtMa.Focus();
                        return(false);
                    }
                }
            }
            //kiểm tra kiểu phân nhóm tài sản chỉ là 1,2,3
            List <string> IN = new List <string>()
            {
                "1", "2", "3"
            };

            if (!string.IsNullOrEmpty(txtKieuPhanNhomTS.Text) && !IN.Contains(txtKieuPhanNhomTS.Text))
            {
                MSG.ErrorStand("Kiểu phân nhóm tài sản chỉ có thể là 1 hoặc 2 hoặc 3!");
                txtKieuPhanNhomTS.Focus();
                return(false);
            }
            return(kq);
        }
Beispiel #3
0
        bool CheckLoi(LoaiTaiSan data)
        {
            bool kq = true;

            //mã loại tài sản rỗng
            if (string.IsNullOrEmpty(data.MaLoaiTaiSan))
            {
                MSG.ErrorStand("Bạn chưa nhập mã loại tài sản!");
                txtMa.Focus();
                return(false);
            }
            //mã loại tài sản đã có trong cơ sở dữ liệu
            foreach (LoaiTaiSan item in frmDMLoaiTaiSan.Ldata)
            {
                if (item.MaLoaiTaiSan.ToUpper().Equals(txtMa.Text.ToUpper()))
                {
                    MSG.ErrorStand("Mã loại tài sản đã có trong cơ sở dữ liệu!");
                    txtMa.Focus();
                    return(false);
                }
            }
            return(kq);
        }
Beispiel #4
0
        bool CheckLoi(ThoiKhauHaoTaiSan data)
        {
            bool kq = true;

            //mã giảm giá trị tài sản rỗng
            if (string.IsNullOrEmpty(data.MaTaiSan))
            {
                MSG.ErrorStand("Bạn chưa nhập mã thôi khấu hao tài sản!");
                txtMaTaiSan.Focus();
                return(false);
            }
            //mã giảm giá trị tài sản đã có trong cơ sở dữ liệu
            foreach (ThoiKhauHaoTaiSan item in frmNVThoiKhauHaoTaiSan.Ldata)
            {
                if (item.MaTaiSan.ToUpper().Equals(txtMaTaiSan.Text.ToUpper()))
                {
                    MSG.ErrorStand("Mã thôi khấu hao tài sản đã có trong cơ sở dữ liệu!");
                    txtMaTaiSan.Focus();
                    return(false);
                }
            }
            return(kq);
        }
        bool CheckLoi(BoPhanSuDung data)
        {
            bool kq = true;

            //mã bộ phận sử dụng rỗng
            if (string.IsNullOrEmpty(data.MaBoPhanSuDung))
            {
                MSG.ErrorStand("Bạn chưa nhập mã bộ phận sử dụng!");
                txtMa.Focus();
                return(false);
            }
            //mã bộ phận sử dụng đã có trong cơ sở dữ liệu
            foreach (BoPhanSuDung item in frmDMBoPhanSuDung.Ldata)
            {
                if (item.MaBoPhanSuDung.ToUpper().Equals(txtMa.Text.ToUpper()))
                {
                    MSG.ErrorStand("Mã bộ phận sử dụng đã có trong cơ sở dữ liệu!");
                    txtMa.Focus();
                    return(false);
                }
            }
            return(kq);
        }
        bool CheckLoi(ThietBi data)
        {
            bool kq = true;

            //mã thiết bị rỗng
            if (string.IsNullOrEmpty(data.MaThietBi))
            {
                MSG.ErrorStand("Bạn chưa nhập mã thiết bị!");
                txtMa.Focus();
                return(false);
            }
            //mã thiết bị đã có trong cơ sở dữ liệu
            foreach (ThietBi item in frmDMThietBi.Ldata)
            {
                if (item.MaThietBi.ToUpper().Equals(txtMa.Text.ToUpper()))
                {
                    MSG.ErrorStand("Mã thiết bị đã có trong cơ sở dữ liệu!");
                    txtMa.Focus();
                    return(false);
                }
            }
            return(kq);
        }
        bool CheckLoi(DieuChuyenBoPhanSuDung data)
        {
            bool kq = true;

            //mã điều chuyển bộ phận sử dụng rỗng
            if (string.IsNullOrEmpty(data.MaTaiSan))
            {
                MSG.ErrorStand("Bạn chưa nhập mã tài sản!");
                txtMaTaiSan.Focus();
                return(false);
            }
            //mã điều chuyển bộ phận sử dụng đã có trong cơ sở dữ liệu
            foreach (DieuChuyenBoPhanSuDung item in frmNVDieuChuyenBoPhanSuDung.Ldata)
            {
                if (item.MaTaiSan.ToUpper().Equals(txtMaTaiSan.Text.ToUpper()))
                {
                    MSG.ErrorStand("Mã tài sản đã có trong cơ sở dữ liệu!");
                    txtMaTaiSan.Focus();
                    return(false);
                }
            }
            return(kq);
        }
Beispiel #8
0
        bool CheckLoi(Phi data)
        {
            bool kq = true;

            //mã phí rỗng
            if (string.IsNullOrEmpty(data.MaPhi))
            {
                MSG.ErrorStand("Bạn chưa nhập mã phí!");
                txtMa.Focus();
                return(false);
            }
            //mã phí đã có trong cơ sở dữ liệu
            foreach (Phi item in frmDMPhi.Ldata)
            {
                if (item.MaPhi.ToUpper().Equals(txtMa.Text.ToUpper()))
                {
                    MSG.ErrorStand("Mã phí đã có trong cơ sở dữ liệu!");
                    txtMa.Focus();
                    return(false);
                }
            }
            return(kq);
        }
Beispiel #9
0
        bool CheckLoi(NguonVon data)
        {
            bool kq = true;

            //mã nguồn vốn rỗng
            if (string.IsNullOrEmpty(data.MaNguonVon))
            {
                MSG.ErrorStand("Bạn chưa nhập mã nguồn vốn!");
                txtMa.Focus();
                return(false);
            }
            //mã nguồn vốn đã có trong cơ sở dữ liệu
            foreach (NguonVon item in frmDMNguonVon.Ldata)
            {
                if (item.MaNguonVon.ToUpper().Equals(txtMa.Text.ToUpper()))
                {
                    MSG.ErrorStand("Mã nguồn vốn đã có trong cơ sở dữ liệu!");
                    txtMa.Focus();
                    return(false);
                }
            }
            return(kq);
        }
Beispiel #10
0
        bool CheckLoi(DieuChinhGiaTriTaiSan data)
        {
            bool kq = true;

            //mã điều chỉnh giá trị tài sản rỗng
            if (string.IsNullOrEmpty(data.MaTaiSan))
            {
                MSG.ErrorStand("Bạn chưa nhập mã điều chỉnh giá trị tài sản!");
                txtNam.Focus();
                return(false);
            }
            //mã điều chỉnh giá trị tài sản đã có trong cơ sở dữ liệu
            foreach (DieuChinhGiaTriTaiSan item in frmNVDieuChinhGiaTriTaiSan.Ldata)
            {
                if (item.MaTaiSan.ToUpper().Equals(txtNam.Text.ToUpper()))
                {
                    MSG.ErrorStand("Mã điều chỉnh giá trị tài sản đã có trong cơ sở dữ liệu!");
                    txtNam.Focus();
                    return(false);
                }
            }
            return(kq);
        }