Пример #1
0
        private void setControl()
        {
            chkAll.Checked = true;
            ptt            = ic.ivfDB.pttDB.selectByPk1(pttid);
            vs             = ic.ivfDB.vsDB.selectByPk1(visitid);

            txtId.Value          = deposit.deposit_id;
            txtDepositCode.Value = deposit.deposit_code;
            txtDepositDate.Value = ic.datetoShow(deposit.deposit_date);
            txtDeposit.Value     = deposit.deposit_amount;
            txtHn.Value          = deposit.patient_hn;
            txtName.Value        = deposit.deposit_name;
            txtRemark.Value      = deposit.remark;
            if (deposit.active != null && deposit.active.Equals("1"))
            {
                chkActive.Checked = true;
            }

            txtWithDrawVisitId.Value = vs.t_visit_id;
            txtWithDrawVn.Value      = vs.visit_vn;
            txtWithDrawHn.Value      = ic.showHN(ptt.patient_hn, ptt.patient_year);
            txtWithDrawVisitId.Value = vs.t_visit_id;
            txtWithDrawPttId.Value   = vs.t_patient_id;
            txtWithDrawName.Value    = ptt.patient_name;

            ic.setC1Combo(cboPackage, deposit.pck_id);

            if (txtHn.Text.Length > 0 && txtHn.Text.Trim().IndexOf(ic.hnspareyear) > 0)
            {
                ptt           = ic.ivfDB.pttDB.selectByHn(txtHn.Text.Trim().Substring(0, txtHn.Text.Trim().IndexOf(ic.hnspareyear)));
                txtHn.Value   = ic.showHN(ptt.patient_hn, ptt.patient_year);
                txtName.Value = ptt.patient_name;

                txtWithDrawHn.Value   = ic.showHN(ptt.patient_hn, ptt.patient_year);
                txtWithDrawName.Value = ptt.patient_name;

                vs = ic.ivfDB.vsDB.selectByPk1(visitid);
                txtWithDrawVisitId.Value = vs.t_visit_id;
                txtWithDrawVn.Value      = vs.visit_vn;
            }
            if (txtId.Text.Length <= 0)
            {
                txtDepositDate.Value = DateTime.Now.ToString("yyyy-MM-dd");
            }
        }
Пример #2
0
        private void setControl(String vsid)
        {
            //vsOld = ic.ivfDB.ovsDB.selectByPk1(vsid);             //      -0020
            //pttOld = ic.ivfDB.pttOldDB.selectByPk1(vsOld.PID);      //      -0020
            //vs = ic.ivfDB.vsDB.selectByVn(vsid);              //      -0020
            vs  = ic.ivfDB.vsDB.selectByPk1(vsid);               //  +0020
            ptt = ic.ivfDB.pttDB.selectByPk1(vs.t_patient_id);

            //txtHn.Value = ptt.patient_hn;//      -0020
            txtHn.Value       = ic.showHN(ptt.patient_hn, ptt.patient_year);//  +0020
            txtVn.Value       = vs.visit_vn;
            txtPttNameE.Value = ptt.Name;
            txtPttName.Value  = ic.ivfDB.fpfDB.getList1(ptt.f_patient_prefix_id) + " " + ptt.patient_firstname + " " + ptt.patient_lastname;
            txtVnShow.Value   = ic.showVN(vs.visit_vn);

            txtDob.Value     = ic.datetoShow(ptt.patient_birthday) + " [" + ptt.AgeStringShort() + "]";
            txtAllergy.Value = ptt.allergy_description;
            txtIdOld.Value   = ptt.t_patient_id_old;
            txtVnOld.Value   = vs.visit_vn;
            txtVsId.Value    = vs.t_visit_id;
            txtPttId.Value   = ptt.t_patient_id;
            txtSex.Value     = ptt.f_sex_id.Equals("1") ? "ชาย" : "หญิง";
            txtBg.Value      = ptt.f_patient_blood_group_id.Equals("2140000005") ? "O"
                : ptt.f_patient_blood_group_id.Equals("2140000002") ? "A" : ptt.f_patient_blood_group_id.Equals("2140000003") ? "B"
                : ptt.f_patient_blood_group_id.Equals("2140000004") ? "AB" : "ไม่ระบุ";
            txtVisitHeight.Value = vs.height;
            txtVisitBW.Value     = vs.bw;
            txtVisitBP.Value     = vs.bp;
            txtVisitPulse.Value  = vs.pulse;
            chkChronic.Checked   = ptt.status_congenial.Equals("1") ? true : false;
            ic.setC1Combo(cboDoctor, vs.doctor_id);
            Patient ptt1 = new Patient();

            ptt1 = ic.ivfDB.pttDB.selectByHn(vs.patient_hn_male);
            txtNameMale.Value = ptt1.Name;
            stt.Show("<p><b>สวัสดี</b></p>คุณ " + ptt.congenital_diseases_description + "<br> กรุณา ป้อนรหัสผ่าน", chkChronic);
            txtCongenital.Value = ptt.congenital_diseases_description;
            if (!ptt.t_patient_id.Equals(""))
            {
                PatientImage pttI = new PatientImage();
                pttI        = ic.ivfDB.pttImgDB.selectByPttIDStatus4(ptt.t_patient_id);
                filenamepic = pttI.image_path;
                Thread threadA = new Thread(new ParameterizedThreadStart(ExecuteA));
                threadA.Start();
            }
            //if (!vsOld.VSID.Equals("166"))            //      -0020

            //  ต้องการ พิมพ์ sticker ย้อยหลัง
            //if (!vs.vsid.Equals("166"))               //  ต้องการ พิมพ์ sticker ย้อยหลัง
            //{                                         //  ต้องการ พิมพ์ sticker ย้อยหลัง
            //    btnPrnSticker.Enabled = false;        //  ต้องการ พิมพ์ sticker ย้อยหลัง
            //}                                         //  ต้องการ พิมพ์ sticker ย้อยหลัง

            //txtBg.Value = pttOld.b
            //txtAllergy.Value =
        }
Пример #3
0
 private void setControl()
 {
     stkr                 = ic.ivfDB.stkrDB.selectByPk(recID);
     txtId.Value          = stkr.rec_id;
     txtRecDate.Value     = ic.datetoShow(stkr.rec_date);
     txtRemark.Value      = stkr.remark;
     txtDescription.Value = stkr.description;
     txtRecDoc.Value      = stkr.rec_doc;
     setGrfStockRec(recID);
 }
