Example #1
0
        public bool SaveLabTestRemarks(PatientRegistration pr, LabTestRemarks Remarks)
        {
            try
            {
                con = new OleDbConnection();
                this.readconfile     = new ReadConfigFile();
                con.ConnectionString = this.readconfile.ConfigString(ConfigFiles.ProjectConfigFile);
                con.Open();
                tran            = con.BeginTransaction();
                cmd             = new OleDbCommand();
                cmd.Connection  = con;
                cmd.Transaction = tran;
                cmd.CommandText = "Update LabTestPerformed set Remarks='" + Remarks.Remarks + "',TestPerformed = " + Remarks.IsTestPerformed + " where TokenNumber=" + pr.TokenNumber + " and TokenDate='" + pr.TokenDate.ToShortDateString() + "' and TokenMonthYear=" + pr.TokenMonthYear + " and LabTestID=" + Remarks.LabTest.LabTestId;
                cmd.ExecuteNonQuery();
                tran.Commit();
                return(true);
            }
            catch (Exception ex)
            {
                tran.Rollback();
                throw ex;
            }

            finally
            { con.Close(); }
        }
Example #2
0
        private void btnSaveRemarks_Click(object sender, EventArgs e)
        {
            LabTestRemarks ltr = new LabTestRemarks();

            if (lstLabTest.Items.Count > 0)
            {
                if (this.lstLabTest.SelectedItem == null)
                {
                    MessageBox.Show("Please Select the Test to Give Remarks", "Remarks");
                    return;
                }
                ltr.LabTest         = (LabTest)this.lstLabTest.SelectedItem;
                ltr.Remarks         = this.txtRemarks.Text.Trim();
                ltr.IsTestPerformed = true;
                if (MessageBox.Show("Do you want to Save Remarks? ", "Save Remarks", MessageBoxButtons.YesNo) == DialogResult.No)
                {
                    return;
                }
                if (new PatientBLL().SaveLabTestRemarks(pr, ltr) == true)
                {
                    MessageBox.Show("Congratulations Remarks Saved Successfully!!!", "Remarks Saved");
                    lstLabTest.Items.RemoveAt(lstLabTest.SelectedIndex);
                    this.txtRemarks.Text = string.Empty;
                }
            }
            if (lstLabTest.Items.Count == 0)
            {
                LoadTokens();
                this.txtRemarks.Text = string.Empty;
            }
        }
Example #3
0
 public bool SaveLabTestRemarks(PatientRegistration pr, LabTestRemarks ltr)
 {
     return(new PatientDAL().SaveLabTestRemarks(pr, ltr));
 }