Ejemplo n.º 1
0
 private void setOrRequest()
 {
     orreq.or_req_id            = txtID.Text;
     orreq.or_req_code          = ic.ivfDB.copDB.genReqDoc();
     orreq.or_req_date          = ic.datetoDB(txtReqDate.Text);
     orreq.patient_hn           = txtHn.Text;
     orreq.patient_name         = txtPttNameE.Text;
     orreq.remark               = cboDiag.Text;
     orreq.date_create          = "";
     orreq.date_modi            = "";
     orreq.date_cancel          = "";
     orreq.user_create          = "";
     orreq.user_modi            = "";
     orreq.user_cancel          = "";
     orreq.active               = "";
     orreq.doctor_anesthesia_id = "";
     orreq.doctor_surgical_id   = "";
     orreq.or_date              = ic.datetoDB(txtOrDate.Text);
     orreq.or_time              = txtOrTime.Text;
     orreq.status_or            = "1";
     orreq.b_service_point_id   = cboVisitBsp.SelectedItem == null ? "" : ((ComboBoxItem)cboVisitBsp.SelectedItem).Value;;
     orreq.or_id              = "";
     orreq.opera_id           = txtDiagId.Text;
     orreq.t_patient_id       = txtPttId.Text;
     orreq.status_urgent      = chkUrgent.Checked ? "1" : "2";
     orreq.anesthesia_id      = txtAnesId.Text;
     orreq.doctor_surgical_id = txtDtrId.Text;
 }
Ejemplo n.º 2
0
 private void setWithDraw()
 {
     dwithdraw.active          = "1";
     dwithdraw.deposit_id      = txtId.Text.Trim();
     dwithdraw.withdraw_id     = txtWithDrawId.Text.Trim();
     dwithdraw.withdraw_name   = txtWithDrawName.Text.Trim();
     dwithdraw.withdraw_code   = txtWithDrawCode.Text.Trim();
     dwithdraw.withdraw_date   = ic.datetoDB(txtWithDrawDate.Text);
     dwithdraw.patient_hn      = txtHn.Text.Trim();
     dwithdraw.remark          = txtWithDrawRemark.Text.Trim();
     dwithdraw.withdraw_amount = txtWithDrawAmount.Text;
     dwithdraw.visit_vn        = txtWithDrawVn.Text;
     dwithdraw.t_visit_id      = txtWithDrawVisitId.Text;
     dwithdraw.t_patient_id    = txtWithDrawPttId.Text.Trim();
 }
Ejemplo n.º 3
0
 private void setLabRequest()
 {
     lbReq.req_id      = txtID.Text;
     lbReq.req_code    = ic.ivfDB.copDB.genReqDoc();
     lbReq.req_date    = ic.datetoDB(txtReqDate.Text);
     lbReq.hn_male     = "";
     lbReq.name_male   = "";
     lbReq.hn_female   = txtHn.Text;
     lbReq.name_female = txtName.Text;
     lbReq.status_req  = "1";
     lbReq.accept_date = "";
     lbReq.start_date  = "";
     lbReq.result_date = "";
     lbReq.visit_id    = "";
     lbReq.vn          = txtVn.Text;
     lbReq.active      = "1";
     lbReq.remark      = txtRemark.Text;
     lbReq.date_create = "";
     lbReq.date_modi   = "";
     lbReq.date_cancel = "";
     lbReq.user_create = "";
     lbReq.user_modi   = "";
     lbReq.user_cancel = "";
     lbReq.item_id     = cboLabReq.SelectedItem != null ? ((ComboBoxItem)(cboLabReq.SelectedItem)).Value : "";
     lbReq.doctor_id   = cboDoctor.SelectedItem != null ? ((ComboBoxItem)(cboDoctor.SelectedItem)).Value : "";
 }
Ejemplo n.º 4
0
 private void setLabPrescription()
 {
     labPresc.presc_id                 = txtID.Text;
     labPresc.opu_fet_id               = opufetid;
     labPresc.presc_date               = ic.datetoDB(txtDate.Text);
     labPresc.visit_hn                 = hn;
     labPresc.pkg_id                   = cboPkg.SelectedItem == null ? "" : ((ComboBoxItem)cboPkg.SelectedItem).Value;
     labPresc.status_embryo_freezing   = chkEmbryoFreezing.Checked ? "1" : "0";
     labPresc.embryo_freezing          = txtEmbryoFreezing.Text.Trim();
     labPresc.embryo_straws            = txtEmbryoStraws.Text.Trim();
     labPresc.embryo_straws_extra      = txtEmbryoStrawsExtra.Text.Trim();
     labPresc.status_ngs               = chkNGS.Checked ? "1" : "0";
     labPresc.embryo_ngs               = txtNGSEmbryo.Text.Trim();
     labPresc.embryo_ngs_extra         = txtNGSExtra.Text.Trim();
     labPresc.status_pgs               = chkPGS.Checked ? "1" : "0";
     labPresc.embryo_pgs               = txtPGSEmbryo.Text.Trim();
     labPresc.embryo_pgs_extra         = txtPGSExtra.Text.Trim();
     labPresc.status_day6              = chkDay6.Checked ? "1" : "0";
     labPresc.status_assisted_hatching = chkAssistedHatching.Checked ? "1" : "0";
     labPresc.status_ha                = chkHA.Checked ? "1" : "0";
     labPresc.status_sperm_selection   = chkSpermSelection.Checked ? "1" : "0";
     labPresc.sperm_selection          = txtSpermSelection.Text.Trim();
     labPresc.status_sperm_precaution  = chkSpermPrecaution.Checked ? "1" : "0";
     labPresc.sperm_precaution         = txtSpermPrecaution.Text.Trim();
     labPresc.status_embryo_glue       = chkEmbryoGlue.Checked ? "1" : "0";
     labPresc.status_embryo_remaining  = chkEmbryoRemaining.Checked ? "1" : "0";
     labPresc.embryo_remaining         = txtEmbryoRemaining.Text.Trim();
     labPresc.status_discard_all       = chkDiscardAll.Checked ? "1" : "0";
     labPresc.staff_id                 = cboStfId.SelectedItem == null ? "" : ((ComboBoxItem)cboStfId.SelectedItem).Value;
     labPresc.checkby_id               = cboChkId.SelectedItem == null ? "" : ((ComboBoxItem)cboChkId.SelectedItem).Value;
 }