Пример #4
0
        private void BtnPrint_Click(object sender, EventArgs e)
        {
            //throw new NotImplementedException();
            FrmReport frm = new FrmReport(ic);
            DataTable dt  = new DataTable();

            dt = ic.ivfDB.eggsdDB.selectByEggStiId(txtId.Text);
            dt.Columns.Add("status_abnormal", typeof(String));
            dt.Columns.Add("abnormal1", typeof(String));
            dt.Columns.Add("abnormal2", typeof(String));
            dt.Columns.Add("status_typing", typeof(String));
            dt.Columns.Add("status_typing_other", typeof(String));
            dt.Columns.Add("typing_other", typeof(String));
            dt.Columns.Add("status_infectious", typeof(String));
            dt.Columns.Add("status_add_lab", typeof(String));
            dt.Columns.Add("add_lab", typeof(String));
            dt.Columns.Add("bhcg", typeof(String));
            String date1 = "";

            foreach (DataRow row in dt.Rows)
            {
                date1                      = ic.datetoShow(row["date"].ToString());
                row["date"]                = date1.Replace("-", "/");
                row["status_abnormal"]     = chkAbnormal.Checked ? "1": "0";
                row["abnormal1"]           = txtAbnormal1.Text;
                row["abnormal2"]           = txtAbnormal2.Text;
                row["status_typing"]       = chkTyping.Checked ? "1" : "0";
                row["status_typing_other"] = chkOther.Checked ? "1" : "0";;
                row["typing_other"]        = cboOther.Text;
                row["status_infectious"]   = chkInfection.Checked ? "1" : "0";
                row["status_add_lab"]      = chkAmh.Checked ? "1" : "0";
                row["add_lab"]             = cboAmh.Text;
                row["bhcg"]                = cboBhcg.Text;
                //row["status_abnormal"] = "";
                //row["status_abnormal"] = "";
            }

            frm.setEggStiReport(dt, txtPttNameE.Text, "", txtVisitLMP.Text, txtG.Text, txtP.Text, txtA.Text, cboDoctor.Text
                                , txtOPUDate.Text, txtOPUTime.Text, txtEmbryoTranferDate.Text, txtEmbryoTranferTime.Text, txtAllergy.Text, txtVisitHeight.Text, txtVisitBP.Text, txtVisitBW.Text, txtVisitPulse.Text);
            frm.ShowDialog(this);
        }
Пример #5
0
        private void initConifg()
        {
            ptt = new Patient();
            vs  = new Visit();
            ptt = ic.ivfDB.pttDB.selectByHn(hn);
            vs  = ic.ivfDB.vsDB.selectByPk1(vsid);
            txtPttNameE.Value = name;
            txtHn.Value       = hn;
            txtDob.Value      = ptt.AgeStringShort() + " [" + ic.datetoShow(ptt.patient_birthday) + "]";
            ic.ivfDB.stfDB.setCboDoctor(cboDoctor, vs.doctor_id);
            ic.ivfDB.stfDB.setCboDoctor(cboAnes, "");

            btnFinish.Click += BtnFinish_Click;
        }
Пример #6
0
        private void setGrfQue(String search)
        {
            //grfDept.Rows.Count = 7;
            //grfQue.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))
                {
                    //dt11 = dt11.AddDays(-1);
                    date = dt11.Year + "-" + dt11.ToString("MM-dd");
                    //dt = ic.ivfDB.ovsDB.selectByDate(date);
                }
                if (chkAll.Checked)
                {
                    //dt = ic.ivfDB.ovsDB.selectByReceptionSend();      //      -0020
                    //dt = ic.ivfDB.vsDB.selectByReceptionSend();        //      +0020                else
                    //dt = ic.ivfDB.ovsDB.selectByStatusCashierFinish(cboVisitBsp.SelectedItem == null ? "" : ((ComboBoxItem)cboVisitBsp.SelectedItem).Value);      //      -0020
                    dt = ic.ivfDB.vsDB.selectByStatusCashierFinish();        //      +0020
                }
            }
            else
            {
                //grfPtt.DataSource = ic.ivfDB.vsOldDB.selectCurrentVisit(search);
            }

            grfQue.Rows.Count = 1;
            grfQue.Rows.Count = dt.Rows.Count + 1;
            grfQue.Cols.Count = 14;
            //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[colVsDate].Editor = txt;

            grfQue.Cols[colVNshow].Width        = 80;
            grfQue.Cols[colPttHn].Width         = 120;
            grfQue.Cols[colPttName].Width       = 300;
            grfQue.Cols[colVsDate].Width        = 100;
            grfQue.Cols[colVsTime].Width        = 80;
            grfQue.Cols[colVsEtime].Width       = 80;
            grfQue.Cols[colStatus].Width        = 200;
            grfQue.Cols[colStatusNurse].Width   = 50;
            grfQue.Cols[colStatusCashier].Width = 55;

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

            grfQue.Cols[colVNshow].Caption        = "VN";
            grfQue.Cols[colPttHn].Caption         = "HN";
            grfQue.Cols[colPttName].Caption       = "Name";
            grfQue.Cols[colVsDate].Caption        = "Date";
            grfQue.Cols[colVsTime].Caption        = "Time visit";
            grfQue.Cols[colVsEtime].Caption       = "Time finish";
            grfQue.Cols[colStatus].Caption        = "Status";
            grfQue.Cols[colStatusNurse].Caption   = "Nurse";
            grfQue.Cols[colStatusCashier].Caption = "Cashier";

            ContextMenu menuGw = new ContextMenu();

            //menuGw.MenuItems.Add("&receive operation", new EventHandler(ContextMenu_Apm));
            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["id"].ToString();
                grfQue[i, colVNshow]        = ic.showVN(row["VN"].ToString());
                grfQue[i, colVn]            = row["VN"].ToString();
                grfQue[i, colPttHn]         = ic.showHN(row["PIDS"].ToString(), row["patient_year"].ToString());
                grfQue[i, colPttName]       = row["PName"].ToString();
                grfQue[i, colVsDate]        = ic.datetoShow(row["VDate"]);
                grfQue[i, colVsTime]        = ic.timetoShow(row["VStartTime"].ToString());
                grfQue[i, colVsEtime]       = ic.timetoShow(row["VEndTime"].ToString());
                grfQue[i, colStatus]        = row["VName"].ToString();
                grfQue[i, colPttId]         = row["PID"].ToString();
                grfQue[i, colDtr]           = row["dtrname"].ToString();
                grfQue[i, colStatusNurse]   = row["status_nurse"].ToString();
                grfQue[i, colStatusCashier] = row["status_cashier"].ToString();
                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, colVNshow);
                    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[colVn].Visible    = false;
            grfQue.Cols[colPttId].Visible = false;

            grfQue.Cols[colVNshow].AllowEditing  = false;
            grfQue.Cols[colPttHn].AllowEditing   = false;
            grfQue.Cols[colPttName].AllowEditing = false;
            grfQue.Cols[colVsDate].AllowEditing  = false;
            grfQue.Cols[colVsTime].AllowEditing  = false;
            grfQue.Cols[colDtr].AllowEditing     = false;
            //theme1.SetTheme(grfQue, ic.theme);
        }
