Ejemplo n.º 1
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.º 2
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);
        }
Ejemplo n.º 3
0
        private void setGrfFinish(String search)
        {
            //grfDept.Rows.Count = 7;
            //grfFinish.Clear();
            DataTable dt = new DataTable();
            //if (search.Equals(""))        //-0020
            //{        //-0020
            String date = System.DateTime.Now.Year + "-" + System.DateTime.Now.ToString("MM-dd");

            //dt = ic.ivfDB.ovsDB.selectByStatusNurseFinish(ic.datetoDB(txtDateStart.Text));        //-0020
            dt = ic.ivfDB.vsDB.selectByStatusPhamacyFinish(date);           //+0020
            //}        //-0020
            //else        //-0020
            //{        //-0020
            //    //grfPtt.DataSource = ic.ivfDB.vsOldDB.selectCurrentVisit(search);
            //    if (txtDateStart.Text.Equals(""))        //-0020
            //    {        //-0020
            //        dt = ic.ivfDB.ovsDB.selectByStatusNurseFinishLike(search);        //-0020
            //    }        //-0020
            //}        //-0020

            grfFinish.Rows.Count = 1;
            grfFinish.Rows.Count = dt.Rows.Count + 1;
            grfFinish.Cols.Count = 14;
            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  = 80;
            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]  = ic.showVN(row["VN"].ToString());
                grfFinish[i, colPttHn]   = ic.showHN(row["PIDS"].ToString(), row["patient_year"].ToString());
                grfFinish[i, colPttName] = row["PName"].ToString();
                grfFinish[i, colVsDate]  = ic.datetoShow(row["VDate"]);
                grfFinish[i, colVsTime]  = ic.timetoShow(row["VStartTime"].ToString());
                grfFinish[i, colVsEtime] = ic.timetoShow(row["VEndTime"].ToString());
                grfFinish[i, colStatus]  = row["VName"].ToString();
                grfFinish[i, colPttId]   = row["PID"].ToString();
                grfFinish[i, colVn]      = row["VN"].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[colVn].Visible            = false;
            grfFinish.Cols[colDtr].Visible           = false;
            grfFinish.Cols[colStatusNurse].Visible   = false;
            grfFinish.Cols[colStatusCashier].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;
            //theme1.SetTheme(grfFinish, ic.theme);
        }
Ejemplo n.º 4
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);
        }
Ejemplo n.º 5
0
        private void setGrfSearch(String search)
        {
            //grfDept.Rows.Count = 7;
            tC.SelectedTab = tabSearch;
            grfSearch.Clear();
            DataTable dt1 = new DataTable();
            DataTable dt  = new DataTable();

            dt = ic.ivfDB.ovsDB.selectByHNLike(search);
            //grfPtt.DataSource = ic.ivfDB.vsOldDB.selectCurrentVisit(search);


            //grfExpn.Rows.Count = dt.Rows.Count + 1;
            grfSearch.Rows.Count = dt.Rows.Count + 1;
            grfSearch.Cols.Count = 11;
            //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();

            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(); //vn
                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]  = row["VStartTime"].ToString();
                grfSearch[i, colVsEtime] = row["VEndTime"].ToString();
                grfSearch[i, colStatus]  = row["VName"].ToString();
                grfSearch[i, colPttId]   = row["PID"].ToString();
                grfSearch[i, colVn]      = row["VN"].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;
            //theme1.SetTheme(grfQue, ic.theme);
        }
Ejemplo n.º 6
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.º 7
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;
        }