Ejemplo n.º 5
0
        private void setVisit()
        {
            vs                        = new Visit();
            vs                        = ic.ivfDB.vsDB.setVisit1(vs);
            vs.t_visit_id             = txtID.Text;
            vs.visit_hn               = txtHn.Text;
            vs.t_patient_id           = txtPttId.Text;
            vs.b_service_point_id     = cboBsp.SelectedItem == null ? "" : ((ComboBoxItem)cboBsp.SelectedItem).Value;
            vs.visit_notice           = txtComment.Text;
            vs.visit_begin_visit_time = DateTime.Now.Year.ToString() + "-" + DateTime.Now.ToString("MM-dd hh:mm:ss");
            vs.visit_vn               = ic.ivfDB.copDB.genVNDoc();
            vs.remark                 = txtRemark.Text;
            vs.f_visit_status_id      = "1";
            vs.visit_record_staff     = txtStfConfirmID.Text;

            vs.f_visit_type_id = ic.iniC.statusAppDonor.Equals("1") ? "2" : "1";
            vs.status_urge     = chkUrge.Checked ? "1" : "0";
            vs.patient_hn_1    = txtHnFemale.Text;
            vs.lmp             = ic.datetoDB(txtLMP.Text);
            vs.height          = txtHeight.Text;

            vs.bw              = txtBW.Text;
            vs.bp              = txtBP.Text;
            vs.queue_id        = ic.ivfDB.copDB.genQueueDoc();
            vs.pulse           = txtPulse.Text;
            vs.status_nurse    = "1";
            vs.patient_hn_male = txtHnMale.Text;
        }
Ejemplo n.º 6
0
        private void setLabFormDay1()
        {
            lFormDay1.form_day1_id = txtID.Text;
            //txtLabFormACode.Value = lFormA.form_a_code;
            lFormDay1.t_patient_id = txtPttId.Text;
            lFormDay1.t_visit_id   = txtVsId.Text;
            //txtVnOld.Value = lFormDay1.vn_old;
            //txtHnOld.Value = lFormDay1.hn_old;
            lFormDay1.hn_female      = txtHnFeMale.Text;
            lFormDay1.name_female    = txtNameFeMale.Text;
            lFormDay1.name_male      = txtNameMale.Text;
            lFormDay1.hn_male        = txtHnMale.Text;
            lFormDay1.dob_female     = ic.datetoDB(txtDobFeMale.Text);
            lFormDay1.dob_male       = ic.datetoDB(txtDobMale.Text);
            lFormDay1.form_day1_code = txtFormDay1Code.Text.Trim().Equals("") ? ic.ivfDB.copDB.genFormADay1Doc() : txtFormDay1Code.Text.Trim();
            lFormDay1.day1_date      = ic.datetoDB(txtFormDay1Date.Text);
            //ic.setC1Combo(cboDoctor, lFormDay1.doctor_id);

            //txtFertili2Pn.Value = opu.fertili_2_pn;
            lFormDay1.fertili_2_pn = txtFertili2Pn.Text;
            //ic.setC1Combo(cboDoctor, lFormDay1.doctor_id);
            //lFormDay1.form_day1_code = txtLabFormACode.Text;
            lFormDay1.status_no_biopsy = chkNoBiopsy.Checked ? "1" : "2";
            //lFormDay1.status_no_biopsy = chkBiopsy.Checked ? "2" : "1";
            lFormDay1.status_biopsy_pgs = chkPgsMin.Checked ? "1" : "0";
            //lFormDay1.status_biopsy_pgs = chkPgsMin.Checked ? "1" : "0";
            lFormDay1.status_biopsy_ngs         = chkNgs.Checked ? "1" : "0";
            lFormDay1.status_biopsy_ngs_7_pair  = chkNgs7Pair.Checked ? "1" : "0";
            lFormDay1.status_biopsy_ngs_23_pair = chkNgs23Pair.Checked ? "1" : "0";
            lFormDay1.biopsy_ngs_min            = txtNgsMin.Text;
            lFormDay1.biopsy_ngs_max            = txtNgsMax.Text;
            lFormDay1.embryo_freezing_day       = chkEmbryoFreezingDay.Checked ? "1" : "0";
            //ic.setC1Combo(cboEmbryoFreezingDay, lFormDay1.embryo_freezing_day);
            lFormDay1.embryo_freezing_day               = cboEmbryoFreezingDay.SelectedItem == null ? "" : ((ComboBoxItem)cboEmbryoFreezingDay.SelectedItem).Value;
            lFormDay1.embryo_freezing_day_max           = txtEmbryoFreezingEmbryoMax.Text;
            lFormDay1.status_stage_blastocyst           = chkBlastocyst.Checked ? "1" : "0";
            lFormDay1.status_stage_morula               = chkMorula.Checked ? "1" : "0";
            lFormDay1.status_embryo_tranfer             = chkEmbryoTransferFresh.Checked ? "1": "0";
            lFormDay1.status_embryo_tranfer_embryo_glue = chkEmbryoGlue.Checked ? "1" : "0";
            lFormDay1.status_embryo_tranfer_day         = chkEmbryoTransferFreshDay3.Checked ? "3" : "5";
            //chkEmbryoTransferFreshDay5.Checked = lFormDay1.status_embryo_tranfer_day.Equals("5") ? true : false;
            lFormDay1.status_discard_all = chkDiscard.Checked ? "1" : "0";

            lFormDay1.remark = cboRemark.Text;
        }
Ejemplo n.º 7
0
 private void setStockDrug()
 {
     stkr.rec_id       = txtId.Text.Trim();
     stkr.rec_doc      = txtRecDoc.Text.Trim();;
     stkr.inv_ex       = "";
     stkr.description  = txtDescription.Text.Trim();
     stkr.rec_date     = ic.datetoDB(txtRecDate.Text);
     stkr.inv_ex_date  = "";
     stkr.comp_id      = "";
     stkr.vend_id      = "";
     stkr.active       = "";
     stkr.remark       = txtRemark.Text.Trim();
     stkr.date_create  = "";
     stkr.date_modi    = "";
     stkr.date_cancel  = "";
     stkr.user_create  = "";
     stkr.user_modi    = "";
     stkr.user_cancel  = "";
     stkr.branch_id    = "";
     stkr.status_stock = "";
     stkr.stock_sub_id = cboStkSubName.SelectedItem == null ? "" : ((ComboBoxItem)cboStkSubName.SelectedItem).Value;
 }
