Beispiel #1
0
 private void btn_Reg_Pat_Save_Click(object sender, EventArgs e)
 {
     try
     {
         byte[] imgByte = null;
         if (!GlobalMethod.FormValidate(this))
         {
             return;
         }
         if (!MyMSB.Show("តើអ្នកពិតជាចង់រក្សាទុកមែនទេ?", "1", true))
         {
             return;
         }
         if (imgLoc != null)
         {
             imgByte = GlobalMethod.GetImageByte(imgLoc);
         }
         StoreProcedure.spd_update_patientByID(
             int.Parse(txtId.Text),
             txtKhFname.Text,
             txtKhLname.Text,
             txtFname.Text,
             txtLname.Text,
             txtGender.Text,
             nudDob.Value.ToString(),
             txtJob.Text,
             txtAddress.Text,
             imgByte,
             dtpAppoint.Value.ToString("yyyy-MM-dd"),
             txtNati.Text,
             txtTel.Text,
             string.Format("{0}:{1}", nudHour.Value.ToString(), nudMinute.Value.ToString())
             );
         if (dgvMd.Rows.Count > 0)
         {
             StoreProcedure.spd_insert_patient_md(dgvMd);
         }
         GlobalVariable._Patient_id = txtId.Text;
         if (MyMSB.Show("ការកែរប្រែបានជោគជ័យ", "1", false))
         {
             btn_Reg_Pat_Cancel.PerformClick();
         }
         ;
     }
     catch (Exception t)
     {
         GlobalMethod.HandleException("frm_Patient_Detail_Edit / btn_Reg_Pat_Save_Click : " + 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 btn_Reg_Pat_Save_Click(object sender, EventArgs e)
        {
            if (!GlobalMethod.FormValidate(this) || IsPassValidated())
            {
                return;
            }
            if (!MyMSB.Show("តើអ្នកពិតជាចង់រក្សាទុកមែនទេ?", "1", true))
            {
                return;
            }


            byte[] imgBinary = GlobalMethod.GetImageByte(imgLoc);
            StoreProcedure.spd_insert_patient(
                txtKhFname.Text,
                txtKhLname.Text,
                txtFname.Text,
                txtLname.Text,
                cboGender.Text,
                nudDob.Value.ToString(),
                txtJob.Text,
                txtAddress.Text,
                imgBinary,
                dtpAppoint.Value.ToString("yyyy-MM-dd"),
                txtNati.Text,
                txtTel.Text,
                string.Format("{0}:{1}", nudHour.Value.ToString(), nudMinute.Value.ToString())
                );
            if (dgvMd.Rows.Count > 0)
            {
                StoreProcedure.spd_insert_patient_md(dgvMd);
            }
            GlobalVariable._Patient_id = txtId.Text;


            MyMSB.Show("ការរក្សាទុកបានជោគជ័យ", "1", true);
            this.Close();
            Thread th = new Thread(openPatient);

            th.SetApartmentState(ApartmentState.STA);
            th.Start();
        }