Ejemplo n.º 1
0
 private void GridOtherAddress_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     if (GridOtherAddress.CurrentRow != null)
     {
         DataGridViewRow  dr = GridOtherAddress.CurrentRow;
         tmp_patient_regi pr = (tmp_patient_regi)TmpPatientRegisBindingSource.Current;
         pr.other_tumbon   = dr.Cells[2].Value.ToString();
         pr.other_amphur   = dr.Cells[1].Value.ToString();
         pr.other_province = dr.Cells[0].Value.ToString();
         if (pr.other_zip_code == null || pr.other_zip_code == "")
         {
             pr.other_zip_code = dr.Cells[3].Value.ToString();
         }
         GridOtherAddress.Visible = false;
     }
 }
Ejemplo n.º 2
0
 private void GridDoctorName_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e)
 {
     try
     {
         var selectedItems = GridDoctorName.CurrentRow;
         tmp_patient_regi objcurrenttpr = (tmp_patient_regi)TmpPatientRegisBindingSource.Current;
         if (RDRequestDoctorInDepart.Checked == true)
         {
             objcurrenttpr.req_doc_code = selectedItems.Cells[1].Value.ToString();
             objcurrenttpr.req_doc_name = selectedItems.Cells[0].Value.ToString();
         }
         else
         {
             objcurrenttpr.req_doc_code = selectedItems.Cells[3].Value.ToString();
             objcurrenttpr.req_doc_name = selectedItems.Cells[4].Value.ToString();
         }
     }
     catch (Exception)
     {
     }
     GridDoctorName.Visible = false;
 }
Ejemplo n.º 3
0
        public void LoadData()
        {
            try
            {
                this.SetComboBoxControl();
                DateTime Datenow = Program.GetServerDateTime();

                //เช็คว่า HN นี้มีอยู่หรือไม่
                var objpatientlist = (from t1 in dbc.tmp_patient_regis
                                      where t1.hn_no == this.HNno &&
                                      t1.status == 'N'
                                      orderby t1.id descending
                                      select t1).FirstOrDefault();
                if (objpatientlist != null)
                {
                    this.TmpPatientRegisBindingSource.DataSource   = objpatientlist;
                    this.tmpoutdepartmentsBindingSource.DataSource = objpatientlist.tmp_out_departments;
                    tmp_patient_regi objregis = (tmp_patient_regi)TmpPatientRegisBindingSource.Current;
                    Program.SetValueRadioGroup(GBPatienttype, objregis.patient_type);

                    Program.SetValueRadioGroup(GBRequestPEBefore, objregis.req_pe_bef_chkup);
                    Program.SetValueRadioGroup(GBRequestPE, objregis.req_doctor);

                    if (objregis.req_doctor != 'N')
                    {
                        Program.SetValueRadioGroup(GBDoctorGender, objregis.req_doc_gender);
                        Program.SetValueRadioGroup(GBRequestDoctor, objregis.req_inorout_doctor);
                    }
                    Program.SetValueRadioGroup(GBAviationType, objregis.aviation_type);
                    Program.SetValueRadioGroup(GBPEType, objregis.pe_type);
                    Program.SetValueRadioGroup(GBNPOTime, objregis.npo_time);
                    Program.SetValueRadioGroup(GBBook, objregis.send_book);

                    var objdataaviation = (from t1 in dbc.mst_aviation_categories
                                           where t1.mac_id == objregis.mac_id
                                           select new { Code = t1.mac_id, Name = t1.mac_ename }).FirstOrDefault();
                    if (objdataaviation != null)
                    {
                        CBAviationCategory.SelectedValue = objdataaviation.Code;
                    }
                    else
                    {
                        CBAviationCategory.SelectedIndex = 0;
                    }

                    var objdataCBHealthCheckUPProgram = (from t1 in dbc.mst_health_checkups
                                                         where t1.mhc_id == objregis.mhc_id
                                                         select new { Code = t1.mhc_id, Name = t1.mhc_ename }).FirstOrDefault();
                    if (objdataCBHealthCheckUPProgram != null)
                    {
                        CBHealthCheckUPProgram.SelectedValue = objdataCBHealthCheckUPProgram.Code;
                    }
                    else
                    {
                        CBHealthCheckUPProgram.SelectedIndex = 0;
                    }

                    //CBDoctorCategory
                    var objdataCBDoctorCategory = (from t1 in dbc.mst_doc_categories
                                                   where t1.mdc_id == objregis.mdc_id
                                                   select new { Code = t1.mdc_id, Name = t1.mdc_ename }).FirstOrDefault();
                    if (objdataCBDoctorCategory != null)
                    {
                        CBDoctorCategory.SelectedValue = objdataCBDoctorCategory.Code;
                    }
                    else
                    {
                        CBDoctorCategory.SelectedIndex = 0;
                    }

                    ////Added.Akkaradech on 2013-12-24Program.Tmp_GetPtarrived.papmi_no
                    //var objpatient = (from t in dbc.trn_patients where t.tpt_hn_no == HNno select t).FirstOrDefault();
                    var objpatient = (from t in dbc.tmp_patient_regis where t.hn_no == HNno select t).FirstOrDefault();
                    if (objpatient != null)
                    {
                        if (objpatient.vip_hpc == true)
                        {
                            chkviphpc.Checked = true;
                        }
                        if (objpatient.vip_hpc == false)
                        {
                            chkviphpc.Checked = false;
                        }
                    }
                    ////EndAdded.Akkaradech on 2013-12-24
                }
                else
                {
                    isAddnew = true;
                    this.TmpPatientRegisBindingSource.DataSource = (from t1 in dbc.tmp_patient_regis select t1).Take(0);
                    this.TmpPatientRegisBindingSource.AddNew();
                    tmp_patient_regi tmb = (tmp_patient_regi)TmpPatientRegisBindingSource.Current;
                    this.tmpoutdepartmentsBindingSource.DataSource = tmb.tmp_out_departments;
                    // เช็คว่า HN
                    tmb.hn_no        = HNno;
                    tmb.appoint_date = AppointDate;
                    tmb.status       = 'N';//U=Use,N=No use
                }
            }
            catch (Exception ex)
            {
                Program.MessageError(this.Name, "LoadData", ex, false);
            }
        }