Ejemplo n.º 8
0
        private void BtnConvertApm_Click(object sender, EventArgs e)
        {
            //throw new NotImplementedException();
            ConnectDB connS;

            pB1.Show();
            pB1.Minimum = 0;
            connS       = new ConnectDB(ic.iniC);
            connS.conn.ConnectionString = "Server=" + txtShost.Text + ";Database=" + txtSdatabase.Text + ";Uid=" + txtSuser.Text + ";Pwd=" + txtSpassword.Text +
                                          ";port = " + txtSport.Text + "; Connection Timeout = 300;default command timeout=0; CharSet=utf8;SslMode=none;";

            DataTable dtPtt = new DataTable();
            String    sql   = "";

            sql = "Select * " +
                  "From t_patient ";
            dtPtt = connS.selectData(connS.conn, sql);
            DataTable dtVs = new DataTable();

            sql = "Select * " +
                  "From t_patient ";
            dtVs = connS.selectData(connS.conn, sql);

            DataTable dtApm = new DataTable();

            sql = "Select ID, PID, PIDS, AppTime, DATE_FORMAT(AppDate, '%Y-%m-%d') as AppDate, Doctor, Status, PatientName, MobilePhoneNo, PName, PSurname,  HormoneTest, TVS, OPU, OPUTime, OPURemark, ET_FET, ET_FET_Time, BetaHCG, Other, OtherRemark, Comment  " +
                  "From Appointment ";
            //sql = "Select ID, PID, PIDS, AppTime, Doctor, Status, PatientName, MobilePhoneNo, PName, PSurname,  HormoneTest, TVS, OPU, OPUTime, OPURemark, ET_FET, ET_FET_Time, BetaHCG, Other, OtherRemark, Comment  " +
            //    "From Appointment ";
            dtApm = connS.selectData(connS.conn, sql);

            if (dtApm.Rows.Count > 0)
            {
                pB1.Maximum = dtApm.Rows.Count + 1;
                //sql = "Delete From t_patient Where status_convert = '1' ";
                //connS.ExecuteNonQuery(ic.conn.conn, sql);
                foreach (DataRow row in dtApm.Rows)
                {
                    String time = "", pttid = "", dtr = "";
                    time = "0" + row["AppTime"].ToString();
                    if (time.Length >= 5)
                    {
                        time = time.Substring(time.Length - 5);
                    }

                    DataRow[] resPtt = dtPtt.Select("patient_hn = '" + row["PIDS"].ToString() + "'");
                    if (resPtt.Length > 0)
                    {
                        try
                        {
                            pttid = resPtt[0]["PIDS"].ToString();
                        }
                        catch (Exception ex)
                        {
                        }
                    }
                    //DataRow[] resVs = dtVs.Select("PIDS = '" + row["PIDS"].ToString() + "'");
                    //if (resPtt.Length > 0)
                    //{
                    //    pttid = resPtt[0]["PIDS"].ToString();
                    //}
                    //Patient ptt = new Patient();
                    //ptt = ic.ivfDB.pttDB.selectByHn(row["PIDS"].ToString());

                    PatientAppointment pApm = new PatientAppointment();
                    pApm.t_patient_appointment_id   = "";
                    pApm.t_patient_id               = pttid;
                    pApm.patient_appoint_date_time  = ic.datetoDB(row["AppDate"].ToString());
                    pApm.patient_appointment_date   = ic.datetoDB(row["AppDate"].ToString());
                    pApm.patient_appointment_time   = time;
                    pApm.patient_appointment        = row["Comment"].ToString();
                    pApm.patient_appointment_doctor = row["Doctor"].ToString().Trim().Equals("DR. Thitikorn") ? "1" : row["Doctor"].ToString().Trim().Equals("DR. Thitikorn Wanichkul") ? "1" :
                                                      row["Doctor"].ToString().Trim().Equals("Thitikorn") ? "1" : row["Doctor"].ToString().Trim().Equals("DR. Wisut") ? "2" : row["Doctor"].ToString().Trim().Equals("DR. Visut Suvithayasiri") ? "2" :
                                                      row["Doctor"].ToString().Trim().Equals("DR. Sakchai") ? "5" : row["Doctor"].ToString().Trim().Equals("DR. Niwat") ? "3" : row["Doctor"].ToString().Trim().Equals("DR. Niwar") ? "3" : "0";
                    pApm.patient_appointment_servicepoint = "2120000002";
                    pApm.patient_appointment_notice       = row["Comment"].ToString();
                    pApm.t_visit_id             = "";
                    pApm.patient_appointment_vn = "";
                    pApm.remark       = row["OtherRemark"].ToString();
                    pApm.opu_remark   = row["OPURemark"].ToString();
                    pApm.opu_time     = row["OPUTime"].ToString();
                    pApm.opu          = row["OPU"].ToString();
                    pApm.hormone_test = row["HormoneTest"].ToString();
                    pApm.tvs          = row["TVS"].ToString();
                    //pApm.et = row["HormoneTest"].ToString();
                    pApm.fet             = row["ET_FET"].ToString();
                    pApm.fet_time        = row["ET_FET_Time"].ToString();
                    pApm.beta_hgc        = row["BetaHCG"].ToString();
                    pApm.other           = row["Other"].ToString();
                    pApm.other_remark    = row["OtherRemark"].ToString();
                    pApm.status_convert  = "1";
                    pApm.active          = row["Status"].ToString().Equals("1") ? "1" : "3";
                    pApm.patient_hn_papm = row["PIDS"].ToString();
                    ic.ivfDB.pApmDB.insertPatientAppointment(pApm, "");

                    pB1.Value++;
                }
            }
            pB1.Hide();
        }