Пример #7
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);
        }
Пример #8
0
        private void setGrfHn(String hn)
        {
            //grfDept.Rows.Count = 7;
            //grfHn.Clear();
            DataTable dt = new DataTable();

            grfHn.DataSource = null;
            ConnectDB con = new ConnectDB(ic.iniC);

            //con.OpenConnectionEx();
            if (ic.iniC.statusAppDonor.Equals("1"))
            {
                //dt = ic.ivfDB.ovsDB.selectCurrentVisit(con.connEx);
                //dt = ic.ivfDB.ovsDB.selectCurrentVisit(con.conn);
                if (statussearchtable == StatusSearchTable.VisitSearch)
                {
                    dt = ic.ivfDB.ovsDB.selectLikeByHN(hn, ic.conn.conn);
                }
                else
                {
                    dt = ic.ivfDB.pttDB.selectBySearch1(hn);
                }
            }
            else
            {
                //if (hn.Equals(""))         //-0021
                //{         //-0021
                //    dt = ic.ivfDB.ovsDB.selectCurrentVisit(ic.conn.conn);         //-0021
                //}         //-0021
                //else         //-0021
                //{         //-0021
                //if(statusconn == StatusConnection.hostEx)         //-0021
                //{         //-0021
                //    dt = ic.ivfDB.vsDB.selectByHNEx(hn);         //-0021
                //}         //-0021
                //else         //-0021
                //{         //-0021
                //    if (statussearchtable == StatusSearchTable.VisitSearch)         //-0021
                //    {         //-0021
                //        dt = ic.ivfDB.vsDB.selectLikeByHN(hn);         //-0021
                //    }         //-0021
                //    else         //-0021
                //    {         //-0021
                dt = ic.ivfDB.pttDB.selectBySearch1(hn);         //-0021
                //    }         //-0021
                //}         //-0021
                //dt = ic.ivfDB.vsDB.selectLikeByHNSearch(hn);
                //}         //-0021
            }
            if (dt.Rows.Count <= 0)
            {
                dt = ic.ivfDB.pttDB.selectBySearch1(hn);
            }
            //con.CloseConnectionEx();
            //grfExpn.Rows.Count = dt.Rows.Count + 1;
            grfHn.Rows.Count = 1;
            grfHn.Cols.Count = 11;
            //C1TextBox txt = new C1TextBox();
            //C1ComboBox cboproce = new C1ComboBox();
            //ic.ivfDB.itmDB.setCboItem(cboproce);
            //grfHn.Cols[colCuHn].Editor = txt;
            //grfHn.Cols[colCuVn1].Editor = txt;
            //grfHn.Cols[colCuName].Editor = txt;

            grfHn.Cols[colCuHnShow].Width = 100;
            grfHn.Cols[colCuVnShow].Width = 100;
            grfHn.Cols[colCuName].Width   = 280;
            grfHn.Cols[colCuDate].Width   = 100;
            grfHn.Cols[colCuTime].Width   = 80;
            grfHn.Cols[colDept].Width     = 120;
            //grfHn.Cols[colCuTime].Width = 80;

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

            grfHn.Cols[colCuHnShow].Caption = "HN";
            grfHn.Cols[colCuVnShow].Caption = "VN";
            grfHn.Cols[colCuName].Caption   = "Name";
            grfHn.Cols[colCuDate].Caption   = "Date";
            grfHn.Cols[colCuTime].Caption   = "Time";
            grfHn.Cols[colDept].Caption     = "dept";

            Color color = ColorTranslator.FromHtml(ic.iniC.grfRowColor);

            //CellRange rg1 = grfBank.GetCellRange(1, colE, grfBank.Rows.Count, colE);
            //rg1.Style = grfBank.Styles["date"];
            //grfHn.Cols[colID].Visible = false;
            for (int i = 0; i <= dt.Rows.Count - 1; i++)
            {
                Row row = grfHn.Rows.Add();
                row[0]            = i;
                row[colCuVnShow]  = ic.showVN(dt.Rows[i]["VN"].ToString());
                row[colCuHnShow]  = ic.showHN(dt.Rows[i]["PIDS"].ToString(), dt.Rows[i]["patient_year"].ToString());
                row[colCuName]    = dt.Rows[i]["PName"].ToString();
                row[colCuDate]    = ic.datetoShow(dt.Rows[i]["VDate"].ToString());
                row[colCuTime]    = ic.timetoShow(dt.Rows[i]["VStartTime"].ToString());
                row[colDept]      = dt.Rows[i]["VName"].ToString();
                row[colDOb]       = ic.datetoShow(dt.Rows[i]["dob"].ToString());
                row[colCuPttYear] = dt.Rows[i]["patient_year"].ToString();
                row[colCuPttHn]   = dt.Rows[i]["patient_hn"].ToString();
                row[colCuVn]      = dt.Rows[i]["VN"].ToString();
            }
            grfHn.Cols[colCuHnShow].AllowEditing = false;
            grfHn.Cols[colCuVnShow].AllowEditing = false;
            grfHn.Cols[colCuName].AllowEditing   = false;
            grfHn.Cols[colCuDate].AllowEditing   = false;
            grfHn.Cols[colCuTime].AllowEditing   = false;
            grfHn.Cols[colDept].AllowEditing     = false;
            grfHn.Cols[colDOb].AllowEditing      = false;
            //grfHn.Cols[colDOb].Visible = false;
            grfHn.Cols[colCuPttYear].Visible = false;
            grfHn.Cols[colCuPttHn].Visible   = false;
            grfHn.Cols[colCuVn].Visible      = false;
        }
