Exemplo n.º 1
0
 private void grdAllTodayTestInfo_SelectionChanged(object sender, EventArgs e)
 {
     if (grdAllTodayTestInfo.CurrentRow != null)
     {
         _dtTestResult = TestInfoBusiness.GetTestResultByTestId(grdAllTodayTestInfo.CurrentRow.Cells["colTestID_XN"].Value.ToString());
     }
 }
Exemplo n.º 2
0
        private void DeletePatientTestType()
        {
            DataGridViewRow currentrow = grdTestType.CurrentRow;

            //if (grdTestType.CurrentRow != null)
            if (currentrow != null)
            {
                int rowIndex = grdTestType.CurrentRow.Index;
                //  int row = Convert.ToInt32(grdTestType.CurrentRow.Cells["colBarcode"].ToString());

                testId     = Lablink.Utilities.UI.GetCellValue(currentrow.Cells["colTest_ID"]);
                pid        = Lablink.Utilities.UI.GetCellValue(currentrow.Cells["colBarcode"]);
                testTypeId = Lablink.Utilities.UI.GetCellValue(currentrow.Cells["TestType_ID"]);
                DataTable dt1 =
                    TestInfoBusiness.GetTestResultByTestId(testId, testTypeId);
                //DataTable dt =
                //    TestInfoBusiness.GetTestResultByTestId(
                //        dtRegisteredTestType.Rows[rowIndex][TTestInfo.Columns.TestId].ToString());
                if (dt1.Rows.Count > 0)
                {
                    Utility.ShowMsg("Xét nghiệm có kết quả. Không thể xóa được !", "Thông báo");
                }
                //if (dtRegTest.Rows.Count > 0)
                //{
                //    Utility.ShowMsg("Loại xét nghiệm đã có đăng ký test?", "Thông báo");
                //}
                else if (dt1.Rows.Count <= 0)
                {
                    if (Utility.AcceptQuestion("Bạn có muốn xóa loại xét nghiệm này ko?", "Thông báo", true))
                    {
                        TestInfoBusiness.DeleteTesInfor(Convert.ToInt32(testId));
                        grdTestType.Rows.Remove(currentrow);
                    }

                    //TestInfoBusiness.DeleteTestInfo(
                    //    dtRegisteredTestType.Rows[rowIndex][TTestInfo.Columns.TestId].ToString());
                    // dtRegisteredTestType.Rows.RemoveAt(rowIndex);
                }
                dtRegisteredTestType.AcceptChanges();
                //Khi BN ko còn đăng ký XN nào thì đưa SID về Empty
                if (dtRegisteredTestType.Rows.Count == 0)
                {
                    dtPatientList.Rows[grdPatientList.CurrentRow.Index]["SID"] = string.Empty;
                    dtPatientList.AcceptChanges();
                }
            }
        }