Ejemplo n.º 1
0
 private void frm_Patient_Detail_Edit_Load(object sender, EventArgs e)
 {
     try
     {
         if (GlobalVariable._Patient_id != "")
         {
             txtId.Text = GlobalVariable._Patient_id;
             RetrieveData(int.Parse(GlobalVariable._Patient_id));
             GlobalVariable._Patient_id = "";
             GlobalMethod.getGreenRed("md_status", dgvMd, "Inactive");
         }
         txtTel.KeyPress     += new KeyPressEventHandler(EventHandler.TextBoxNumberOnly);
         txtKhFname.KeyPress += new KeyPressEventHandler(EventHandler.TextBoxTextOnly);
         txtKhLname.KeyPress += new KeyPressEventHandler(EventHandler.TextBoxTextOnly);
         txtFname.KeyPress   += new KeyPressEventHandler(EventHandler.TextBoxTextOnly);
         txtLname.KeyPress   += new KeyPressEventHandler(EventHandler.TextBoxTextOnly);
         txtNati.KeyPress    += new KeyPressEventHandler(EventHandler.TextBoxTextOnly);
         txtJob.KeyDown      += new KeyEventHandler(EventHandler.TextBoxClearBackPress);
         txtJob.Leave        += new System.EventHandler(EventHandler.TextBoxLeaveReturnDefalut);
         txtAddress.KeyDown  += new KeyEventHandler(EventHandler.TextBoxClearBackPress);
         txtAddress.Leave    += new System.EventHandler(EventHandler.TextBoxLeaveReturnDefalut);
     }
     catch (Exception t)
     {
         GlobalMethod.HandleException("frm_Patient_Detail_Load :" + t.Message);
     }
 }
 private void btnAdd_Click(object sender, EventArgs e)
 {
     foreach (DataGridViewRow row in dgvMd.Rows)
     {
         if (row.Cells["md_id"].Value​​.ToString() == cboMd.SelectedValue.ToString())
         {
             MyMSB.Show("ប្រវតិ្តវេជ្ជសាស្រ្តបានបញ្ចូលរួចហើយ", "0", false);
             return;
         }
     }
     dgvMd.Rows.Add(txtId.Text, cboMd.SelectedValue, GlobalMethod.getCboData(cboMd, "md_name"), txtDes.Text, "Active");
     if (dgvMd.Rows.Count > 0)
     {
         StoreProcedure.spd_insert_patient_md(dgvMd);
     }
     GlobalMethod.getGreenRed("md_status", dgvMd, "Inactive");
 }
        private void frm_Patient_Detail_Edit_Activated(object sender, EventArgs e)
        {
            dgvMd.Rows.Clear();
            DataTable dt = this.fun_getActiveMedicalHistoryForSpecificPaientTableAdapter.GetData(int.Parse(txtId.Text));

            foreach (DataRow row in dt.Rows)
            {
                dgvMd.Rows.Add(
                    row["pat_id"].ToString(),
                    row["md_id"].ToString(),
                    row["md_name"].ToString(),
                    row["md_description"].ToString(),
                    row["md_status"].ToString()
                    );
            }
            GlobalMethod.getGreenRed("md_status", dgvMd, "Inactive");
        }
Ejemplo n.º 4
0
 private void frm_Patient_Detail_Load(object sender, EventArgs e)
 {
     try
     {
         if (GlobalVariable._Patient_id != "")
         {
             txtId.Text = GlobalVariable._Patient_id;
             RetrieveData(int.Parse(GlobalVariable._Patient_id));
             txtAppoint.Text            = Convert.ToDateTime(txtAppoint.Text).ToString("dd-MM-yyyy");
             GlobalVariable._Patient_id = "";
             GlobalMethod.getGreenRed("md_status", fun_getActiveMedicalHistoryForSpecificPaientDataGridView, "Inactive");
         }
     }
     catch (Exception t)
     {
         GlobalMethod.HandleException("frm_Patient_Detail_Load :" + t.Message);
     }
 }
Ejemplo n.º 5
0
        private void btnInactive_Click(object sender, EventArgs e)
        {
            string md_status, pat_id, md_id;

            pat_id = txtId.Text;
            md_id  = dgvMd.CurrentRow.Cells["md_id"].Value.ToString();
            if (dgvMd.CurrentRow.Cells["md_status"].Value.ToString() == "Inactive")
            {
                dgvMd.CurrentRow.Cells["md_status"].Value = "Active";
                md_status = "Active";
            }
            else
            {
                dgvMd.CurrentRow.Cells["md_status"].Value = "Inactive";
                md_status = "Inactive";
            }
            GlobalMethod.getGreenRed("md_status", dgvMd, "Inactive");
            StoreProcedure.spd_update_mdHistoryByPatID(int.Parse(pat_id), int.Parse(md_id), md_status);
        }
        private void RetrieveData(int v)
        {
            DataTable dt;

            this.fun_getPatientByIDTableAdapter.Fill(dentist_DS.fun_getPatientByID, v);
            dt = this.fun_getPatientByIDTableAdapter.GetData(v);
            string[] spl = dt.Rows[0]["pat_app_time"].ToString().Split(':');
            nudHour.Value   = Convert.ToDecimal(spl[0]);
            nudMinute.Value = Convert.ToDecimal(spl[1]);
            //this.fun_getActiveMedicalHistoryForSpecificPaientTableAdapter.Fill(dentist_DS.fun_getActiveMedicalHistoryForSpecificPaient, v);
            this.fun_getMedicalHistoryForSpecificPatientTableAdapter.Fill(dentist_DS.fun_getMedicalHistoryForSpecificPatient, v);
            dt = this.fun_getActiveMedicalHistoryForSpecificPaientTableAdapter.GetData(v);
            foreach (DataRow row in dt.Rows)
            {
                dgvMd.Rows.Add(
                    row["pat_id"].ToString(),
                    row["md_id"].ToString(),
                    row["md_name"].ToString(),
                    row["md_description"].ToString(),
                    row["md_status"].ToString()
                    );
            }
            GlobalMethod.getGreenRed("md_status", dgvMd, "Inactive");
        }