Exemple #1
0
        private void xemChiTiếtToolStripMenuItem_Click(object sender, EventArgs e)
        {
            int id = TextUtils.ToInt(grvData.GetFocusedRowCellValue(colObjectID));

            if (id == 0)
            {
                return;
            }

            if (BaiThucHanh.ID > 0)
            {
                BaiThucHanhModel model = (BaiThucHanhModel)BaiThucHanhBO.Instance.FindByPK(id);
                int version            = TextUtils.ToInt(grvData.GetFocusedRowCellValue(colVersion));

                frmBaiTHDetail frm = new frmBaiTHDetail();
                frm.BaiThucHanh   = model;
                frm.IsShowVersion = true;
                frm.Version       = version;
                TextUtils.OpenForm(frm);
            }
            else
            {
                ProductsModel model   = (ProductsModel)ProductsBO.Instance.FindByPK(id);
                int           version = TextUtils.ToInt(grvData.GetFocusedRowCellValue(colVersion));

                frmProduct frm = new frmProduct();
                frm.Product       = model;
                frm.IsShowVersion = true;
                frm.Version       = version;
                TextUtils.OpenForm(frm);
            }
        }
Exemple #2
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            frmBaiTHDetail frm = new frmBaiTHDetail();

            frm.GroupID = TextUtils.ToInt(treeData.FocusedNode.GetValue(colIDTree));
            if (frm.ShowDialog() == DialogResult.OK)
            {
                loadGrid(true);
            }
        }
Exemple #3
0
        private void btnEdit_Click(object sender, EventArgs e)
        {
            int id = TextUtils.ToInt(grvData.GetFocusedRowCellValue(colID));

            if (id == 0)
            {
                return;
            }
            BaiThucHanhModel model = (BaiThucHanhModel)BaiThucHanhBO.Instance.FindByPK(id);

            _rownIndex = grvData.FocusedRowHandle;

            frmBaiTHDetail frm = new frmBaiTHDetail();

            frm.BaiThucHanh = model;
            if (frm.ShowDialog() == DialogResult.OK)
            {
                loadGrid(true);
            }
        }