Пример #9
0
        private void setGrfPtt(String search)
        {
            //grfDept.Rows.Count = 7;
            //grfPtt.Clear();
            grfPtt.DataSource = null;
            grfPtt.Rows.Count = 1;
            DataTable dt = new DataTable();

            if (search.Equals(""))
            {
                String date = System.DateTime.Now.Year + "-" + System.DateTime.Now.ToString("MM-dd");
                //grfPtt.DataSource = ic.ivfDB.pttDB.selectByDate1(date);
                //grfPtt.DataSource = ic.ivfDB.pttDB.selectByDate1(date);
                if (ic.iniC.statusAppDonor.Equals("1"))
                {
                    if (chkToday.Checked)
                    {
                        grfPtt.DataSource = ic.ivfDB.pttDB.selectBySearchDate(date);
                    }
                }
                else
                {
                    if (chkToday.Checked)
                    {
                        grfPtt.DataSource = ic.ivfDB.pttDB.selectBySearchDate(date);
                    }
                }
            }
            else
            {
                grfPtt.DataSource = ic.ivfDB.pttDB.selectBySearch(search);      //      +0010
                //if (ic.iniC.statusAppDonor.Equals("1"))      //      -0010
                //{      //      -0010
                //    grfPtt.DataSource = ic.ivfDB.pttDB.selectBySearch(search);      //      -0010
                //}      //      -0010
                //else      //      -0010
                //{      //      -0010
                //    grfPtt.DataSource = ic.ivfDB.pttOldDB.selectBySearch(search);      //      -0010
                //}      //      -0010
            }

            //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);
            //grfPtt.Cols[colPttHn].Editor = txt;
            //grfPtt.Cols[colPttName].Editor = txt;
            //grfPtt.Cols[colPttRemark].Editor = txt;

            grfPtt.Cols[colPttName].Width   = 250;
            grfPtt.Cols[colPttHn].Width     = 120;
            grfPtt.Cols[colPttRemark].Width = 300;
            grfPtt.Cols[colPttDOB].Width    = 110;
            grfPtt.Cols[colPttHnOld].Width  = 110;

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

            grfPtt.Cols[colPttHn].Caption     = "HN";
            grfPtt.Cols[colPttName].Caption   = "Name";
            grfPtt.Cols[colPttRemark].Caption = "Remark";
            grfPtt.Cols[colPttDOB].Caption    = "DOB";
            grfPtt.Cols[colPttHnOld].Caption  = "HN Old";

            ContextMenu menuGw = new ContextMenu();

            menuGw.MenuItems.Add("&แก้ไข Patient", new EventHandler(ContextMenu_edit));
            grfPtt.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;
            for (int i = 1; i <= grfPtt.Rows.Count - 1; i++)
            {
                grfPtt[i, 0]         = i;
                grfPtt[i, colPttDOB] = ic.datetoShow(grfPtt[i, colPttDOB].ToString());
                if (i % 2 == 0)
                {
                    grfPtt.Rows[i].StyleNew.BackColor = color;
                }
            }
            grfPtt.Cols[colPttId].Visible = false;
            if (ic.user.status_admin.Equals("2"))
            {
                grfPtt.Cols[colStfCreate].Visible = true;
                grfPtt.Cols[colStfModi].Visible   = true;
                //grfPtt.Cols[colStfCreate].Visible = true;
                //grfPtt.Cols[colStfModi].Visible = true;
            }
            else
            {
                grfPtt.Cols[colStfCreate].Visible = false;
                grfPtt.Cols[colStfModi].Visible   = false;
                //grfPtt.Cols[colStfCreate].Visible = false;
                //grfPtt.Cols[colStfModi].Visible = false;
            }
            grfPtt.Cols[colPttHn].AllowEditing     = false;
            grfPtt.Cols[colPttName].AllowEditing   = false;
            grfPtt.Cols[colPttRemark].AllowEditing = false;
            //grfPtt.Cols[colPttHn].AllowEditing = false;
            theme1.SetTheme(grfPtt, ic.theme);
        }
Пример #10
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;
        }
Пример #11
0
        private void ContextMenu_sticker(object sender, System.EventArgs e)
        {
            String chk1 = "", name = "", id = "", vsid = "", resid = "", re3 = "";

            if (grfReq.Row < 0)
            {
                return;
            }
            id   = grfReq[grfReq.Row, colReqId] != null ? grfReq[grfReq.Row, colReqId].ToString() : "";
            vsid = grfReq[grfReq.Row, colReqVsId] != null ? grfReq[grfReq.Row, colReqVsId].ToString() : "";
            if (id.Length <= 0)
            {
                return;
            }

            SetDefaultPrinter(ic.iniC.printerSticker);
            DataTable dt = new DataTable();

            dt.Columns.Add("hn", typeof(String));
            dt.Columns.Add("name", typeof(String));
            dt.Columns.Add("age", typeof(String));
            dt.Columns.Add("vn", typeof(String));
            dt.Columns.Add("path_barcode", typeof(String));

            LabRequest lbreq = new LabRequest();

            lbreq = ic.ivfDB.lbReqDB.selectByPk1(id);
            Visit vs = new Visit();

            vs = ic.ivfDB.vsDB.selectByPk1(vsid);
            Patient ptt = new Patient();

            ptt = ic.ivfDB.pttDB.selectByPk1(vs.t_patient_id);
            Lis lis = new Lis();

            lis.lis_id   = "";
            lis.barcode  = "";
            lis.req_id   = id;
            lis.visit_vn = vs.visit_vn;

            lis.patient_name = ptt.Name;
            lis.visit_hn     = ptt.patient_hn;

            lis.visit_id          = vs.t_visit_id;
            lis.message_lis       = "";
            lis.active            = "";
            lis.remark            = "";
            lis.date_create       = "";
            lis.date_modi         = "";
            lis.date_cancel       = "";
            lis.user_create       = "";
            lis.user_modi         = "";
            lis.user_cancel       = "";
            lis.statis_lis        = "";
            lis.date_time_receive = "";
            lis.date_time_finish  = "";
            lis.lab_id            = lbreq.lab_id;
            re3 = ic.ivfDB.lisDB.insertLis(lis, ic.cStf.staff_id);
            String re = "", re1 = "", re2 = "";
            long   chk = 0, chk2 = 0;

            Lis lis1 = new Lis();

            lis1 = ic.ivfDB.lisDB.selectByPk(re3);
            DataRow row11 = dt.NewRow();

            row11["hn"]           = vs.visit_hn;
            row11["name"]         = ptt.Name;
            row11["age"]          = "Age " + ptt.AgeStringShort() + " [" + ic.datetoShow(ptt.patient_birthday) + "]";
            row11["vn"]           = lis1.barcode;
            row11["path_barcode"] = System.IO.Directory.GetCurrentDirectory() + "\\report\\" + lis1.barcode + ".jpg";
            dt.Rows.Add(row11);

            if (!Directory.Exists("report"))
            {
                Directory.CreateDirectory("report");
            }
            if (!File.Exists(System.IO.Directory.GetCurrentDirectory() + "\\report\\" + lis1.barcode + ".jpg"))
            {
                File.Delete(System.IO.Directory.GetCurrentDirectory() + "\\report\\" + lis1.barcode + ".jpg");
            }
            C1BarCode barc = new C1BarCode();

            if (ic.iniC.lisBarcode.Equals("Code_128_B"))
            {
                barc.CodeType = C1.BarCode.CodeType.Code_128_B;
            }
            else if (ic.iniC.lisBarcode.Equals("Code_128_A"))
            {
                barc.CodeType = C1.BarCode.CodeType.Code_128_A;
            }
            else if (ic.iniC.lisBarcode.Equals("Code_128_C"))
            {
                barc.CodeType = C1.BarCode.CodeType.Code_128_C;
            }
            else if (ic.iniC.lisBarcode.Equals("Code_128auto"))
            {
                barc.CodeType = C1.BarCode.CodeType.Code_128auto;
            }
            else if (ic.iniC.lisBarcode.Equals("Code_128auto"))
            {
                //barc.CodeType = C1.BarCode.CodeType.en;
            }
            else
            {
            }
            barc.Size      = new Size(100, 60);
            barc.BarHeight = 60;

            barc.Text = lis1.barcode;
            Bitmap bitm = new Bitmap(100, 40);
            //bitm = barc.Image;
            Image img = barc.Image;

            //img.Size = new Size(100, 40);
            img.Save(System.IO.Directory.GetCurrentDirectory() + "\\report\\" + lis1.barcode + ".jpg", ImageFormat.Jpeg);

            FrmReport frm = new FrmReport(ic);

            frm.setStickerPatientThemalLIS(dt);
            frm.ShowDialog(this);
        }