Ejemplo n.º 9
0
        private void setGrfSearch(String search)
        {
            //grfDept.Rows.Count = 7;
            tC.SelectedTab = tabSearch;
            //grfSearch.Clear();
            DataTable dt1 = new DataTable();
            DataTable dt  = new DataTable();

            if (search.Equals(""))
            {
                String   date = "";
                DateTime dt11 = new DateTime();
                if (DateTime.TryParse(txtDateStart.Text, out dt11))
                {
                    date = dt11.Year + "-" + dt11.ToString("MM-dd");
                    dt   = ic.ivfDB.ovsDB.selectByHnFormA(date);
                }
            }
            else
            {
                dt = ic.ivfDB.ovsDB.selectByHNLike(search);
                dt = ic.ivfDB.vsDB.selectByStatusCashierSearch(txtSearch.Text, ic.datetoDB(txtDateStart.Text));        //+0020
                //grfPtt.DataSource = ic.ivfDB.vsOldDB.selectCurrentVisit(search);
            }

            grfSearch.Rows.Count = 1;
            grfSearch.Rows.Count = dt.Rows.Count + 1;
            grfSearch.Cols.Count = 10;
            //C1TextBox txt = new C1TextBox();
            //C1ComboBox cboproce = new C1ComboBox();
            //ic.ivfDB.itmDB.setCboItem(cboproce);
            //grfSearch.Cols[colPttHn].Editor = txt;
            //grfSearch.Cols[colPttName].Editor = txt;
            //grfSearch.Cols[colVsDate].Editor = txt;

            grfSearch.Cols[colVNshow].Width  = 120;
            grfSearch.Cols[colPttHn].Width   = 120;
            grfSearch.Cols[colPttName].Width = 300;
            grfSearch.Cols[colVsDate].Width  = 100;
            grfSearch.Cols[colVsTime].Width  = 80;
            grfSearch.Cols[colVsEtime].Width = 80;
            grfSearch.Cols[colStatus].Width  = 200;

            grfSearch.ShowCursor = true;
            //grdFlex.Cols[colID].Caption = "no";
            //grfDept.Cols[colCode].Caption = "รหัส";

            grfSearch.Cols[colVNshow].Caption  = "VN";
            grfSearch.Cols[colPttHn].Caption   = "HN";
            grfSearch.Cols[colPttName].Caption = "Name";
            grfSearch.Cols[colVsDate].Caption  = "Date";
            grfSearch.Cols[colVsTime].Caption  = "Time visit";
            grfSearch.Cols[colVsEtime].Caption = "Time finish";
            grfSearch.Cols[colStatus].Caption  = "Status";

            ContextMenu menuGw = new ContextMenu();

            //menuGw.MenuItems.Add("&No Appointment Close Operation", new EventHandler(ContextMenu_NO_Apm_Ptt));
            grfSearch.ContextMenu = menuGw;

            Color color = ColorTranslator.FromHtml(ic.iniC.grfRowColor);
            //CellRange rg1 = grfBank.GetCellRange(1, colE, grfBank.Rows.Count, colE);
            //rg1.Style = grfBank.Styles["date"];
            //grfCu.Cols[colID].Visible = false;
            int i = 1;

            foreach (DataRow row in dt.Rows)
            {
                grfSearch[i, 0]          = i;
                grfSearch[i, colID]      = row["id"].ToString();
                grfSearch[i, colVNshow]  = row["VN"].ToString();
                grfSearch[i, colPttHn]   = row["PIDS"].ToString();
                grfSearch[i, colPttName] = row["PName"].ToString();
                grfSearch[i, colVsDate]  = ic.datetoShow(row["VDate"]);
                grfSearch[i, colVsTime]  = ic.timetoShow(row["VStartTime"].ToString());
                grfSearch[i, colVsEtime] = ic.timetoShow(row["VEndTime"].ToString());
                grfSearch[i, colStatus]  = row["VName"].ToString();
                grfSearch[i, colPttId]   = row["PID"].ToString();
                if (!row[ic.ivfDB.ovsDB.vsold.form_a_id].ToString().Equals("0"))
                {
                    CellNote  note = new CellNote("ส่ง Lab Request Foam A");
                    CellRange rg   = grfSearch.GetCellRange(i, colVNshow);
                    rg.UserData = note;
                }
                //if (i % 2 == 0)
                //    grfPtt.Rows[i].StyleNew.BackColor = color;
                i++;
            }
            CellNoteManager mgr = new CellNoteManager(grfSearch);

            grfSearch.Cols[colID].Visible = false;

            grfSearch.Cols[colVNshow].AllowEditing  = false;
            grfSearch.Cols[colPttHn].AllowEditing   = false;
            grfSearch.Cols[colPttName].AllowEditing = false;
            grfSearch.Cols[colVsDate].AllowEditing  = false;
            grfSearch.Cols[colVsTime].AllowEditing  = false;
            grfSearch.Cols[colVsEtime].AllowEditing = false;
            grfSearch.Cols[colStatus].AllowEditing  = false;
            grfSearch.Cols[colPttId].AllowEditing   = false;
            //theme1.SetTheme(grfQue, ic.theme);
        }
Ejemplo n.º 10
0
        private void setGrfFinish(String search)
        {
            //grfDept.Rows.Count = 7;
            grfFinish.Clear();
            DataTable dt = new DataTable();

            if (search.Equals(""))
            {
                //String date = System.DateTime.Now.Year + "-" + System.DateTime.Now.ToString("MM-dd");
                dt = ic.ivfDB.ovsDB.selectByStatusNurseFinish(ic.datetoDB(txtDateStart.Text));
            }
            else
            {
                //grfPtt.DataSource = ic.ivfDB.vsOldDB.selectCurrentVisit(search);
                if (txtDateStart.Text.Equals(""))
                {
                    dt = ic.ivfDB.ovsDB.selectByStatusNurseFinishLike(search);
                }
            }

            //grfExpn.Rows.Count = dt.Rows.Count + 1;
            grfFinish.Rows.Count = dt.Rows.Count + 1;
            grfFinish.Cols.Count = 10;
            C1TextBox txt = new C1TextBox();

            //C1ComboBox cboproce = new C1ComboBox();
            //ic.ivfDB.itmDB.setCboItem(cboproce);
            grfFinish.Cols[colPttHn].Editor   = txt;
            grfFinish.Cols[colPttName].Editor = txt;
            grfFinish.Cols[colVsDate].Editor  = txt;

            grfFinish.Cols[colVNshow].Width  = 120;
            grfFinish.Cols[colPttHn].Width   = 120;
            grfFinish.Cols[colPttName].Width = 300;
            grfFinish.Cols[colVsDate].Width  = 100;
            grfFinish.Cols[colVsTime].Width  = 80;
            grfFinish.Cols[colVsEtime].Width = 80;
            grfFinish.Cols[colStatus].Width  = 200;

            grfFinish.ShowCursor = true;
            //grdFlex.Cols[colID].Caption = "no";
            //grfDept.Cols[colCode].Caption = "รหัส";

            grfFinish.Cols[colVNshow].Caption  = "VN";
            grfFinish.Cols[colPttHn].Caption   = "HN";
            grfFinish.Cols[colPttName].Caption = "Name";
            grfFinish.Cols[colVsDate].Caption  = "Date";
            grfFinish.Cols[colVsTime].Caption  = "Time visit";
            grfFinish.Cols[colVsEtime].Caption = "Time finish";
            grfFinish.Cols[colStatus].Caption  = "Status";

            ContextMenu menuGw = new ContextMenu();

            grfFinish.ContextMenu = menuGw;

            Color color = ColorTranslator.FromHtml(ic.iniC.grfRowColor);
            //CellRange rg1 = grfBank.GetCellRange(1, colE, grfBank.Rows.Count, colE);
            //rg1.Style = grfBank.Styles["date"];
            //grfCu.Cols[colID].Visible = false;
            int i = 1;

            foreach (DataRow row in dt.Rows)
            {
                grfFinish[i, 0]          = i;
                grfFinish[i, colID]      = row["id"].ToString();
                grfFinish[i, colVNshow]  = row["VN"].ToString();
                grfFinish[i, colPttHn]   = row["PIDS"].ToString();
                grfFinish[i, colPttName] = row["PName"].ToString();
                grfFinish[i, colVsDate]  = ic.datetoShow(row["VDate"]);
                grfFinish[i, colVsTime]  = row["VStartTime"].ToString();
                grfFinish[i, colVsEtime] = row["VEndTime"].ToString();
                grfFinish[i, colStatus]  = row["VName"].ToString();
                grfFinish[i, colPttId]   = row["PID"].ToString();
                if (!row[ic.ivfDB.ovsDB.vsold.form_a_id].ToString().Equals("0"))
                {
                    CellNote  note = new CellNote("ส่ง Lab Request Foam A");
                    CellRange rg   = grfFinish.GetCellRange(i, colVNshow);
                    rg.UserData = note;
                }
                //if (i % 2 == 0)
                //    grfPtt.Rows[i].StyleNew.BackColor = color;
                i++;
            }
            CellNoteManager mgr = new CellNoteManager(grfFinish);

            grfFinish.Cols[colID].Visible           = false;
            grfFinish.Cols[colPttId].Visible        = false;
            grfFinish.Cols[colVNshow].AllowEditing  = false;
            grfFinish.Cols[colPttHn].AllowEditing   = false;
            grfFinish.Cols[colPttName].AllowEditing = false;
            grfFinish.Cols[colVsDate].AllowEditing  = false;
            grfFinish.Cols[colVsTime].AllowEditing  = false;
            grfFinish.Cols[colVsEtime].AllowEditing = false;
            grfFinish.Cols[colStatus].AllowEditing  = false;
            grfFinish.Cols[colPttId].AllowEditing   = false;
            //theme1.SetTheme(grfFinish, ic.theme);
        }
