Esempio n. 1
0
        public bool KiemTraHoatDong()
        {
            _dttb = new DTO_ThietBi()
            {
                ID_INF_MAC = cls_Main._Luachon
            };
            numberr = _tbb.TinhTrangThietBi(ref err, _dttb);
            if (numberr.Rows.Count > 0)
            {
                if (Convert.ToInt32(numberr.Rows[0]["NOW_STATUS"]) == 1)
                {
                    ToastNotification.Show(this, "Thiết bị phải được ghi nhận tình trạng trước khi sửa!", null, 2000, (eToastGlowColor)eToastGlowColor.Blue, (eToastPosition)eToastPosition.TopCenter);
                    txtloaithietbi.Enabled      = false;
                    txtlop.Enabled              = false;
                    txtlydohong.Enabled         = false;
                    txttenthietbi.Enabled       = false;
                    txttinhtranghientai.Enabled = false;
                    btnLuu.Enabled              = false;
                    btnHuy.Enabled              = false;
                    btntrathietbi.Enabled       = false;
                    dtngaysua.Enabled           = false;
                    cbgiaovien.Enabled          = false;
                    cblichgv.Enabled            = false;
                    cbnhanvien.Enabled          = false;
                    lblchuyentrang.Visible      = false;

                    return(true);
                }
            }
            return(false);
        }
Esempio n. 2
0
        public void KiemTra()
        {
            DataTable dtdangsua = new DataTable();

            _dttb = new DTO_ThietBi()
            {
                ID_INF_MAC = cls_Main._Luachon
            };
            numberr   = _tbb.ThietBiDangMuon(ref err, _dttb);
            dtdangsua = _tbb.TinhTrangThietBi(ref err, _dttb);
            if (numberr.Rows.Count > 0)
            {
                if (numberr.Rows[0]["ErrCode"].ToString() == "1")
                {
                    ToastNotification.Show(this, "Thiết bị phải được trã trước khi ghi nhận là không hoạt động!", null, 2000, (eToastGlowColor)eToastGlowColor.Blue, (eToastPosition)eToastPosition.TopCenter);
                    cbtinhtrang.Enabled         = false;
                    btnLuu.Enabled              = false;
                    lblchuyentrang.Visible      = true;
                    tchuyen.Enabled             = true;
                    circularProgress1.Visible   = true;
                    circularProgress1.IsRunning = true;
                    return;
                }
                else
                {
                    cbtinhtrang.Enabled = true;
                    btnLuu.Enabled      = true;
                }
            }
            if (dtdangsua.Rows.Count > 0)
            {
                if (dtdangsua.Rows[0]["FIX_STATUS"].ToString() == "4")
                {
                    ToastNotification.Show(this, "Thiết bị này chưa được sửa chữa hoàn tất.!", null, 2000, (eToastGlowColor)eToastGlowColor.Blue, (eToastPosition)eToastPosition.TopCenter);
                    cbtinhtrang.Enabled         = false;
                    btnLuu.Enabled              = false;
                    lblchuyentrang.Visible      = true;
                    _timersuachua.Enabled       = true;
                    circularProgress1.Visible   = true;
                    circularProgress1.IsRunning = true;
                    return;
                }
            }
        }