Пример #12
0
        private void setGrfItem(String itmid, C1FlexGrid grf)
        {
            DataTable dt  = new DataTable();
            long      chk = 0;
            String    re  = "";

            re             = ic.ivfDB.stkcDB.genStockItem(itmid);
            dt             = ic.ivfDB.stkcDB.selectAll();
            grf.Rows.Count = 1;
            grf.Rows.Count = dt.Rows.Count + 1;
            grf.Cols.Count = 9;

            grf.Cols[colItmDesc].Width   = 200;
            grf.Cols[colItmQty].Width    = 80;
            grf.Cols[colItmPrice].Width  = 120;
            grf.Cols[colItmAmt].Width    = 120;
            grf.Cols[colItmRemark].Width = 200;
            grf.Cols[colItmOnhand].Width = 80;

            grf.Cols[colItmDesc].Caption   = "Description";
            grf.Cols[colItmQty].Caption    = "QTY";
            grf.Cols[colItmPrice].Caption  = "Price";
            grf.Cols[colItmAmt].Caption    = "Amount";
            grf.Cols[colItmRemark].Caption = "Remark";
            grf.Cols[colItmOnhand].Caption = "Onhand";
            Color color = ColorTranslator.FromHtml(ic.iniC.grfRowColor);
            int   i     = 1;

            foreach (DataRow row in dt.Rows)
            {
                try
                {
                    Decimal chk1 = 0, qty = 0;
                    grf[i, 0]                   = i;
                    grf[i, colItmDesc]          = row["status_rec_draw"].ToString().Equals("1") ? "รับเข้า " : row["status_rec_draw"].ToString().Equals("2") ? "ตัดจ่าย" : row["status_rec_draw"].ToString().Equals("3") ? "ขาย" : row["status_rec_draw"].ToString().Equals("0") ? "ยกมา" : "";
                    grf[i, colItmQty]           = row["qty"].ToString();
                    grf[i, colItmPrice]         = row["price"].ToString();
                    grf[i, colItmRemark]        = row["remark"].ToString();
                    grf[i, colItmrecdrawjxpxid] = row["stock_id"].ToString();
                    grf[i, colItmDate]          = ic.datetoShow(row["rec_draw_sale_date"].ToString());
                    grf[i, colItmOnhand]        = row["onhand"].ToString();
                    //grfPkg[i, colPkgUse] = row["QTYused"].ToString();
                    //Decimal.TryParse(row["QTY"].ToString(), out qty);
                    //Decimal.TryParse(row["QTYused"].ToString(), out chk);
                    //if (chk < qty)
                    //{
                    //    grfPkg.Rows[i].StyleNew.BackColor = color;
                    //    //grfPkg.Rows[i].StyleNew.BackColor = Color.Red;
                    //}
                    //else if (chk > 0)
                    //{
                    //    grfPkg.Rows[i].StyleNew.BackColor = Color.Red;
                    //}
                    ////if (i % 2 == 0)
                    ////    grfPtt.Rows[i].StyleNew.BackColor = color;
                    i++;
                }
                catch (Exception ex)
                {
                    String err = "";
                }
            }
            CellNoteManager mgr = new CellNoteManager(grf);

            grf.Cols[colItmAmt].Visible         = false;
            grf.Cols[colItmAmt].AllowEditing    = false;
            grf.Cols[colItmRemark].AllowEditing = false;
            grf.Cols[colItmDate].AllowEditing   = false;
            grf.Cols[colOnhand].AllowEditing    = false;
            grf.Cols[colItmPrice].AllowEditing  = false;
            grf.Cols[colItmDesc].AllowEditing   = false;
        }
