Exemplo n.º 1
0
        private void btnAddNew_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            //GridView view = gvMain;
            //if(Convert.IsDBNull(view.GetFocusedRowCellValue("Id_kiemTra")))
            //{
            //    int m_id = Convert.ToInt32(view.GetFocusedRowCellValue("Id_xe"));
            //    myFroms.frmKiemTraTinhTrangXeBan frm = new myFroms.frmKiemTraTinhTrangXeBan(-1, m_id);
            //    frm.ShowDialog();
            //    loadData(mYear, mMonth);
            //}

            GridView view = gvMain;

            if (view.FocusedRowHandle > -1)
            {
                if (Convert.ToString(view.GetFocusedRowCellValue("Trang_Thai")) != "Đã kiểm tra")
                {
                    if (Convert.IsDBNull(view.GetFocusedRowCellValue("Id_kiemTra")))
                    {
                        int m_id = Convert.ToInt32(view.GetFocusedRowCellValue("Id_May"));
                        myFroms.frmKiemTraTinhTrangDTBan frm = new myFroms.frmKiemTraTinhTrangDTBan(-1, m_id);
                        frm.ShowDialog();
                        loadData(mYear, mMonth);
                    }
                }
                else
                {
                    XtraMessageBox.Show("Sản phẩm đã được định giá vui lòng kiểm tra.");
                }
            }
        }
Exemplo n.º 2
0
        private void gcMain_DoubleClick(object sender, EventArgs e)
        {
            GridView view = gvMain;

            if (Convert.IsDBNull(view.GetFocusedRowCellValue("Id_kiemTra")))
            {
                int m_id = Convert.ToInt32(view.GetFocusedRowCellValue("Id_May"));
                myFroms.frmKiemTraTinhTrangDTBan frm = new myFroms.frmKiemTraTinhTrangDTBan(-1, m_id);
                frm.ShowDialog();
                loadData(mYear, mMonth);
            }
            else
            {
                int m_id = Convert.ToInt32(view.GetFocusedRowCellValue("Id_May"));
                myFroms.frmKiemTraTinhTrangDTBan frm = new myFroms.frmKiemTraTinhTrangDTBan(Convert.ToInt32(view.GetFocusedRowCellValue("Id_kiemtra")), m_id);
                frm.ShowDialog();
                loadData(mYear, mMonth);
            }
        }
Exemplo n.º 3
0
        private void btnEdit_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            GridView view = gvMain;

            if (view.FocusedRowHandle > -1)
            {
                if (!Convert.IsDBNull(view.GetFocusedRowCellValue("Id_kiemTra")))
                {
                    int m_id = Convert.ToInt32(view.GetFocusedRowCellValue("Id_May"));
                    myFroms.frmKiemTraTinhTrangDTBan frm = new myFroms.frmKiemTraTinhTrangDTBan(Convert.ToInt32(view.GetFocusedRowCellValue("Id_kiemTra")), m_id);
                    frm.ShowDialog();
                    loadData(mYear, mMonth);
                }
                else
                {
                    XtraMessageBox.Show("Máy này chưa được định giá mua. Vui lòng kiểm tra");
                }
            }
        }