Ejemplo n.º 11
0
        private void setGrfQue()
        {
            //grfDept.Rows.Count = 7;
            grfQue.Clear();
            DataTable dt1 = new DataTable();
            DataTable dt  = new DataTable();

            dt = ic.ivfDB.lFormaDB.selectReportByDate(ic.datetoDB(txtDateStart.Text), ic.datetoDB(txtDateEnd.Text), txtSearch.Text.Trim());
            //if (search.Equals(""))
            //{
            //    String date = "";
            //    DateTime dt11 = new DateTime();
            //    if (DateTime.TryParse(txtDateStart.Text, out dt11))
            //    {
            //        date = dt11.Year + "-" + dt11.ToString("MM-dd");
            //        dt = ic.ivfDB.vsOldDB.selectByDate(date);
            //    }
            //}
            //else
            //{
            //    //grfPtt.DataSource = ic.ivfDB.vsOldDB.selectCurrentVisit(search);
            //}

            //grfExpn.Rows.Count = dt.Rows.Count + 1;
            grfQue.Rows.Count = dt.Rows.Count + 1;
            grfQue.Cols.Count = 10;
            //C1TextBox txt = new C1TextBox();
            //C1ComboBox cboproce = new C1ComboBox();
            //ic.ivfDB.itmDB.setCboItem(cboproce);
            //grfQue.Cols[colPttHn].Editor = txt;
            //grfQue.Cols[colPttName].Editor = txt;
            //grfQue.Cols[colFormADate].Editor = txt;

            grfQue.Cols[colCode].Width      = 100;
            grfQue.Cols[colPttHn].Width     = 100;
            grfQue.Cols[colPttName].Width   = 250;
            grfQue.Cols[colFormADate].Width = 100;
            grfQue.Cols[colHnMale].Width    = 100;
            grfQue.Cols[colNameMale].Width  = 250;
            grfQue.Cols[colDtrName].Width   = 200;

            grfQue.ShowCursor = true;
            //grdFlex.Cols[colID].Caption = "no";
            //grfDept.Cols[colCode].Caption = "รหัส";

            grfQue.Cols[colCode].Caption      = "DOC";
            grfQue.Cols[colPttHn].Caption     = "HN";
            grfQue.Cols[colPttName].Caption   = "Name";
            grfQue.Cols[colFormADate].Caption = "Date";
            grfQue.Cols[colHnMale].Caption    = "HN Male";
            grfQue.Cols[colNameMale].Caption  = "Name Male";
            grfQue.Cols[colDtrName].Caption   = "Doctor ";

            ContextMenu menuGw = new ContextMenu();

            //menuGw.MenuItems.Add("&receive operation", new EventHandler(ContextMenu_Apm));
            //menuGw.MenuItems.Add("&receive operation", new EventHandler(ContextMenu_Apm));
            menuGw.MenuItems.Add("LAB request FORM A", new EventHandler(ContextMenu_LAB_req_formA_Ptt));
            menuGw.MenuItems.Add("LAB Form Day1", new EventHandler(ContextMenu_Form_day1));
            //menuGw.MenuItems.Add("&Cancel Receive", new EventHandler(ContextMenu_Apm_Ptt));
            //menuGw.MenuItems.Add("&No Appointment Close Operation", new EventHandler(ContextMenu_NO_Apm_Ptt));
            //grfQue.ContextMenu = menuGw;

            Color color = ColorTranslator.FromHtml(ic.iniC.grfRowColor);
            //CellRange rg1 = grfBank.GetCellRange(1, colE, grfBank.Rows.Count, colE);
            //rg1.Style = grfBank.Styles["date"];
            //grfCu.Cols[colID].Visible = false;
            int i = 1;

            foreach (DataRow row in dt.Rows)
            {
                grfQue[i, 0]            = i;
                grfQue[i, colID]        = row["form_a_id"].ToString();
                grfQue[i, colCode]      = row["form_a_code"].ToString();
                grfQue[i, colPttHn]     = row["hn_female"].ToString();
                grfQue[i, colPttName]   = row["name_female"].ToString();
                grfQue[i, colFormADate] = ic.datetoShow(row["form_a_date"]);
                grfQue[i, colHnMale]    = row["hn_male"].ToString();
                grfQue[i, colNameMale]  = row["name_male"].ToString();
                grfQue[i, colDtrName]   = row["doctor_name"].ToString();
                grfQue[i, colPttId]     = "";
                if (!row[ic.ivfDB.ovsDB.vsold.form_a_id].ToString().Equals("0"))
                {
                    CellNote  note = new CellNote("ส่ง Lab Request Foam A");
                    CellRange rg   = grfQue.GetCellRange(i, colCode);
                    rg.UserData = note;
                }
                //if (i % 2 == 0)
                //    grfPtt.Rows[i].StyleNew.BackColor = color;
                i++;
            }
            CellNoteManager mgr = new CellNoteManager(grfQue);

            grfQue.Cols[colID].Visible    = false;
            grfQue.Cols[colPttId].Visible = false;
            grfQue.SelectionMode          = SelectionModeEnum.Row;
            //theme1.SetTheme(grfQue, ic.theme);
        }