Пример #13
0
        private void setGrfPttDonor(String search)
        {
            //grfDept.Rows.Count = 7;
            grfPtt.Clear();
            DataTable dt = new DataTable();

            if (search.Equals(""))
            {
                //String date = System.DateTime.Now.Year + "-" + System.DateTime.Now.ToString("MM-dd");
                if (chkToday.Checked)
                {
                    dt = ic.ivfDB.vsDB.selectCurrentVisitNoVisit();
                }
                else
                {
                    dt = ic.ivfDB.vsDB.selectCurrentVisit();
                }
            }
            else
            {
                //grfPtt.DataSource = ic.ivfDB.vsOldDB.selectCurrentVisit(search);
            }

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

            //C1ComboBox cboproce = new C1ComboBox();
            //ic.ivfDB.itmDB.setCboItem(cboproce);
            grfPtt.Cols[colHn].Editor     = txt;
            grfPtt.Cols[colName].Editor   = txt;
            grfPtt.Cols[colVsDate].Editor = txt;

            grfPtt.Cols[colVN].Width      = 120;
            grfPtt.Cols[colHn].Width      = 120;
            grfPtt.Cols[colName].Width    = 300;
            grfPtt.Cols[colVsDate].Width  = 100;
            grfPtt.Cols[colVsTime].Width  = 80;
            grfPtt.Cols[colVsEtime].Width = 80;
            grfPtt.Cols[colStatus].Width  = 200;

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

            grfPtt.Cols[colVN].Caption      = "VN";
            grfPtt.Cols[colHn].Caption      = "HN";
            grfPtt.Cols[colName].Caption    = "Name";
            grfPtt.Cols[colVsDate].Caption  = "Date";
            grfPtt.Cols[colVsTime].Caption  = "Time visit";
            grfPtt.Cols[colVsEtime].Caption = "Time finish";
            grfPtt.Cols[colStatus].Caption  = "Status";

            ContextMenu menuGw = new ContextMenu();

            menuGw.MenuItems.Add("&แก้ไข Visit", new EventHandler(ContextMenu_edit_vs_donor));
            menuGw.MenuItems.Add("&แก้ไข ประวัติ", new EventHandler(ContextMenu_edit_ptt));
            grfPtt.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)
            {
                grfPtt[i, 0]          = i;
                grfPtt[i, colID]      = row["id"].ToString();
                grfPtt[i, colVN]      = row["VN"].ToString();
                grfPtt[i, colHn]      = row["PIDS"].ToString();
                grfPtt[i, colName]    = row["PName"].ToString();
                grfPtt[i, colVsDate]  = ic.datetoShow(row["VDate"]);
                grfPtt[i, colVsTime]  = row["VStartTime"].ToString();
                grfPtt[i, colVsEtime] = row["VEndTime"].ToString();
                grfPtt[i, colStatus]  = row["VName"].ToString();
                //if (i % 2 == 0)
                //    grfPtt.Rows[i].StyleNew.BackColor = color;
                i++;
            }
            //menuGw = new ContextMenu();
            //grfPtt.ContextMenu = menuGw;
            grfPtt.Cols[colID].Visible           = false;
            grfPtt.Cols[colVN].AllowEditing      = false;
            grfPtt.Cols[colHn].AllowEditing      = false;
            grfPtt.Cols[colName].AllowEditing    = false;
            grfPtt.Cols[colVsDate].AllowEditing  = false;
            grfPtt.Cols[colVsTime].AllowEditing  = false;
            grfPtt.Cols[colVsEtime].AllowEditing = false;
            grfPtt.Cols[colStatus].AllowEditing  = false;
            theme1.SetTheme(grfPtt, ic.theme);
        }
Пример #14
0
        private void setGrfOpera()
        {
            //grfDept.Rows.Count = 7;
            grfOpera.Clear();
            DataTable dt = new DataTable();

            dt = ic.ivfDB.oropDB.selectByStatusOperation();

            //grfExpn.Rows.Count = dt.Rows.Count + 1;
            grfOpera.Rows.Count = dt.Rows.Count + 1;
            grfOpera.Cols.Count = 11;

            grfOpera.Cols[colQueHn].Width      = 100;
            grfOpera.Cols[colQueName].Width    = 200;
            grfOpera.Cols[colQueOpera].Width   = 300;
            grfOpera.Cols[colQueOrDate].Width  = 100;
            grfOpera.Cols[colQueOrTime].Width  = 60;
            grfOpera.Cols[colQueSurgeon].Width = 160;
            //grfQue.Cols[colStatus].Width = 200;

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

            grfOpera.Cols[colQueHn].Caption      = "HN";
            grfOpera.Cols[colQueName].Caption    = "Patient Name";
            grfOpera.Cols[colQueOpera].Caption   = "Operation";
            grfOpera.Cols[colQueOrDate].Caption  = "OR Date";
            grfOpera.Cols[colQueOrTime].Caption  = "OR Time";
            grfOpera.Cols[colQueSurgeon].Caption = "Surgeon";
            //grfQue.Cols[colStatus].Caption = "Status";

            ContextMenu menuGw = new ContextMenu();

            //menuGw.MenuItems.Add("&receive operation", new EventHandler(ContextMenu_Apm));
            menuGw.MenuItems.Add("edit operation", new EventHandler(ContextMenu_order_edit));

            MenuItem addDevice = new MenuItem("[Form Print]");

            menuGw.MenuItems.Add(addDevice);
            addDevice.MenuItems.Add(new MenuItem("Form DF ผ่าตัด", new EventHandler(ContextMenu_order_prn_df)));
            addDevice.MenuItems.Add(new MenuItem("Form A ค่าใช้จ่าย", new EventHandler(ContextMenu_order_prn_form_a)));
            addDevice.MenuItems.Add(new MenuItem("Form B ค่าใช้จ่าย", new EventHandler(ContextMenu_orderprn_form_b)));

            grfOpera.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)
            {
                grfOpera[i, 0]             = i;
                grfOpera[i, colQueId]      = row[ic.ivfDB.oropDB.orop.or_id].ToString();
                grfOpera[i, colQueHn]      = row[ic.ivfDB.oropDB.orop.patient_hn].ToString();
                grfOpera[i, colQueName]    = row[ic.ivfDB.oropDB.orop.patient_name].ToString();
                grfOpera[i, colQueOpera]   = row["operation"].ToString();
                grfOpera[i, colQueOrDate]  = ic.datetoShow(row[ic.ivfDB.oropDB.orop.or_date].ToString());
                grfOpera[i, colQueOrTime]  = row[ic.ivfDB.oropDB.orop.or_time].ToString();
                grfOpera[i, colQueSurgeon] = row["surgeon"].ToString();
                grfOpera[i, colQueRemark]  = row["remark"].ToString();
                grfOpera[i, colQueAge]     = row["age"].ToString();
                grfOpera[i, colQueAnes]    = row["anesthesia_name"].ToString();
                if (!row[ic.ivfDB.oropDB.orop.or_req_id].ToString().Equals("0"))
                {
                    CellNote  note = new CellNote("ส่ง Lab Request Foam A");
                    CellRange rg   = grfOpera.GetCellRange(i, colQueHn);
                    rg.UserData = note;
                }
                //if (i % 2 == 0)
                //    grfPtt.Rows[i].StyleNew.BackColor = color;
                i++;
            }
            CellNoteManager mgr = new CellNoteManager(grfQue);

            grfOpera.Cols[colQueId].Visible           = false;
            grfOpera.Cols[colQueHn].AllowEditing      = false;
            grfOpera.Cols[colQueName].AllowEditing    = false;
            grfOpera.Cols[colQueOpera].AllowEditing   = false;
            grfOpera.Cols[colQueOrDate].AllowEditing  = false;
            grfOpera.Cols[colQueOrTime].AllowEditing  = false;
            grfOpera.Cols[colQueSurgeon].AllowEditing = false;
            //theme1.SetTheme(grfQue, ic.theme);
        }
Пример #15
0
        //private void clearGrf()
        //{
        //    foreach (Control con in panel3.Controls)
        //    {
        //        if (con is C1DockingTab)
        //        {
        //            foreach (Control cond in con.Controls)
        //            {
        //                if (cond is C1DockingTabPage)
        //                {
        //                    foreach (Control cong in cond.Controls)
        //                    {
        //                        if (cong is C1DockingTab)
        //                        {
        //                            foreach (Control congd in cong.Controls)
        //                            {
        //                                if (congd is C1DockingTabPage)
        //                                {
        //                                    foreach (Control congd1 in congd.Controls)
        //                                    {
        //                                        if (congd1 is C1FlexGrid)
        //                                        {
        //                                            C1FlexGrid grf1;
        //                                            grf1 = (C1FlexGrid)congd1;
        //                                            //grf1.Clear();
        //                                            grf1.Rows.Count = 0;
        //                                        }
        //                                    }
        //                                }
        //                            }
        //                        }
        //                    }
        //                }
        //            }
        //        }
        //    }
        //}

        private void setGrfVs()
        {
            //grfVs.Clear();
            grfVs.Rows.Count = 0;
            grfVs.Rows.Count = 2;
            grfVs.Cols.Count = 8;

            //C1TextBox text = new C1TextBox();
            //grfVs.Cols[colVsVsDate].Editor = text;
            //grfVs.Cols[colVsVn].Editor = text;
            //grfVs.Cols[colVsDept].Editor = text;
            //grfVs.Cols[colVsPreno].Editor = text;

            grfVs.Cols[colVsVsDate].Width = 100;
            grfVs.Cols[colVsVn].Width     = 80;
            grfVs.Cols[colVsDept].Width   = 240;
            grfVs.Cols[colVsPreno].Width  = 100;
            grfVs.Cols[colVsStatus].Width = 60;
            grfVs.ShowCursor = true;
            //grfVs.AllowMerging = C1.Win.C1FlexGrid.AllowMergingEnum.RestrictRows;
            grfVs.Cols[colVsVsDate].Caption      = "Visit Date";
            grfVs.Cols[colVsVn].Caption          = "VN";
            grfVs.Cols[colVsDept].Caption        = "แผนก";
            grfVs.Cols[colVsPreno].Caption       = "";
            grfVs.Cols[colVsPreno].Visible       = false;
            grfVs.Cols[colVsVn].Visible          = true;
            grfVs.Cols[colVsAn].Visible          = false;
            grfVs.Cols[colVsAndate].Visible      = false;
            grfVs.Rows[0].Visible                = false;
            grfVs.Cols[0].Visible                = false;
            grfVs.Cols[colVsVsDate].AllowEditing = false;
            grfVs.Cols[colVsVn].AllowEditing     = false;
            grfVs.Cols[colVsDept].AllowEditing   = false;
            grfVs.Cols[colVsPreno].AllowEditing  = false;

            DataTable dt = new DataTable();

            //MessageBox.Show("hn "+hn, "");
            //if (ic.cop.comp_name_e.IndexOf("World Wide IVF") >= 0 || ic.cop.comp_name_e.IndexOf("IVF Worldwide Co., Ltd.") >= 0)         //-0021
            //{         //-0021
            //    dt = ic.ivfDB.ovsDB.selectByHN(txtHn.Text);         //-0021
            //}         //-0021
            //else         //-0021
            //{         //-0021
            //dt = ic.ivfDB.vsDB.selectByHN(txtHn.Text);      //+0021
            dt = ic.ivfDB.vsDB.selectByHN(ptt.patient_hn);      //+0021
            //}         //-0021
            int i = 1, j = 1, row = grfVs.Rows.Count;

            //txtVN.Value = dt.Rows.Count;
            //txtName.Value = "";
            //txt.Value = "";
            foreach (DataRow row1 in dt.Rows)
            {
                Row    rowa = grfVs.Rows.Add();
                String status = "", vn = "";

                //status = row1["MNC_PAT_FLAG"] != null ? row1["MNC_PAT_FLAG"].ToString().Equals("O") ? "OPD" : "IPD" : "-";
                rowa[colVsVsDate] = ic.datetoShow(row1["VDate"]);
                //rowa[colVsVn] = vn;
                rowa[colVsStatus] = status;
                rowa[colVsVn]     = row1["VN"].ToString();
                //vn = row1["MNC_VN_NO"].ToString() + "/" + row1["MNC_VN_SEQ"].ToString() + "(" + row1["MNC_VN_SUM"].ToString() + ")" ;
                //rowa[colVsVsDate] = ic.datetoShow(row1["mnc_date"]);
                //rowa[colVsVn] = vn;
                //rowa[colVsStatus] = status;
                //rowa[colVsPreno] = row1["mnc_pre_no"].ToString();
                //rowa[colVsDept] = row1["MNC_SHIF_MEMO"].ToString();
                //rowa[colVsAn] = row1["mnc_an_no"].ToString()+"/"+ row1["mnc_an_yr"].ToString();
                //rowa[colVsAndate] = ic.datetoShow(row1["mnc_ad_date"].ToString());
            }
            //ContextMenu menuGw = new ContextMenu();
            //menuGw.MenuItems.Add("&ยกเลิก รูปภาพนี้", new EventHandler(ContextMenu_Void));
            //menuGw.MenuItems.Add("&Update ข้อมูล", new EventHandler(ContextMenu_Update));
            //foreach (DocGroupScan dgs in bc.bcDB.dgsDB.lDgs)
            //{
            //    menuGw.MenuItems.Add("&เลือกประเภทเอกสาร และUpload Image [" + dgs.doc_group_name + "]", new EventHandler(ContextMenu_upload));
            //}
            //grfVs.ContextMenu = menuGw;
            grfVs.Cols[colVsVsDate].AllowEditing = false;
            grfVs.Cols[colVsVn].AllowEditing     = false;
            grfVs.Cols[colVsStatus].AllowEditing = false;
            //grfVs.Cols[colImagePath].Visible = false;
            //row1[colVSE2] = row[ic.ivfDB.pApmDB.pApm.e2].ToString().Equals("1") ? imgCorr : imgTran;
            //grfVs.AutoSizeCols();
            //grfVs.AutoSizeRows();
            //grfVs.Refresh();
            //theme1.SetTheme(grfVs, "ExpressionDark");
        }