Ejemplo n.º 12
0
        private void BtnGenEggSti_Click(object sender, EventArgs e)
        {
            //throw new NotImplementedException();
            String   lmpdate  = "";
            DateTime lmpdate1 = new DateTime();

            lmpdate = ic.datetoDB(txtVisitLMP.Text);
            if (!DateTime.TryParse(lmpdate, out lmpdate1))
            {
                MessageBox.Show("วันที่ LMP Date ไม่ถูกต้อง ", "");
                return;
            }
            if (MessageBox.Show("ต้องการ Day Egg Sti  \nวันที่ LMP Date " + txtVisitLMP.Text, "", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2) == DialogResult.OK)
            {
                setEggSti();
                ic.cStf.staff_id = "";
                FrmPasswordConfirm frm = new FrmPasswordConfirm(ic);
                frm.ShowDialog(this);
                if (!ic.cStf.staff_id.Equals(""))
                {
                    int    chk = 0;
                    String re  = ic.ivfDB.eggsDB.insertEggSti(eggs, ic.cStf.staff_id);
                    if (int.TryParse(re, out chk))
                    {
                        txtId.Value = re;
                        lmpdate     = ic.datetoDB(txtVisitLMP.Text);
                        if (DateTime.TryParse(lmpdate, out lmpdate1))
                        {
                            for (int i = 1; i <= 17; i++)
                            {
                                if (i != 1)
                                {
                                    lmpdate1 = lmpdate1.AddDays(1);
                                }
                                EggStiDay eggsd = new EggStiDay();
                                eggsd.egg_sti_day_id = "";
                                eggsd.egg_sti_id     = re;
                                eggsd.day1           = i.ToString();
                                eggsd.date           = ic.datetoDB(lmpdate1.Year.ToString() + "-" + lmpdate1.ToString("MM-dd"));
                                eggsd.e2             = "";
                                eggsd.lh             = "";
                                eggsd.active         = "";
                                eggsd.remark         = "";
                                eggsd.fsh            = "";
                                eggsd.date_create    = "";
                                eggsd.date_modi      = "";
                                eggsd.date_cancel    = "";
                                eggsd.user_create    = "";
                                eggsd.user_modi      = "";
                                eggsd.user_cancel    = "";
                                eggsd.prolactin      = "";
                                eggsd.rt_ovary_1     = "";
                                eggsd.rt_ovary_2     = "";
                                eggsd.lt_ovary_1     = "";
                                eggsd.lt_ovary_2     = "";
                                eggsd.endo           = "";
                                eggsd.medication     = "";
                                ic.ivfDB.eggsdDB.insertEggStiDay(eggsd, ic.cStf.staff_id);
                            }
                        }
                        setControlEggSti();
                    }
                }
            }
        }
Ejemplo n.º 13
0
        private void BtnDel_Click(object sender, EventArgs e)
        {
            //throw new NotImplementedException();

            if (Directory.Exists(ic.iniC.pathImageScan))
            {
                if (MessageBox.Show("ต้องการ Upload ข้อมูล รูป scan ", "", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2) == DialogResult.OK)
                {
                    //DirectoryInfo dir = new DirectoryInfo(ic.iniC.pathImageScan);
                    //foreach (FileInfo fi in dir.GetFiles())
                    //{
                    //    fi.Delete();
                    //}
                    int     i = 0;
                    String  dgs = "", name = "";
                    Boolean chk = false;
                    txtVN.Hide();
                    btnVn.Hide();
                    //label3.Hide();
                    //txtAN.Hide();
                    //txtAnCnt.Hide();
                    //chkIPD.Hide();
                    label6.Hide();
                    txtVisitDate.Hide();
                    //txtAnDate.Hide();
                    //txtPreNo.Hide();
                    setVisible(false);
                    ProgressBar pB1 = new ProgressBar();
                    pB1.Location = new System.Drawing.Point(15, 15);
                    pB1.Name     = "pB1";
                    pB1.Size     = new System.Drawing.Size(862, 23);
                    //pB1.Left = txtVN.Left;
                    pB1.Show();
                    pB1.Value   = 0;
                    pB1.Minimum = 0;
                    pB1.Maximum = array1.Count;
                    groupBox1.Controls.Add(pB1);
                    Application.DoEvents();
                    foreach (String aa in array1)
                    {
                        i++;
                        pB1.Value++;
                        String[] aaa = aa.Split(',');
                        if (aaa.Length == 3)
                        {
                            name = aaa[2].Replace("*", "");
                            string ext = Path.GetExtension(name);
                            String dgssname = "", dgssid = "", vn = "", an = "";
                            dgssid = ic.ivfDB.dgssDB.getIdDgss("Document Other");
                            DocGroupSubScan dgss = new DocGroupSubScan();
                            dgss = ic.ivfDB.dgssDB.selectByPk(dgssid);
                            DocScan dsc = new DocScan();
                            dsc.active       = "1";
                            dsc.doc_scan_id  = "";
                            dsc.doc_group_id = dgss.doc_group_id;
                            //dsc.hn = txtHn.Text;          //-0021
                            //dsc.hn = txtHn.Text.Trim().Replace(ic.hnspareyear, "").Replace(txtPttYear.Text.Trim(), "");            //+0021
                            int index = txtHn.Text.IndexOf(ic.hnspareyear);
                            if (index >= 6)
                            {
                                dsc.hn = txtHn.Text.Substring(0, index);
                            }

                            dsc.vn         = txtVN.Text;
                            dsc.an         = "";
                            dsc.visit_date = ic.datetoDB(txtVisitDate.Text);
                            dsc.host_ftp   = ic.iniC.hostFTP;
                            //dsc.image_path = txtHn.Text + "//" + txtHn.Text + "_" + dgssid + "_" + dsc.row_no + "." + ext[ext.Length - 1];
                            dsc.image_path       = "";
                            dsc.doc_group_sub_id = dgssid;
                            dsc.pre_no           = "";
                            dsc.an = "";
                            DateTime dt = new DateTime();

                            //dsc.an_date = (DateTime.TryParse(txtAnDate.Text, out dt)) ? ic.datetoDB(txtAnDate.Text) : "";
                            //if (dsc.an_date.Equals("1-01-01"))
                            //{
                            dsc.an_date = "";
                            //}
                            dsc.folder_ftp = ic.iniC.folderFTP;
                            dsc.status_ipd = "O";
                            String re = ic.ivfDB.dscDB.insertDocScan(dsc, ic.userId);
                            //dsc.image_path = txtHn.Text + "//" + txtHn.Text + "_" + re + ext;
                            //if (chkIPD.Checked)
                            //{
                            //    vn = txtAN.Text.Replace("/", "_").Replace("(", "_").Replace(")", "");
                            //}
                            //else
                            //{
                            vn = txtVN.Text.Replace("/", "_").Replace("(", "_").Replace(")", "");
                            //}
                            dsc.image_path = txtHn.Text.Replace("-", "").Replace("/", "") + "_" + vn + "//" + txtHn.Text.Replace("-", "").Replace("/", "") + "_" + vn + "_" + re + ext;
                            String    re1 = ic.ivfDB.dscDB.updateImagepath(dsc.image_path, re);
                            FtpClient ftp = new FtpClient(ic.iniC.hostFTP, ic.iniC.userFTP, ic.iniC.passFTP, ic.ftpUsePassive, ic.iniC.pathChar);
                            //MessageBox.Show("111", "");
                            //ftp.createDirectory(txtHn.Text);
                            ftp.createDirectory(ic.iniC.folderFTP + "//" + txtHn.Text.Replace("-", "").Replace("/", "") + "_" + vn);
                            //MessageBox.Show("222", "");
                            ftp.delete(ic.iniC.folderFTP + "//" + dsc.image_path);
                            //MessageBox.Show("333", "");
                            ftp.upload(ic.iniC.folderFTP + "//" + dsc.image_path, name);
                            //break;
                            //Application.DoEvents();
                        }
                    }
                    pB1.Dispose();
                    txtVN.Show();
                    btnVn.Show();
                    //label3.Show();
                    //txtAN.Show();
                    //txtAnCnt.Show();
                    //chkIPD.Show();
                    label6.Show();
                    delFile();
                    grf.Dispose();
                    initGrf();
                    setGrf();
                    setImage1(true);
                    setVisible(true);
                    MessageBox.Show("Upload รูป เวชระเบียน เรียบร้อย", "");
                }
            }
        }