Пример #16
0
        private void setGrfPttHn()
        {
            //grfDept.Rows.Count = 7;
            grfPtt.Clear();
            grfPtt.DataSource = null;
            grfPtt.Cols.Count = 8;
            grfPtt.Rows.Count = 1;
            try
            {
                String   startDate = "", endDate = "";
                DateTime dtStart = new DateTime();
                DateTime dtEnd   = new DateTime();
                dtStart = (DateTime)txtStartDate.Value;
                dtEnd   = (DateTime)txtEndDate.Value;
                DataTable dt = new DataTable();
                startDate = dtStart.Year + "-" + dtStart.ToString("MM-dd");
                endDate   = dtEnd.Year + "-" + dtEnd.ToString("MM-dd");
                dt        = ic.ivfDB.oJpxDB.selectByDate(startDate, endDate, txtSearch.Text);
                //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);
                grfPtt.Cols[colVN].Editor     = txt;
                grfPtt.Cols[colHn].Editor     = txt;
                grfPtt.Cols[colName].Editor   = txt;
                grfPtt.Cols[colVsDate].Editor = txt;
                grfPtt.Cols[colStatus].Editor = txt;

                grfPtt.Cols[colVN].Width            = 120;
                grfPtt.Cols[colHn].Width            = 120;
                grfPtt.Cols[colName].Width          = 300;
                grfPtt.Cols[colVsDate].Width        = 120;
                grfPtt.Cols[colStatus].Width        = 50;
                grfPtt.Cols[colStatusNurse].Width   = 50;
                grfPtt.Cols[colStatusCashier].Width = 55;

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

                grfPtt.Cols[colVN].Caption            = "VN";
                grfPtt.Cols[colHn].Caption            = "HN";
                grfPtt.Cols[colName].Caption          = "Name";
                grfPtt.Cols[colVsDate].Caption        = "Date";
                grfPtt.Cols[colStatus].Caption        = "Status";
                grfPtt.Cols[colStatusNurse].Caption   = "Nurse";
                grfPtt.Cols[colStatusCashier].Caption = "Cashier";

                menuGw = new ContextMenu();
                menuGw.MenuItems.Add("&พิมพ์ Sticker", new EventHandler(ContextMenu_edit));
                grfPtt.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)
                {
                    Row row1 = grfPtt.Rows.Add();
                    row1[0]                = i;
                    row1[colVN]            = row["VN"].ToString();
                    row1[colHn]            = row["PIDS"].ToString();
                    row1[colName]          = row["name"].ToString();
                    row1[colVsDate]        = ic.datetoShow(row["Date"].ToString());
                    row1[colStatus]        = row["Status"].ToString();
                    row1[colStatusNurse]   = row["status_nurse"] != null ? row["status_nurse"].ToString() : "";
                    row1[colStatusCashier] = row["status_cashier"] != null ? row["status_cashier"].ToString() : "";
                    if (i % 2 == 0)
                    {
                        grfPtt.Rows[i].StyleNew.BackColor = color;
                    }
                    i++;
                }
                //grfPtt.Cols[colVN].Visible = false;
                theme1.SetTheme(grfPtt, ic.theme);
            }
            catch (Exception ex)
            {
                MessageBox.Show("" + ex.Message, "Error");
            }
        }
Пример #17
0
        private void setGrfQue(String search)
        {
            //grfDept.Rows.Count = 7;
            //grfStk.Clear();
            grfStk.Rows.Count = 1;
            DataTable dt = new DataTable();

            dt = ic.ivfDB.stkrDB.selectByYearId(cboYear.Text.Trim());

            //grfExpn.Rows.Count = dt.Rows.Count + 1;
            grfStk.Rows.Count = dt.Rows.Count + 1;
            grfStk.Cols.Count = 7;

            grfStk.Cols[colRecDoc].Width    = 120;
            grfStk.Cols[colRecDate].Width   = 120;
            grfStk.Cols[colRecRemark].Width = 300;
            grfStk.Cols[colRecStatus].Width = 300;
            grfStk.Cols[colRecDesc].Width   = 300;

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

            grfStk.Cols[colRecDoc].Caption    = "Doc";
            grfStk.Cols[colRecDate].Caption   = "Date";
            grfStk.Cols[colRecRemark].Caption = "Remark";
            grfStk.Cols[colRecStatus].Caption = "Status";
            grfStk.Cols[colRecDesc].Caption   = "Decription";

            ContextMenu menuGw = new ContextMenu();

            //menuGw.MenuItems.Add("&receive operation", new EventHandler(ContextMenu_Apm));

            grfStk.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)
            {
                try
                {
                    grfStk[i, 0]            = i;
                    grfStk[i, colRecId]     = row["rec_id"].ToString();
                    grfStk[i, colRecDoc]    = row["rec_doc"].ToString();
                    grfStk[i, colRecDate]   = ic.datetoShow(row["rec_date"].ToString());
                    grfStk[i, colRecRemark] = row["remark"].ToString();
                    grfStk[i, colRecStatus] = row["status_stock"].ToString().Equals("1") ? "add receive" : row["status_stock"].ToString().Equals("2") ? "gen stock" : "";
                    grfStk[i, colRecDesc]   = row["description"].ToString();

                    //if (i % 2 == 0)
                    //    grfPtt.Rows[i].StyleNew.BackColor = color;
                    i++;
                }
                catch (Exception ex)
                {
                    new LogWriter("e", "FrmNurseView SetGrfQue " + ex.Message + " InnerException " + ex.InnerException);
                }
            }
            CellNoteManager mgr = new CellNoteManager(grfStk);

            //grfStk.Cols[colID].Visible = false;

            grfStk.Cols[colRecDoc].AllowEditing    = false;
            grfStk.Cols[colRecDate].AllowEditing   = false;
            grfStk.Cols[colRecRemark].AllowEditing = false;
            grfStk.Cols[colRecStatus].AllowEditing = false;
            grfStk.Cols[colRecDesc].AllowEditing   = false;

            //theme1.SetTheme(grfQue, ic.theme);
        }