Ejemplo n.º 14
0
        private void setGrfSearch()
        {
            grfSearch.DataSource = null;
            //grfSearch.Clear();
            DataTable dt = new DataTable();
            String    date1 = "", date2 = "";

            date1 = ic.datetoDB(txtFiDateStart.Text);
            date2 = ic.datetoDB(txtFiDateEnd.Text);
            //dt = ic.ivfDB.lbReqDB.selectByStatusReqAccept();

            //grfExpn.Rows.Count = dt.Rows.Count + 1;
            grfSearch.Rows.Count = 1;
            grfSearch.Cols.Count = 14;
            if (txtFiDateStart.Text.Equals(""))
            {
                return;
            }
            dt = ic.ivfDB.lbresDB.selectLabBloodBySearchHn(txtSearch.Text.Trim());
            //C1TextBox txt = new C1TextBox();
            //C1ComboBox cboproce = new C1ComboBox();
            //ic.ivfDB.itmDB.setCboItem(cboproce);
            //grfReq.Cols[colRqReqNum].Editor = txt;
            //grfReq.Cols[colRqHn].Editor = txt;
            //grfReq.Cols[colRqVn].Editor = txt;
            //grfReq.Cols[colRqName].Editor = txt;

            grfSearch.Cols[colRsLabName].Width   = 200;
            grfSearch.Cols[colRsMethod].Width    = 100;
            grfSearch.Cols[colRsResult].Width    = 100;
            grfSearch.Cols[colRsInterpret].Width = 100;
            grfSearch.Cols[colRsUnit].Width      = 80;
            grfSearch.Cols[colRsNormal].Width    = 100;
            grfSearch.Cols[colRsRemark].Width    = 200;
            grfSearch.Cols[colRsHn].Width        = 100;
            grfSearch.Cols[colRsPttName].Width   = 200;
            grfSearch.Cols[colRsReqDate].Width   = 160;
            grfSearch.ShowCursor = true;
            //grdFlex.Cols[colID].Caption = "no";
            //grfDept.Cols[colCode].Caption = "รหัส";

            grfSearch.Cols[colRsLabName].Caption   = "Name";
            grfSearch.Cols[colRsReqDate].Caption   = "Request Date";
            grfSearch.Cols[colRsMethod].Caption    = "Method";
            grfSearch.Cols[colRsResult].Caption    = "Result";
            grfSearch.Cols[colRsInterpret].Caption = "Interpret";
            grfSearch.Cols[colRsUnit].Caption      = "Unit";
            grfSearch.Cols[colRsNormal].Caption    = "Normal";
            grfSearch.Cols[colRsRemark].Caption    = "Remark";
            grfSearch.Cols[colRsHn].Caption        = "HN";
            grfSearch.Cols[colRsPttName].Caption   = "Patient Name";
            Color color = ColorTranslator.FromHtml(ic.iniC.grfRowColor);
            //CellRange rg1 = grfBank.GetCellRange(1, colE, grfBank.Rows.Count, colE);
            //rg1.Style = grfBank.Styles["date"];
            //grfCu.Cols[colID].Visible = false;
            int    i   = 1;
            String chk = "";

            foreach (DataRow row in dt.Rows)
            {
                Row row1 = grfSearch.Rows.Add();
                row1[colRsId]      = row[ic.ivfDB.lbresDB.lbRes.result_id].ToString();
                row1[colRsLabName] = row[ic.ivfDB.oLabiDB.labI.LName].ToString();

                row1[colRsMethod]    = row[ic.ivfDB.lbresDB.lbRes.method].ToString();
                row1[colRsResult]    = row[ic.ivfDB.lbresDB.lbRes.result].ToString();
                row1[colRsInterpret] = row[ic.ivfDB.lbresDB.lbRes.interpret].ToString();

                row1[colRsUnit]    = row[ic.ivfDB.lbresDB.lbRes.unit].ToString();
                row1[colRsNormal]  = row[ic.ivfDB.lbresDB.lbRes.normal_value].ToString();
                row1[colRsRemark]  = row[ic.ivfDB.lbresDB.lbRes.remark].ToString();
                row1[colRsLabId]   = row[ic.ivfDB.lbresDB.lbRes.lab_id].ToString();
                row1[colRsReqId]   = row[ic.ivfDB.lbresDB.lbRes.req_id].ToString();
                row1[colRsHn]      = ic.showHN(row["patient_hn"].ToString(), row["patient_year"].ToString());
                row1[colRsPttName] = row["pname"].ToString();
                row1[colRsReqDate] = ic.datetimetoShow(row[ic.ivfDB.lbresDB.lbRes.req_date_time].ToString());
                //row1[colOPUTimeModi] = row[ic.ivfDB.lFormaDB.lformA.opu_time_modi].ToString();
                //row1[colRqLabName] = row["SName"].ToString();
                //row1[colRqHnMale] = row["hn_male"].ToString();
                //row1[colRqNameMale] = row["name_male"].ToString();
                //row1[colRqHnDonor] = row["hn_donor"].ToString();
                //row1[colRqNameDonor] = row["name_donor"].ToString();

                i++;
            }
            grfSearch.Cols[colRsId].Visible    = false;
            grfSearch.Cols[colRsLabId].Visible = false;
            grfSearch.Cols[colRsReqId].Visible = false;

            grfSearch.Cols[colRsLabName].AllowEditing   = false;
            grfSearch.Cols[colRsMethod].AllowEditing    = false;
            grfSearch.Cols[colRsResult].AllowEditing    = false;
            grfSearch.Cols[colRsInterpret].AllowEditing = false;
            grfSearch.Cols[colRsUnit].AllowEditing      = false;
            grfSearch.Cols[colRsNormal].AllowEditing    = false;
            grfSearch.Cols[colRsRemark].AllowEditing    = false;
            grfSearch.Cols[colRsHn].AllowEditing        = false;
            grfSearch.Cols[colRsPttName].AllowEditing   = false;
            //grfReq.Cols[coldt].Visible = false;
        }
Ejemplo n.º 15
0
        private void setGrfReq()
        {
            gB.Enabled        = false;
            groupBox1.Enabled = false;
            try
            {
                String   startdate = "", enddate = "";
                DateTime datestart, dateend;
                String   datestart1 = "", dateend1 = "";
                if (DateTime.TryParse(txtDateStart.Text, out datestart))
                {
                    datestart1 = datestart.ToString("yyyy-MM-dd");
                }
                else
                {
                    datestart1 = ic.datetoDB(txtDateStart.Text);
                }
                if (DateTime.TryParse(txtDateEnd.Text, out datestart))
                {
                    dateend1 = datestart.ToString("yyyy-MM-dd");
                }
                else
                {
                    dateend1 = ic.datetoDB(txtDateEnd.Text);
                }
                grfReq.Clear();
                grfReq.Cols.Count = 15;
                grfReq.Rows.Count = 1;
                DataTable dt = new DataTable();
                grfReq.DataSource = null;
                dt = ic.ivfDB.oJsDB.selectByStatusUnAccept1(datestart1, dateend1);
                //grfExpn.Rows.Count = dt.Rows.Count + 1;
                //grfCu.Rows.Count = 41;
                //grfCu.Cols.Count = 4;
                C1TextBox txt = new C1TextBox();
                //C1ComboBox cboproce = new C1ComboBox();
                //ic.ivfDB.itmDB.setCboItem(cboproce);
                grfReq.Cols[colRqReqNum].Editor  = txt;
                grfReq.Cols[colRqHn].Editor      = txt;
                grfReq.Cols[colRqVn].Editor      = txt;
                grfReq.Cols[colRqItmName].Editor = txt;

                grfReq.Cols[colRqHn].Width      = 120;
                grfReq.Cols[colRqVn].Width      = 120;
                grfReq.Cols[colRqItmName].Width = 120;
                grfReq.Cols[colRqDate].Width    = 100;
                grfReq.Cols[colPttName].Width   = 200;
                grfReq.Cols[colDtrName].Width   = 200;
                grfReq.Cols[colRqOPUdate].Width = 120;

                grfReq.ShowCursor = true;
                //grdFlex.Cols[colID].Caption = "no";
                //grfDept.Cols[colCode].Caption = "รหัส";

                grfReq.Cols[colRqReqNum].Caption  = "req number";
                grfReq.Cols[colRqHn].Caption      = "HN";
                grfReq.Cols[colRqVn].Caption      = "VN";
                grfReq.Cols[colRqItmName].Caption = "LAB Name";
                grfReq.Cols[colPttName].Caption   = "Patient Name";
                grfReq.Cols[colRqDate].Caption    = "Date";
                grfReq.Cols[colRqRemark].Caption  = "Remark";
                grfReq.Cols[colDtrId].Caption     = "Remark";
                grfReq.Cols[colDtrName].Caption   = "Doctor";
                grfReq.Cols[colRqOPUdate].Caption = "OPU Date";

                Color color = ColorTranslator.FromHtml(ic.iniC.grfRowColor);
                //CellRange rg1 = grfBank.GetCellRange(1, colE, grfBank.Rows.Count, colE);
                //rg1.Style = grfBank.Styles["date"];
                //grfCu.Cols[colID].Visible = false;
                int i = 1;
                foreach (DataRow row in dt.Rows)
                {
                    Row row1 = grfReq.Rows.Add();
                    row1[colRqId]        = row["odsd_id"].ToString();
                    row1[colRqReqNum]    = row["odsd_id"].ToString();
                    row1[colRqHn]        = row["PIDS"].ToString();
                    row1[colRqVn]        = row["VN"].ToString();
                    row1[colRqItmName]   = row["SName"].ToString();
                    row1[colPttName]     = row["pttname"].ToString();
                    row1[colRqDate]      = ic.datetoShow(row["Date"].ToString());
                    row1[colDtrId]       = row["dtrid"].ToString();
                    row1[colDtrName]     = row["dtrname"].ToString();
                    row1[colRqRemark]    = row["remark"].ToString();
                    row1[colRqStatusReq] = row["status_req_accept"].ToString();
                    row1[colRqDob]       = row["dob"].ToString();
                    row1[colRqItmCode]   = row["SID"].ToString();
                    row1[0] = i;
                    if (row["status_req_accept"].ToString().Equals("1"))
                    {
                        grfReq.Rows[i].StyleNew.BackColor = color;
                    }
                    if (row["status_wait_confirm_opu_date"].ToString().Equals("1"))
                    {
                        //grfReq.Rows[i].StyleNew.BackColor = ColorTranslator.FromHtml(ic.iniC.grfRowColor);
                        String txt1 = "";
                        txt1 = "รอ confirm วัน เวลา OPU จากทาง พยาบาล";
                        CellNote  note = new CellNote(txt1);
                        CellRange rg   = grfReq.GetCellRange(i, colRqHn);
                        rg.UserData = note;
                        grfReq.Rows[i].StyleNew.BackColor = Color.Yellow;
                    }
                    else if (row["status_wait_confirm_opu_date"].ToString().Equals("2"))
                    {
                        grfReq.Rows[i].StyleNew.BackColor = Color.Green;
                    }

                    i++;
                }
                grfReq.Cols[colRqId].Visible        = false;
                grfReq.Cols[colRqVn].Visible        = false;
                grfReq.Cols[colDtrId].Visible       = false;
                grfReq.Cols[colRqStatusReq].Visible = false;
                grfReq.Cols[colRqDob].Visible       = false;
                grfReq.Cols[colRqItmCode].Visible   = false;
                CellNoteManager mgr = new CellNoteManager(grfReq);
            }
            catch (Exception ex)
            {
                MessageBox.Show("" + ex.Message, "");
            }

            gB.Enabled        = true;
            groupBox1.Enabled = true;
        }