예제 #1
0
        private void initGrfJob()
        {
            grfImg          = new C1FlexGrid();
            grfImg.Font     = fEdit;
            grfImg.Dock     = System.Windows.Forms.DockStyle.Fill;
            grfImg.Location = new System.Drawing.Point(0, 0);

            //FilterRow fr = new FilterRow(grfExpnD);

            //grfJob.AfterRowColChange += GrfJob_AfterRowColChange;
            //grfImg.DoubleClick += GrfJob_DoubleClick;
            //grfExpnC.CellButtonClick += new C1.Win.C1FlexGrid.RowColEventHandler(this.grfDept_CellButtonClick);
            //grfExpnC.CellChanged += new C1.Win.C1FlexGrid.RowColEventHandler(this.grfDept_CellChanged);
            //grfJob.CellChanged += GrfExpnD_CellChanged;
            panel2.Controls.Add(grfImg);
            grfImg.Clear();
            grfImg.Rows.Count = 1;
            grfImg.Cols.Count = 3;

            grfImg.Cols[colPath].Width   = 300;
            grfImg.Cols[colRemark].Width = 200;

            grfImg.Cols[colPath].Caption   = "Path";
            grfImg.Cols[colRemark].Caption = "หมายเหตุ";

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

            theme1.SetTheme(grfImg, "Office2013Red");
        }
예제 #2
0
        private void setGrfDay3()
        {
            //grfDept.Rows.Count = 7;
            grfDay3.Clear();
            DataTable dt = new DataTable();

            //grfExpn.DataSource = xC.xtDB.expndDB.selectAll1(cboYear.Text);
            //grfExpn.Rows.Count = dt.Rows.Count + 1;
            grfDay3.Rows.Count = 30;
            grfDay3.Cols.Count = 4;
            C1TextBox txt = new C1TextBox();

            //txt.dat

            grfDay3.Cols[colID].Editor   = txt;
            grfDay3.Cols[colNum].Editor  = txt;
            grfDay3.Cols[colDesc].Editor = txt;

            grfDay3.Cols[colNum].Width  = 40;
            grfDay3.Cols[colDesc].Width = 150;

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

            grfDay3.Cols[colNum].Caption  = "no";
            grfDay3.Cols[colDesc].Caption = "desc";

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

            //CellRange rg1 = grfBank.GetCellRange(1, colE, grfBank.Rows.Count, colE);
            //rg1.Style = grfBank.Styles["date"];
            grfDay3.Cols[colID].Visible = false;
        }
예제 #3
0
        private void initGrfBillD()
        {
            grfBillD          = new C1FlexGrid();
            grfBillD.Font     = fEdit;
            grfBillD.Dock     = System.Windows.Forms.DockStyle.Fill;
            grfBillD.Location = new System.Drawing.Point(0, 0);

            //FilterRow fr = new FilterRow(grfExpnD);

            //grfJob.AfterRowColChange += GrfJob_AfterRowColChange;

            //grfExpnC.CellButtonClick += new C1.Win.C1FlexGrid.RowColEventHandler(this.grfDept_CellButtonClick);
            //grfExpnC.CellChanged += new C1.Win.C1FlexGrid.RowColEventHandler(this.grfDept_CellChanged);
            //grfJob.CellChanged += GrfExpnD_CellChanged;
            panelBllD.Controls.Add(grfBillD);
            grfBillD.Clear();
            grfBillD.Rows.Count             = 2;
            grfBillD.Cols.Count             = 5;
            grfBillD.Cols[colBdNameT].Width = 200;
            grfBillD.Cols[colBdAmtD].Width  = 100;
            grfBillD.Cols[colBdAmtI].Width  = 100;
            //grfBillD.Cols[colRemark].Width = 100;
            grfBillD.Cols[colBdNameT].Caption = "รายการ";
            grfBillD.Cols[colBdAmtD].Caption  = "ค่าใช้จ่าย";
            grfBillD.Cols[colBdAmtI].Caption  = "รายได้";
            //grfBillD.Cols[colRemark].Caption = "หมายเหตุ";
            grfBillD.Cols[colBdID].Visible = false;

            theme1.SetTheme(grfBillD, "VS2013Purple");
        }
예제 #4
0
        private void setGrfItem()
        {
            grfItem.Clear();
            grfItem.Rows.Count = 1;
            grfItem.Cols.Count = 4;
            DataTable dt = ic.ivfDB.itmDB.selectAll();

            grfItem.Cols[colItmName].Width = 250;
            grfItem.Cols[colItmCode].Width = 250;
            //grfItem.Cols[colVsVN].Width = 250;
            grfItem.ShowCursor = true;
            grfItem.Cols[colItmName].Caption = "Item Name";
            grfItem.Cols[colItmCode].Caption = "CODE";
            //grfItem.Cols[colVsVN].Caption = "VN";
            ContextMenu menuGw = new ContextMenu();

            //menuGw.MenuItems.Add("&แก้ไข Patient", new EventHandler(ContextMenu_edit_visit));
            grfItem.ContextMenu = menuGw;
            grfItem.Rows.Count  = dt.Rows.Count + 1;
            int i = 1;

            foreach (DataRow row in dt.Rows)
            {
                grfItem[i, colItmCode] = row[ic.ivfDB.itmDB.itm.item_code].ToString();
                grfItem[i, colItmName] = row[ic.ivfDB.itmDB.itm.item_name_e].ToString();
                grfItem[i, colItmId]   = row[ic.ivfDB.itmDB.itm.item_id].ToString();
                grfItem[i, 0]          = i;
                i++;
            }
            grfItem.Cols[colItmId].Visible        = false;
            grfItem.Cols[colItmCode].AllowEditing = false;
            grfItem.Cols[colItmName].AllowEditing = false;

            theme1.SetTheme(grfItem, ic.iniC.themeApp);
        }
예제 #5
0
        private void initGrfJob()
        {
            grfJob          = new C1FlexGrid();
            grfJob.Font     = fEdit;
            grfJob.Dock     = System.Windows.Forms.DockStyle.Fill;
            grfJob.Location = new System.Drawing.Point(0, 0);

            //FilterRow fr = new FilterRow(grfExpnD);

            //grfJob.AfterRowColChange += GrfJob_AfterRowColChange;
            grfJob.DoubleClick += GrfJob_DoubleClick;
            //grfExpnC.CellButtonClick += new C1.Win.C1FlexGrid.RowColEventHandler(this.grfDept_CellButtonClick);
            //grfExpnC.CellChanged += new C1.Win.C1FlexGrid.RowColEventHandler(this.grfDept_CellChanged);
            //grfJob.CellChanged += GrfExpnD_CellChanged;
            panelJob.Controls.Add(grfJob);
            grfJob.Clear();
            grfJob.Rows.Count              = 2;
            grfJob.Cols.Count              = 6;
            grfJob.Cols[colAmt].Width      = 80;
            grfJob.Cols[colCode].Width     = 100;
            grfJob.Cols[colDesc].Width     = 200;
            grfJob.Cols[colRemark].Width   = 100;
            grfJob.Cols[colAmt].Caption    = "ยอดเงิน";
            grfJob.Cols[colCode].Caption   = "เลขที่  job no";
            grfJob.Cols[colDesc].Caption   = "รายละเอียด";
            grfJob.Cols[colRemark].Caption = "หมายเหตุ";
            grfJob.Cols[colID].Visible     = false;

            theme1.SetTheme(grfJob, "Office2013Red");
        }
예제 #6
0
        private void setGrfCu()
        {
            //grfDept.Rows.Count = 7;
            grfCu.Clear();
            DataTable dt = new DataTable();

            grfCu.DataSource = null;
            //ConnectDB con = new ConnectDB(bc.iniC);
            //con.OpenConnectionEx();
            dt = bc.bcDB.pttDB.selectPatient(txtSearch.Text, txtSearch.Text);
            //con.CloseConnectionEx();
            //grfExpn.Rows.Count = dt.Rows.Count + 1;
            grfCu.Rows.Count = 1;
            grfCu.Cols.Count = 3;
            C1TextBox  txt      = new C1TextBox();
            C1ComboBox cboproce = new C1ComboBox();

            //ic.ivfDB.itmDB.setCboItem(cboproce);
            grfCu.Cols[colCuHn].Editor   = txt;
            grfCu.Cols[colCuName].Editor = txt;

            grfCu.Cols[colCuHn].Width   = 70;
            grfCu.Cols[colCuName].Width = 240;
            //grfCu.Cols[colCuTime].Width = 80;

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

            grfCu.Cols[colCuHn].Caption   = "HN";
            grfCu.Cols[colCuName].Caption = "Name";

            Color color = ColorTranslator.FromHtml(bc.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 = 0; i <= dt.Rows.Count - 1; i++)
            {
                Row row = grfCu.Rows.Add();
                row[0] = (i + 1);

                row[colCuHn]   = dt.Rows[i]["MNC_HN_NO"].ToString();
                row[colCuName] = dt.Rows[i]["prefix"].ToString() + " " + dt.Rows[i]["MNC_FNAME_T"].ToString() + " " + dt.Rows[i]["MNC_LNAME_T"].ToString();
                //row[colCuDate] =  bc.datetoShow(dt.Rows[i]["VDate"].ToString());
            }
            grfCu.Cols[colCuHn].AllowEditing   = false;
            grfCu.Cols[colCuName].AllowEditing = false;
            if (dt.Rows.Count == 1)
            {
                if (grfCu[1, colCuHn] != null)
                {
                    setGrfVn(grfCu[1, colCuHn].ToString());
                }
            }
        }
예제 #7
0
        private void setGrfJob(String cusid)
        {
            grfJob.DataSource = null;
            grfJob.Rows.Count = 2;
            grfJob.Clear();
            if (cusid.Equals(""))
            {
                return;
            }
            DataTable dt = new DataTable();

            dt = xC.manDB.jimDB.selectJimJblByJobYear2(cusid);
            //grfJob.DataSource = xC.xtDB.jimDB.selectJimJblByJobYear2(cusid);
            //grfJob.Cols.Count = dt.Columns.Count;
            grfJob.Rows.Count = dt.Rows.Count + 1;

            grfJob.Cols.Count = 6;
            TextBox txt = new TextBox();

            grfJob.Cols[colCode].Editor   = txt;
            grfJob.Cols[colDesc].Editor   = txt;
            grfJob.Cols[colRemark].Editor = txt;
            grfJob.Cols[colAmt].Editor    = txt;

            grfJob.Cols[colAmt].Width    = 80;
            grfJob.Cols[colCode].Width   = 100;
            grfJob.Cols[colDesc].Width   = 200;
            grfJob.Cols[colRemark].Width = 100;

            grfJob.ShowCursor = true;
            //grdFlex.Cols[colID].Caption = "no";
            //grfDept.Cols[colCode].Caption = "รหัส";
            grfJob.Cols[colAmt].Caption    = "ยอดเงิน";
            grfJob.Cols[colCode].Caption   = "เลขที่ job no";
            grfJob.Cols[colDesc].Caption   = "รายละเอียด";
            grfJob.Cols[colRemark].Caption = "หมายเหตุ";
            Color color = ColorTranslator.FromHtml(xC.iniC.grfRowColor);

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                grfJob[i + 1, 0] = i;
                if (i % 2 == 0)
                {
                    grfJob.Rows[i].StyleNew.BackColor = color;
                }
                grfJob[i + 1, colID]     = dt.Rows[i][xC.manDB.jimDB.jim.job_import_id].ToString();
                grfJob[i + 1, colCode]   = dt.Rows[i][xC.manDB.jimDB.jim.job_import_code].ToString();
                grfJob[i + 1, colDesc]   = dt.Rows[i][xC.manDB.jblDB.jbl.description].ToString();
                grfJob[i + 1, colRemark] = dt.Rows[i][xC.manDB.jimDB.jim.remark1].ToString();
                //grfJob[i + 1, colAmt] = dt.Rows[i][xC.xtDB.jimDB.jim.job_import_id].ToString();
            }
            //CellRange rg1 = grfBank.GetCellRange(1, colE, grfBank.Rows.Count, colE);
            //rg1.Style = grfBank.Styles["date"];
            grfJob.Cols[colID].Visible = false;
        }
예제 #8
0
        private void setGrfJob()
        {
            grfDtr.DataSource = null;
            grfDtr.Rows.Count = 2;
            grfDtr.Clear();
            //if (cusid.Equals("")) return;
            DataTable dt = new DataTable();

            dt = xC.accDB.dtrDB.selectDebtor();
            //grfDtr.DataSource = xC.xtDB.jimDB.selectJimJblByJobYear2(cusid);
            //grfDtr.Cols.Count = dt.Columns.Count;
            grfDtr.Rows.Count = dt.Rows.Count + 1;

            grfDtr.Cols.Count = 5;
            TextBox txt = new TextBox();

            grfDtr.Cols[colCusNameT].Editor = txt;
            grfDtr.Cols[colAmt].Editor      = txt;
            //grfDtr.Cols[colRemark].Editor = txt;
            //grfDtr.Cols[colAmt].Editor = txt;

            grfDtr.Cols[colCusNameT].Width = 200;
            grfDtr.Cols[colAmt].Width      = 100;
            //grfDtr.Cols[colDesc].Width = 200;
            //grfDtr.Cols[colRemark].Width = 100;

            grfDtr.ShowCursor = true;
            //grdFlex.Cols[colID].Caption = "no";
            //grfDept.Cols[colCode].Caption = "รหัส";
            grfDtr.Cols[colCusNameT].Caption = "ลูกหนี้";
            grfDtr.Cols[colAmt].Caption      = "ยอดหนี้";
            //grfDtr.Cols[colDesc].Caption = "รายละเอียด";
            //grfDtr.Cols[colRemark].Caption = "หมายเหตุ";
            Color color = ColorTranslator.FromHtml(xC.iniC.grfRowColor);

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                grfDtr[i + 1, 0] = i + 1;
                if (i % 2 == 0)
                {
                    grfDtr.Rows[i].StyleNew.BackColor = color;
                }
                //grfDtr[i + 1, colID] = dt.Rows[i][xC.xtDB.dtrDB.dtr.debtor_id].ToString();
                grfDtr[i + 1, colCusNameT] = dt.Rows[i][xC.iniDB.cusDB.cus.cust_name_t].ToString();
                grfDtr[i + 1, colAmt]      = dt.Rows[i][xC.accDB.dtrDB.dtr.amount].ToString();
                //grfDtr[i + 1, colRemark] = dt.Rows[i][xC.xtDB.jimDB.jim.remark1].ToString();
                //grfDtr[i + 1, colAmt] = dt.Rows[i][xC.xtDB.jimDB.jim.job_import_id].ToString();
            }
            //CellRange rg1 = grfBank.GetCellRange(1, colE, grfBank.Rows.Count, colE);
            //rg1.Style = grfBank.Styles["date"];
            grfDtr.Cols[colID].Visible = false;
        }
예제 #9
0
        private void setGrfReq()
        {
            //grfDept.Rows.Count = 7;
            grfReq.Clear();
            DataTable dt = new DataTable();

            grfReq.DataSource = ic.ivfDB.lbReqDB.selectByReq1();
            //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[colRqName].Editor   = txt;

            grfReq.Cols[colRqHn].Width   = 120;
            grfReq.Cols[colRqVn].Width   = 120;
            grfReq.Cols[colRqName].Width = 280;
            grfReq.Cols[colRqDate].Width = 100;
            //grfReq.Cols[colCuTime].Width = 80;

            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[colRqName].Caption   = "Name";
            grfReq.Cols[colRqDate].Caption   = "Date";
            grfReq.Cols[colRqRemark].Caption = "Remark";

            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 <= grfReq.Rows.Count - 1; i++)
            {
                grfReq[i, 0] = i;
            }
            grfReq.Cols[colRqId].Visible = false;
        }
예제 #10
0
        private void setGrfExpnPd(String jobid, String stfid)
        {
            grfExpnD.Clear();
            grfExpnD.Rows.Count = 1;
            DataTable dt = new DataTable();

            dt = xC.accDB.expnpdDB.selectByJobIdStfId(jobid, stfid);

            grfExpnD.Cols[colItemNameT].Width   = 200;
            grfExpnD.Cols[colPayAmt].Width      = 100;
            grfExpnD.Cols[colExpnDdesc1].Width  = 200;
            grfExpnD.Cols[colExpnDDdesc1].Width = 200;

            grfExpnD.ShowCursor = true;
            grfExpnD.Cols[colItemNameT].Caption   = "รายการ";
            grfExpnD.Cols[colPayAmt].Caption      = "จำนวนเงิน";
            grfExpnD.Cols[colExpnDdesc1].Caption  = "รายละเอียดH";
            grfExpnD.Cols[colExpnDDdesc1].Caption = "รายละเอียดD";

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

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                int chk = 0;
                Row row = grfExpnD.Rows.Add();
                row[0] = i + 1;
                if (i % 2 == 0)
                {
                    row.StyleNew.BackColor = color;
                }
                row[colId]          = dt.Rows[i][xC.accDB.expnpdDB.expnP.expenses_pay_detail_id].ToString();
                row[colItemNameT]   = dt.Rows[i][xC.accDB.expnpdDB.expnP.item_name_t].ToString();
                row[colPayAmt]      = dt.Rows[i][xC.accDB.expnpdDB.expnP.pay_amount].ToString();
                row[colExpnDdesc1]  = dt.Rows[i][xC.accDB.expnpdDB.expnP.desc_d].ToString();
                row[colExpnDDdesc1] = dt.Rows[i][xC.accDB.expnpdDB.expnP.desc_dd].ToString();
                if (int.TryParse(dt.Rows[i][xC.accDB.expnpdDB.expnP.expense_clear_cash_id].ToString(), out chk))
                {
                    if (chk > 0)
                    {
                        row.StyleNew.BackColor = Color.PeachPuff;
                    }
                }
            }
            grfExpnD.Cols[colId].Visible = false;
        }
예제 #11
0
        private void setGrfDeptH()
        {
            grfExpnD.Clear();
            //if (txtID.Text.Equals("")) return;

            grfExpnD.DataSource = xC.iniDB.itmDB.selectAll1(chkCash.Checked ? "1" : chkCheque.Checked ? "2" : chkAll.Checked ? "" : chkItmServe.Checked ? "9" : "");
            C1TextBox txt = new C1TextBox();

            txt.DataType = txtID.DataType;

            grfExpnD.Cols[colID].Editor      = txt;
            grfExpnD.Cols[colCode].Editor    = txt;
            grfExpnD.Cols[colNameT].Editor   = txt;
            grfExpnD.Cols[colPrice1].Editor  = txt;
            grfExpnD.Cols[colPrice2].Editor  = txt;
            grfExpnD.Cols[colPrice3].Editor  = txt;
            grfExpnD.Cols[colTypeSub].Editor = txt;

            grfExpnD.Cols[colCode].Width      = 80;
            grfExpnD.Cols[colNameT].Width     = 200;
            grfExpnD.Cols[colPrice1].Width    = 80;
            grfExpnD.Cols[colPrice2].Width    = 80;
            grfExpnD.Cols[colPrice3].Width    = 80;
            grfExpnD.Cols[colTypeSub].Width   = 120;
            grfExpnD.ShowCursor               = true;
            grfExpnD.Cols[colCode].Caption    = "รหัส";
            grfExpnD.Cols[colNameT].Caption   = "ชื่อ";
            grfExpnD.Cols[colPrice1].Caption  = "ราคา1";
            grfExpnD.Cols[colPrice2].Caption  = "ราคา2";
            grfExpnD.Cols[colPrice3].Caption  = "ราคา3";
            grfExpnD.Cols[colTypeSub].Caption = "ประเภทย่อย";
            Color color = ColorTranslator.FromHtml(xC.iniC.grfRowColor);

            for (int i = 1; i < grfExpnD.Rows.Count; i++)
            {
                grfExpnD[i, 0] = i;
                if (i % 2 == 0)
                {
                    grfExpnD.Rows[i].StyleNew.BackColor = color;
                }
            }
            grfExpnD.Cols[colID].Visible = false;
        }
예제 #12
0
        private void setGrfBill(String bllId)
        {
            grfBill.Clear();
            DataTable dt = new DataTable();

            dt = xC.accDB.blldDB.selectByBllId(bllId);
            //grfChequeView1.DataSource = dt;
            grfBill.Cols.Count = 6;
            grfBill.Rows.Count = dt.Rows.Count + 1;
            TextBox txt = new TextBox();

            grfBill.Cols[colItemNameT].Editor = txt;
            grfBill.Cols[colExpn].Editor      = txt;
            grfBill.Cols[colimcome].Editor    = txt;

            grfBill.Cols[colItemNameT].Width = 240;
            grfBill.Cols[colExpn].Width      = 80;
            grfBill.Cols[colimcome].Width    = 80;

            grfBill.ShowCursor = true;
            grfBill.Cols[colItemNameT].Caption = "รายการ";
            grfBill.Cols[colExpn].Caption      = "ค่าใช้จ่าย";
            grfBill.Cols[colimcome].Caption    = "รายได้";
            Color color = ColorTranslator.FromHtml(xC.iniC.grfRowColor);

            for (int i = 0; i < dt.Rows.Count - 1; i++)
            {
                grfBill[i + 1, 0] = i + 1;
                if (i % 2 == 0)
                {
                    grfBill.Rows[i + 1].StyleNew.BackColor = color;
                }
                grfBill[i + 1, colID]        = dt.Rows[i][xC.accDB.blldDB.blld.billing_detail_id].ToString();
                grfBill[i + 1, colItemNameT] = dt.Rows[i][xC.accDB.blldDB.blld.item_name_t].ToString();
                grfBill[i + 1, colExpn]      = dt.Rows[i][xC.accDB.blldDB.blld.amount_draw].ToString();
                grfBill[i + 1, colimcome]    = dt.Rows[i][xC.accDB.blldDB.blld.amount_income].ToString();
                grfBill[i + 1, colItemId]    = dt.Rows[i][xC.accDB.blldDB.blld.item_id].ToString();
            }
            grfBill.Cols[colID].Visible     = false;
            grfBill.Cols[colItemId].Visible = false;
        }
예제 #13
0
        private void setGrfEcc()
        {
            grfEcc.Clear();
            grfEcc.Rows.Count = 1;
            DataTable dt = new DataTable();

            dt = xC.accDB.eccDB.selectSumEccDocByStatusAppv(chkAppvWait.Checked ? objdb.ExpensesClearCashDB.StatusAppv.sendtoAppv : chkAppvOk.Checked ? objdb.ExpensesClearCashDB.StatusAppv.Appv : objdb.ExpensesClearCashDB.StatusAppv.All);

            grfEcc.Cols[colEccDeccdoc].Width = 100;
            grfEcc.Cols[colEccDpayamt].Width = 200;
            grfEcc.Cols[colEccRefund].Width  = 200;

            grfEcc.ShowCursor = true;
            grfEcc.Cols[colEccDeccdoc].Caption = "เลขที่เอกสาร";
            grfEcc.Cols[colEccDpayamt].Caption = "จำนวนเงิน";
            grfEcc.Cols[colEccRefund].Caption  = "จำนวนเงิน คืนเงินสด";

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

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                String eccDoc = "", amt = "";
                Row    row = grfEcc.Rows.Add();
                row[0] = i + 1;
                if (i % 2 == 0)
                {
                    grfEcc.Rows[i + 1].StyleNew.BackColor = color;
                }
                eccDoc             = xC.FixEccCode + dt.Rows[i][xC.accDB.eccDB.ecc.ecc_doc].ToString();
                row[colEccDeccdoc] = eccDoc;
                row[colEccDpayamt] = dt.Rows[i][xC.accDB.eccDB.ecc.pay_amount].ToString();
                amt = xC.accDB.erfDB.selectSumByEccDoc(eccDoc.Replace(xC.FixEccCode, ""));
                row[colEccRefund] = amt;

                //if (dt.Rows[i][xC.xtDB.eccDB.ecc.status_appv].ToString().Equals("0"))
                //{
                //    row.StyleNew.BackColor = Color.Gray;
                //}
            }
            //grfEcc.Cols[colId].Visible = false;
        }
예제 #14
0
        private void setGrf()
        {
            grf2.Clear();
            grf2.Rows.Count = 1;
            grf2.Cols.Count = 4;
            //DataTable dt = ic.ivfDB.noteDB.selectByPttId(ptt.t_patient_id);

            grf2.DataSource = dtChk;

            //grf2.Cols[colNoteId].Width = 250;
            //grf2.Cols[colNote].Width = 600;

            grf2.ShowCursor = true;

            grf2.Cols[1].Caption = "Note";

            int i = 1;

            //foreach (DataRow row in dt.Rows)
            //{
            //    grfNote[i, colNoteId] = row[ic.ivfDB.noteDB.note.note_id].ToString();
            //    grfNote[i, colNote] = row[ic.ivfDB.noteDB.note.note_1].ToString();
            //    grfNote[i, colNoteStatusAll] = row[ic.ivfDB.noteDB.note.status_all].ToString();
            //    i++;
            //}
            //grfNote.Cols[colNoteId].Visible = false;
            //grfNote.Cols[colNoteStatusAll].Visible = false;
            grf2.Cols[0].AllowEditing = false;
            grf2.Cols[1].AllowEditing = false;
            grf2.Cols[2].AllowEditing = false;
            grf2.Cols[3].AllowEditing = false;
            grf2.Cols[4].AllowEditing = false;
            grf2.Cols[5].AllowEditing = false;
            grf2.Cols[6].AllowEditing = false;
            grf2.Cols[7].AllowEditing = false;
            grf2.Cols[8].AllowEditing = false;

            theme1.SetTheme(grf2, "Office2016DarkGray");
        }
예제 #15
0
        private void setGrfImg(String[] path1)
        {
            grfImg.DataSource = null;
            grfImg.Rows.Count = 1;
            grfImg.Clear();
            if (path1 == null)
            {
                return;
            }

            //grfJob.DataSource = xC.xtDB.jimDB.selectJimJblByJobYear2(cusid);
            //grfJob.Cols.Count = dt.Columns.Count;

            grfImg.Cols.Count = 3;
            TextBox txt = new TextBox();

            grfImg.Cols[colPath].Editor = txt;

            grfImg.Cols[colPath].Width   = 300;
            grfImg.Cols[colRemark].Width = 200;

            grfImg.ShowCursor = true;
            //grdFlex.Cols[colID].Caption = "no";
            //grfDept.Cols[colCode].Caption = "รหัส";
            grfImg.Cols[colPath].Caption   = "Path";
            grfImg.Cols[colRemark].Caption = "หมายเหตุ";

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

            foreach (String path in path1)
            {
                //grfImg[i + 1, 0] = i;
                //if (i % 2 == 0)
                //    grfImg.Rows[i].StyleNew.BackColor = color;
                Row row = grfImg.Rows.Add();
                row[colPath]   = path;
                row[colRemark] = "";
            }
        }
예제 #16
0
        private void initGrfPay()
        {
            grfPay          = new C1FlexGrid();
            grfPay.Font     = fEdit;
            grfPay.Dock     = System.Windows.Forms.DockStyle.Fill;
            grfPay.Location = new System.Drawing.Point(0, 0);

            //FilterRow fr = new FilterRow(grfExpnD);

            //grfJob.AfterRowColChange += GrfJob_AfterRowColChange;
            grfPay.DoubleClick += GrfJob_DoubleClick;
            //grfExpnC.CellButtonClick += new C1.Win.C1FlexGrid.RowColEventHandler(this.grfDept_CellButtonClick);
            //grfExpnC.CellChanged += new C1.Win.C1FlexGrid.RowColEventHandler(this.grfDept_CellChanged);
            //grfJob.CellChanged += GrfExpnD_CellChanged;
            panelPay.Controls.Add(grfPay);
            grfPay.Clear();
            grfPay.Rows.Count                  = 1;
            grfPay.Cols.Count                  = 12;
            grfPay.Cols[colPdJobNo].Width      = 80;
            grfPay.Cols[colPdBillDoc].Width    = 100;
            grfPay.Cols[colPdItmNameT].Width   = 250;
            grfPay.Cols[colPdAmtE].Width       = 100;
            grfPay.Cols[colPdAmtI].Width       = 100;
            grfPay.Cols[colPdJobNo].Caption    = "job no";
            grfPay.Cols[colPdBillDoc].Caption  = "เลขที่ ใบวางบิล";
            grfPay.Cols[colPdItmNameT].Caption = "รายการ";
            grfPay.Cols[colPdAmtE].Caption     = "ค่าใช้จ่าย";
            grfPay.Cols[colPdAmtI].Caption     = "รายได้";
            grfPay.Cols[colPdID].Visible       = false;
            grfPay.Cols[colPdDbID].Visible     = false;
            grfPay.Cols[colPdJobId].Visible    = false;
            grfPay.Cols[colPdItmId].Visible    = false;
            //grfPay.Cols[colPdBlldId].Visible = false;
            //grfPay.Cols[colPdBllId].Visible = false;

            theme1.SetTheme(grfPay, "ShinyBlue");
        }
예제 #17
0
        private void setGrfErf()
        {
            Decimal eccamt = 0, chk = 0, refund = 0, paymat = 0;

            grfErf.Clear();
            grfErf.Rows.Count = 1;
            DataTable dt = new DataTable();

            dt = xC.accDB.erfDB.selectAll();

            grfErf.Cols[colDesc].Width = 200;
            grfErf.Cols[colAmt].Width  = 100;
            grfErf.Cols[colDate].Width = 200;

            grfErf.ShowCursor            = true;
            grfErf.Cols[colDesc].Caption = "รายการ";
            grfErf.Cols[colAmt].Caption  = "จำนวนเงิน";
            grfErf.Cols[colDate].Caption = "วันที่คืนเงิน";

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

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                Row row = grfErf.Rows.Add();
                row[0] = i + 1;
                if (i % 2 == 0)
                {
                    row.StyleNew.BackColor = color;
                }
                row[colId]   = dt.Rows[i][xC.accDB.erfDB.erf.expenses_refund_id].ToString();
                row[colDesc] = dt.Rows[i][xC.accDB.erfDB.erf.desc1].ToString();
                row[colAmt]  = dt.Rows[i][xC.accDB.erfDB.erf.amount].ToString();
                row[colDate] = dt.Rows[i][xC.accDB.erfDB.erf.expenses_refund_date].ToString();
            }
            grfErf.Cols[colId].Visible = false;
        }
예제 #18
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");
            }
        }
        private void setGrf()
        {
            String    datestart = "", dateend = "", hn = "", txt = "";
            DataTable dt = new DataTable();

            //MessageBox.Show("txtDateStart " + txtDateStart.Text, "");
            //MessageBox.Show("txtDateEnd " + txtDateEnd.Text, "");
            datestart = bc.datetoDB(txtDateStart.Text);
            dateend   = bc.datetoDB(txtDateEnd.Text);
            //MessageBox.Show("datestart "+ datestart, "");
            //MessageBox.Show("dateend "+ dateend, "");
            grfHn.Clear();
            grfHn.Rows.Count = 1;
            //grfQue.Rows.Count = 1;
            grfHn.Cols.Count = 8;
            grfHn.Cols[colDateReq].Caption     = "Date Req";
            grfHn.Cols[colHN].Caption          = "HN";
            grfHn.Cols[colFullName].Caption    = "Name";
            grfHn.Cols[colDateReceive].Caption = "Date Rec";
            grfHn.Cols[colReqNo].Caption       = "Req No";
            grfHn.Cols[colVN].Caption          = "VN";
            grfHn.Cols[colId].Caption          = "id";
            grfHn.Cols[colDateReq].Width       = 100;
            grfHn.Cols[colHN].Width            = 80;
            grfHn.Cols[colFullName].Width      = 300;
            grfHn.Cols[colDateReceive].Width   = 100;
            grfHn.Cols[colReqNo].Width         = 80;
            grfHn.Cols[colVN].Width            = 80;
            //MessageBox.Show("1111", "");
            if (datestart.Length <= 0 && dateend.Length <= 0 && txtHn.Text.Length <= 0)
            {
                return;
            }
            if (chkDateReq.Checked)
            {
                dt = bc.bcDB.dscDB.selectLabOutByDateReq(datestart, dateend, txtHn.Text.Trim(), "daterequest");
            }
            else if (chkDateLabOut.Checked)
            {
                dt = bc.bcDB.dscDB.selectLabOutByDateReq(datestart, dateend, txtHn.Text.Trim(), "datecreate");
            }
            else if (chkDateReqHIS.Checked)
            {
                dt = bc.bcDB.dscDB.selectLabOutByDateReq(datestart, dateend, txtHn.Text.Trim(), "datecreate");
            }
            //grfHn.Cols[colHnPrnStaffNote].Width = 60;

            //if (datestart.Length <= 0 && dateend.Length <= 0)
            //{
            //    MessageBox.Show("วันทีเริ่มต้น ไม่มีค่า", "");
            //    return;
            //}
            grfHn.ShowCursor = true;
            ContextMenu menuGw = new ContextMenu();

            grfHn.ContextMenu = menuGw;
            int i = 1;

            grfHn.Rows.Count = dt.Rows.Count + 1;
            foreach (DataRow row in dt.Rows)
            {
                try
                {
                    grfHn[i, 0]              = (i);
                    grfHn[i, colHN]          = row["hn"].ToString();
                    grfHn[i, colFullName]    = row["patient_fullname"].ToString();//row["prefix"].ToString() + " " + row["MNC_FNAME_T"].ToString() + " " + row["MNC_LNAME_T"].ToString();
                    grfHn[i, colDateReceive] = bc.datetoShow(row["date_create"].ToString());
                    grfHn[i, colDateReq]     = bc.datetoShow(row["date_req"].ToString());
                    grfHn[i, colReqNo]       = row["req_id"].ToString();
                    grfHn[i, colVN]          = row["vn"].ToString();
                    grfHn[i, colId]          = row["doc_scan_id"].ToString();
                }
                catch (Exception ex)
                {
                    new LogWriter("e", "FrmLabOutReceiveView setGrf ex " + ex.Message);
                }
                i++;
            }
            grfHn.Cols[colId].Visible               = false;
            grfHn.Cols[colHN].AllowEditing          = false;
            grfHn.Cols[colFullName].AllowEditing    = false;
            grfHn.Cols[colDateReceive].AllowEditing = false;
            grfHn.Cols[colDateReq].AllowEditing     = false;
            grfHn.Cols[colReqNo].AllowEditing       = false;
            grfHn.Cols[colVN].AllowEditing          = false;
        }
예제 #20
0
        private void setGrfPtt(C1FlexGrid grf, String flagEx)
        {
            String type = "";

            type = cboItemType.SelectedItem == null ? "" : cboItemType.SelectedItem.ToString();

            grf.Clear();
            grf.Rows.Count = 1;
            grf.Cols.Count = 4;

            DataTable dt = null;

            if (type.Equals("LAB"))
            {
                if (type.Equals("ex"))
                {
                    dt = ic.ivfDB.oLabiDB.selectAllEx();
                }
                else
                {
                    dt = ic.ivfDB.oLabiDB.selectAll2();
                }
            }
            else if (type.Equals("Special"))
            {
                if (type.Equals("ex"))
                {
                    dt = ic.ivfDB.oSItmDB.selectAllEx();
                }
                else
                {
                    dt = ic.ivfDB.oSItmDB.selectAll2();
                }
            }
            else if (type.Equals("Drug"))
            {
                if (type.Equals("ex"))
                {
                    dt = ic.ivfDB.oStkdDB.selectAllEx();
                }
                else
                {
                    dt = ic.ivfDB.oStkdDB.selectAll2();
                }
            }
            grf.Cols[colItmName].Width = 250;
            grf.Cols[colItmCode].Width = 100;
            grf.Cols[colItmId].Width   = 80;
            grf.ShowCursor             = true;

            grf.Cols[colItmName].Caption = "Item Name";
            grf.Cols[colItmCode].Caption = "CODE";
            //grfItem.Cols[colVsVN].Caption = "VN";
            ContextMenu menuGw = new ContextMenu();

            //menuGw.MenuItems.Add("&แก้ไข Patient", new EventHandler(ContextMenu_edit_visit));
            grf.ContextMenu = menuGw;
            grf.Rows.Count  = dt.Rows.Count + 1;
            int i = 1;

            foreach (DataRow row in dt.Rows)
            {
                grf[i, colItmCode] = row["code"].ToString();
                grf[i, colItmName] = row["name"].ToString();
                grf[i, colItmId]   = row["id"].ToString();
                grf[i, 0]          = i;
                i++;
            }
            //grf.Cols[colItmId].Visible = false;
            grf.Cols[colItmCode].AllowEditing = false;
            grf.Cols[colItmName].AllowEditing = false;

            theme1.SetTheme(grf, ic.iniC.themeApplication);
        }
예제 #21
0
        private void setGrfQue()
        {
            //grfDept.Rows.Count = 7;
            grfQue.Clear();
            DataTable dt1 = new DataTable();
            DataTable dt  = new DataTable();

            if (txtSearch.Text.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);
                }
                dt = ic.ivfDB.ovsDB.selectByReceptionSendDoctor(ic.user.doctor_id_old);
            }
            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 = 11;
            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.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";

            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]   = row["PIDS"].ToString();
                grfQue[i, colPttName] = row["PName"].ToString();
                grfQue[i, colVsDate]  = ic.datetoShow(row["VDate"]);
                grfQue[i, colVsTime]  = row["VStartTime"].ToString();
                grfQue[i, colVsEtime] = row["VEndTime"].ToString();
                grfQue[i, colStatus]  = row["VName"].ToString();
                grfQue[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   = 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[colVNshow].AllowEditing  = false;
            grfQue.Cols[colPttHn].AllowEditing   = false;
            grfQue.Cols[colPttName].AllowEditing = false;
            grfQue.Cols[colVsDate].AllowEditing  = false;
            //theme1.SetTheme(grfQue, ic.theme);
        }
예제 #22
0
        private void setGrf()
        {
            String    datestart = "", dateend = "", hn = "", txt = "";
            DataTable dt = new DataTable();

            datestart = bc.datetoDB(txtDateStart.Text);
            dateend   = bc.datetoDB(txtDateEnd.Text);
            dt        = bc.bcDB.dscDB.selectDistByDateCrate(datestart, dateend);
            grfHn.Clear();
            grfHn.Rows.Count = 1;
            //grfQue.Rows.Count = 1;
            grfHn.Cols.Count                = 10;
            grfHn.Cols[colHN].Caption       = "HN";
            grfHn.Cols[colFullName].Caption = "Patient FullName";
            grfHn.Cols[colVN].Caption       = "VN";
            grfHn.Cols[colAN].Caption       = "AN";
            grfHn.Cols[colVsDate].Caption   = "vs Date";
            grfHn.Cols[colCrDate].Caption   = "scan Date";
            grfHn.Cols[colRowCnt].Caption   = "row cnt";
            grfHn.Cols[colPicBfS].Caption   = "pic BfS";
            grfHn.Cols[colCnt].Caption      = "CNT";
            grfHn.Cols[colHN].Width         = 100;
            grfHn.Cols[colFullName].Width   = 300;
            grfHn.Cols[colVN].Width         = 80;
            grfHn.Cols[colAN].Width         = 80;
            grfHn.Cols[colVsDate].Width     = 100;
            grfHn.Cols[colCrDate].Width     = 100;
            grfHn.Cols[colRowCnt].Width     = 80;
            grfHn.Cols[colPicBfS].Width     = 80;
            grfHn.ShowCursor                = true;
            ContextMenu menuGw = new ContextMenu();

            grfHn.ContextMenu = menuGw;
            int i = 1;

            grfHn.Rows.Count = dt.Rows.Count + 1;
            foreach (DataRow row in dt.Rows)
            {
                try
                {
                    grfHn[i, 0]           = (i);
                    grfHn[i, colHN]       = row["hn"].ToString();
                    grfHn[i, colFullName] = row["prefix"].ToString() + " " + row["MNC_FNAME_T"].ToString() + " " + row["MNC_LNAME_T"].ToString();
                    grfHn[i, colVN]       = row["vn"].ToString();
                    grfHn[i, colAN]       = row["an"].ToString();
                    grfHn[i, colVsDate]   = bc.datetoShow(row["visit_date"].ToString());
                    grfHn[i, colCrDate]   = bc.datetoShow(row["date_create"].ToString());
                    grfHn[i, colRowCnt]   = row["row_cnt"].ToString();
                    grfHn[i, colPicBfS]   = row["pic_before_scan_cnt"].ToString();
                    grfHn[i, colCnt]      = row["cnt"].ToString();
                }
                catch (Exception ex)
                {
                    new LogWriter("e", "FrmLabOutReceiveView setGrf ex " + ex.Message);
                }
                i++;
            }
            grfHn.Cols[colHN].AllowEditing       = false;
            grfHn.Cols[colFullName].AllowEditing = false;
            grfHn.Cols[colVN].AllowEditing       = false;
            grfHn.Cols[colAN].AllowEditing       = false;
            grfHn.Cols[colVsDate].AllowEditing   = false;
            grfHn.Cols[colCrDate].AllowEditing   = false;
            grfHn.Cols[colRowCnt].AllowEditing   = false;
            grfHn.Cols[colPicBfS].AllowEditing   = false;
        }
예제 #23
0
        public void CreateMagazineFlexgrid(C1FlexGrid flex)
        {
            MagazineDimension magDim = null;
            magDim = GetDimension();
            flex.Clear();
            // set the cols,rows of the grid to the values of the configuration
            flex.Cols.Count = magDim.DimX;
            flex.Rows.Count = magDim.DimY;

            for (int i = 0; i < magDim.DimX; i++)
            {
                flex.Cols[i].Width = (flex.Width / magDim.DimX);
            }

            for (int i = 0; i < magDim.DimY; i++)
            {
                flex.Rows[i].Height = (flex.Width / magDim.DimX) - 2;
            }

            try
            {
                ds_MagazineSamples.Clear();
                dt_MagazineSamples.Clear();
                ds_MagazineSamples = myHC.GetDataSetFromSQLCommand(GetMySQLStringForMagazineSamples());
                if (ds_MagazineSamples != null)
                {
                    dt_MagazineSamples = ds_MagazineSamples.Tables[0];
                }

            }
            catch (Exception ex) { mySave.InsertRow((int)Definition.Message.D_ALARM, ex.ToString()); }

            // zoom the picture in the cell
            flex.BackgroundImageLayout = ImageLayout.Zoom;

            if (flex.Cols[0].Width > 30)
            {
                Size size = new Size();
                size.Height = (flex.Cols[0].Width) - 30;
                size.Width = (flex.Cols[0].Width) - 30;
                int nColor = 0;
                try
                {
                    int nRow = 0;
                    int nCol = 0;
                    int nPos = 0;
                    for (nRow = 0; nRow < (magDim.DimY); nRow++)
                    {
                        // MessageBox.Show(nRow.ToString() + "#" + _magDim.DimX.ToString());
                        for (nCol = 0; nCol < (flex.Cols.Count); nCol++)
                        {
                            nPos++;
                            flex.SetData(nRow, nCol, "Pos " + nPos.ToString());
                            foreach (DataRow dr_Sample in dt_MagazineSamples.Rows)
                            {
                                if ((int)dr_Sample["MagazinePos"] == nPos)
                                {

                                    nColor = myHC.GetColorFromsampleprogramsBySampleProgramType_ID((int)dr_Sample["SampleProgramType_ID"]);
                                    Color col = Color.FromArgb(255, myColorHelper.GetCOLORFromRGBValue('R', nColor), myColorHelper.GetCOLORFromRGBValue('G', nColor), myColorHelper.GetCOLORFromRGBValue('B', nColor));

                                    //   MessageBox.Show(nRow.ToString() + "#" + nCol.ToString());

                                    flex.SetCellImage(nRow, nCol, GetCircleBitmap(size, col));
                                }
                            }
                        }
                    }

                }
                catch (Exception ex) { mySave.InsertRow((int)Definition.Message.D_ALARM, ex.ToString()); }
            }
            else
            {
                string strMagazinegrid = String.Format(myIniHandler.GetValue("Magazine", "IllegalGridWidth"), flex.Cols[0].Width.ToString());
                mySave.InsertRow((int)Definition.Message.D_ALARM, strMagazinegrid);
            }

            flex.Styles.Normal.ImageAlign = C1.Win.C1FlexGrid.ImageAlignEnum.CenterTop;
            flex.Styles.Normal.TextAlign = C1.Win.C1FlexGrid.TextAlignEnum.CenterBottom;
        }
예제 #24
0
        private void setGrfDeptH()
        {
            grfExpnD.Clear();
            //if (txtID.Text.Equals("")) return;
            DataTable dt = new DataTable();

            //if (flagfom2 ==flagForm2.Cash)
            //{
            //    dt = xC.xtDB.expnddDB.selectCashByDrawId1(txtID.Text);
            //    if (dt.Rows.Count <= 1) grfExpnD.Rows.Count = dt.Rows.Count + 2;
            //    else grfExpnD.Rows.Count = dt.Rows.Count + 1;
            //    grfExpnD.Cols.Count = dt.Columns.Count+1;
            //}
            //else
            //{
            dt = xC.accDB.expnddDB.selectChequeByDrawId1(txtID.Text);
            if (dt.Rows.Count <= 1)
            {
                grfExpnD.Rows.Count = dt.Rows.Count + 2;
            }
            else
            {
                grfExpnD.Rows.Count = dt.Rows.Count + 1;
            }
            grfExpnD.Cols.Count = dt.Columns.Count + 2;
            //}
            //grfExpnD.Rows.Count = 2;
            CellStyle cs = grfExpnD.Styles.Add("date");

            cs.DataType = typeof(DateTime);
            cs.Format   = "dd-MM-yyyy";

            //cs.ForeColor = Color.DarkGoldenrod;

            C1TextBox txt = new C1TextBox();

            txt.DataType = txtCode.DataType;
            C1TextBox txt1 = new C1TextBox();

            txt1.DataType = txtAmt.DataType;
            C1ComboBox cbo  = new C1ComboBox();
            ComboBox   cbo1 = new ComboBox();

            xC.iniDB.itmDB.setC1CboItem(cbo);
            xC.iniDB.itmDB.setCboItem(cbo1);
            C1ComboBox cbou = new C1ComboBox();
            C1TextBox  txt2 = new C1TextBox();

            txt2.DataType = txtExpndDrawDate.DataType;
            xC.iniDB.utpDB.setC1CboUtp(cbou, "");
            grfExpnD.Cols[colDItemNamet].Editor = cbo1;
            grfExpnD.Cols[colDQty].Editor       = txt1;
            grfExpnD.Cols[colDUnitNameT].Editor = cbou;
            grfExpnD.Cols[colDamt].Editor       = txt1;
            grfExpnD.Cols[colDPrice].Editor     = txt1;
            grfExpnD.Cols[colDwatx1].Editor     = txt1;
            grfExpnD.Cols[colDwatx3].Editor     = txt1;
            grfExpnD.Cols[colDvat].Editor       = txt1;
            grfExpnD.Cols[colDtotal].Editor     = txt1;
            grfExpnD.Cols[colDremark].Editor    = txt;
            grfExpnD.Cols[colDItemId].Editor    = txt;
            grfExpnD.Cols[colDUnitId].Editor    = txt;
            //if(flagfom2 == flagForm2.Cheque)
            //{
            grfExpnD.Cols[colDpaytocusnamet].Editor = txt;
            grfExpnD.Cols[colDpaytocusaddr].Editor  = txt;
            grfExpnD.Cols[colDapaytocustax].Editor  = txt;
            grfExpnD.Cols[colDreceiptno].Editor     = txt;
            grfExpnD.Cols[colDreceiptdate].Style    = cs;
            grfExpnD.Cols[colDpaytocusid].Editor    = txt;
            //}

            grfExpnD.Cols[colDQty].Width       = 80;
            grfExpnD.Cols[colDUnitNameT].Width = 140;
            grfExpnD.Cols[colDamt].Width       = 100;
            grfExpnD.Cols[colDPrice].Width     = 80;
            grfExpnD.Cols[colDItemNamet].Width = 220;
            grfExpnD.Cols[colDwatx1].Width     = 80;
            grfExpnD.Cols[colDwatx3].Width     = 80;
            grfExpnD.Cols[colDvat].Width       = 80;
            grfExpnD.Cols[colDtotal].Width     = 100;
            grfExpnD.Cols[colDremark].Width    = 200;
            //if (flagfom2 == flagForm2.Cheque)
            //{
            grfExpnD.Cols[colDpaytocusnamet].Width = 200;
            grfExpnD.Cols[colDpaytocusaddr].Width  = 200;
            grfExpnD.Cols[colDapaytocustax].Width  = 80;
            grfExpnD.Cols[colDreceiptno].Width     = 100;
            grfExpnD.Cols[colDreceiptdate].Width   = 100;
            //}


            grfExpnD.ShowCursor = true;
            grfExpnD.Cols[colDItemNamet].Caption = "รายการ";
            grfExpnD.Cols[colDQty].Caption       = "QTY";
            grfExpnD.Cols[colDUnitNameT].Caption = "หน่วย";
            grfExpnD.Cols[colDPrice].Caption     = "ราคา";
            grfExpnD.Cols[colDamt].Caption       = "รวมราคา";
            grfExpnD.Cols[colDwatx1].Caption     = "WTAX 1%";
            grfExpnD.Cols[colDwatx3].Caption     = "WTAX 3%";
            grfExpnD.Cols[colDvat].Caption       = "VAT";
            grfExpnD.Cols[colDtotal].Caption     = "รวมทั้งหมด";
            grfExpnD.Cols[colDremark].Caption    = "หมายเหตุ";
            //if (flagfom2 == flagForm2.Cheque)
            //{
            grfExpnD.Cols[colDpaytocusnamet].Caption = "ชื่อลูกค้า";
            grfExpnD.Cols[colDpaytocusaddr].Caption  = "ที่อยู่ลูกค้า";
            grfExpnD.Cols[colDapaytocustax].Caption  = "tax id";
            grfExpnD.Cols[colDreceiptno].Caption     = "เลขที่ใบเสร็จ";
            grfExpnD.Cols[colDreceiptdate].Caption   = "วันที่ในใบเสร็จ";
            //}

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

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                grfExpnD[i + 1, 0] = i + 1;
                if (i % 2 == 0)
                {
                    grfExpnD.Rows[i + 1].StyleNew.BackColor = color;
                }
                grfExpnD[i + 1, colDid]        = dt.Rows[i][xC.accDB.expnddDB.expnC.expenses_draw_detail_id].ToString();
                grfExpnD[i + 1, colDItemNamet] = dt.Rows[i][xC.accDB.expnddDB.expnC.item_name_t].ToString();
                grfExpnD[i + 1, colDQty]       = dt.Rows[i][xC.accDB.expnddDB.expnC.qty].ToString();
                grfExpnD[i + 1, colDUnitNameT] = dt.Rows[i][xC.accDB.expnddDB.expnC.unit_name_t].ToString();
                grfExpnD[i + 1, colDamt]       = dt.Rows[i][xC.accDB.expnddDB.expnC.amount].ToString();
                grfExpnD[i + 1, colDPrice]     = dt.Rows[i][xC.accDB.expnddDB.expnC.price].ToString();
                grfExpnD[i + 1, colDwatx1]     = dt.Rows[i][xC.accDB.expnddDB.expnC.wtax1].ToString();
                grfExpnD[i + 1, colDwatx3]     = dt.Rows[i][xC.accDB.expnddDB.expnC.wtax3].ToString();
                grfExpnD[i + 1, colDvat]       = dt.Rows[i][xC.accDB.expnddDB.expnC.vat].ToString();
                grfExpnD[i + 1, colDtotal]     = dt.Rows[i][xC.accDB.expnddDB.expnC.total].ToString();
                grfExpnD[i + 1, colDremark]    = dt.Rows[i][xC.accDB.expnddDB.expnC.remark].ToString();
                grfExpnD[i + 1, colDItemId]    = dt.Rows[i][xC.accDB.expnddDB.expnC.item_id].ToString();
                //if (flagfom2 == flagForm2.Cheque)
                //{
                grfExpnD[i + 1, colDpaytocusnamet] = dt.Rows[i][xC.accDB.expnddDB.expnC.pay_to_cus_name_t].ToString();
                grfExpnD[i + 1, colDpaytocusaddr]  = dt.Rows[i][xC.accDB.expnddDB.expnC.pay_to_cus_addr].ToString();
                grfExpnD[i + 1, colDapaytocustax]  = dt.Rows[i][xC.accDB.expnddDB.expnC.pay_to_cus_tax].ToString();
                grfExpnD[i + 1, colDreceiptno]     = dt.Rows[i][xC.accDB.expnddDB.expnC.receipt_no].ToString();
                grfExpnD[i + 1, colDreceiptdate]   = dt.Rows[i][xC.accDB.expnddDB.expnC.receipt_date].ToString();
                grfExpnD[i + 1, colDpaytocusid]    = dt.Rows[i][xC.accDB.expnddDB.expnC.pay_to_cus_id].ToString();
                grfExpnD[i + 1, colDedit]          = "-";
                //}
            }
            //CellRange rg1 = grfBank.GetCellRange(1, colE, grfBank.Rows.Count, colE);
            //rg1.Style = grfBank.Styles["date"];
            //if (grfPic.Rows.Count == (grfPic.Row + 1)) grfPic.Rows.Count++;
            //grfExpnD.AfterRowColChange += GrfExpnD_AfterRowColChange;

            if (flagForm.Equals("pay"))
            {
                ContextMenu menuGw = new ContextMenu();
                menuGw.MenuItems.Add("&จ่ายเงิน รายการเบิก", new EventHandler(ContextMenu_pay));
                //menuGw.MenuItems.Add("&แก้ไข", new EventHandler(ContextMenu_Gw_Edit));
                //menuGw.MenuItems.Add("&ยกเลิก", new EventHandler(ContextMenu_Gw_Cancel));
                grfExpnD.ContextMenu = menuGw;
            }
            grfExpnD.Cols[colDid].Visible     = false;
            grfExpnD.Cols[colDItemId].Visible = false;
            grfExpnD.Cols[colDUnitId].Visible = false;
            grfExpnD.Cols[colDedit].Visible   = false;
            if (flagfom2 == flagForm2.Cheque)
            {
                grfExpnD.Cols[colDpaytocusid].Visible = false;
            }
        }
예제 #25
0
        private void setGrfQue()
        {
            grfQue.Clear();
            grfQue.Rows.Count = 1;
            //grfQue.Rows.Count = 1;
            grfQue.Cols.Count = 18;
            //Column colpic1 = grf.Cols[colPic1];
            //colpic1.DataType = typeof(Image);
            //Column colpic2 = grf.Cols[colPic2];
            //colpic2.DataType = typeof(Image);
            //Column colpic3 = grf.Cols[colPic3];
            //colpic3.DataType = typeof(Image);
            //Column colpic4 = grf.Cols[colPic4];
            //colpic4.DataType = typeof(Image);
            grfQue.Cols[colQueVnShow].Caption  = "VN";
            grfQue.Cols[colQueHn].Caption      = "HN";
            grfQue.Cols[colQuePttName].Caption = "Patient Name";
            grfQue.Cols[colQueVsDate].Caption  = "Date";
            grfQue.Cols[colQueVsTime].Caption  = "Time";
            grfQue.Cols[colQueSex].Caption     = "Sex";
            grfQue.Cols[colQueAge].Caption     = "Age";
            grfQue.Cols[colQuePaid].Caption    = "Paid";
            grfQue.Cols[colQueSymptom].Caption = "Symptom";
            grfQue.Cols[colQueHeight].Caption  = "Height";
            grfQue.Cols[coolQueBw].Caption     = "BW";
            grfQue.Cols[colQueBp].Caption      = "BP";
            grfQue.Cols[colQuePulse].Caption   = "Pulse";
            grfQue.Cols[colQyeTemp].Caption    = "Temp";
            grfQue.Cols[colQueDsc].Caption     = "Description";

            grfQue.Cols[colQueVnShow].Width  = 80;
            grfQue.Cols[colQueHn].Width      = 80;
            grfQue.Cols[colQuePttName].Width = 310;
            grfQue.Cols[colQueVsDate].Width  = 110;
            grfQue.Cols[colQueVsTime].Width  = 80;
            grfQue.Cols[colQueSex].Width     = 60;
            grfQue.Cols[colQueAge].Width     = 80;
            grfQue.Cols[colQuePaid].Width    = 110;
            grfQue.Cols[colQueSymptom].Width = 300;
            grfQue.Cols[colQueHeight].Width  = 60;
            grfQue.Cols[coolQueBw].Width     = 60;
            grfQue.Cols[colQueBp].Width      = 60;
            grfQue.Cols[colQuePulse].Width   = 60;
            grfQue.Cols[colQyeTemp].Width    = 60;
            grfQue.Cols[colQueDsc].Width     = 300;
            grfQue.ShowCursor = true;
            //grf.Cols[colPic1].ImageAndText = true;
            //grf.Cols[colPic2].ImageAndText = true;
            //grf.Cols[colPic3].ImageAndText = true;
            //grf.Cols[colPic4].ImageAndText = true;
            //grf.Styles.Normal.ImageAlign = ImageAlignEnum.CenterTop;
            //grf.Styles.Normal.TextAlign = TextAlignEnum.CenterBottom;
            ContextMenu menuGw = new ContextMenu();

            //menuGw.MenuItems.Add("&แก้ไข Image", new EventHandler(ContextMenu_edit));
            //menuGw.MenuItems.Add("&Rotate Image", new EventHandler(ContextMenu_retate));
            //menuGw.MenuItems.Add("Delete Image", new EventHandler(ContextMenu_delete));
            grfQue.ContextMenu = menuGw;
            //foreach (DocGroupScan dgs in bc.bcDB.dgsDB.lDgs)
            //{
            //menuGw.MenuItems.Add("&เลือกประเภทเอกสาร และUpload Image ["+dgs.doc_group_name+"]", new EventHandler(ContextMenu_upload));
            String   date = "";
            DateTime dtt  = new DateTime();

            //if (lDgss.Count <= 0) getlBsp();
            date = txtDate.Text;
            DataTable dt = new DataTable();

            if (DateTime.TryParse(txtDate.Value.ToString(), out dtt))
            {
                date = dtt.Year.ToString() + "-" + dtt.ToString("MM-dd");
            }
            if (date.Length <= 0)
            {
                return;
            }
            //this.Text = "Last Update 2020-02-06 Format Date " + System.DateTime.Now.ToString("dd-MM-yyyy") +" ["+ date + "] hostFTP " + bc.iniC.hostFTP + " folderFTP " + bc.iniC.folderFTP;
            dt = bc.bcDB.vsDB.selectVisitByDtr(bc.user.staff_id, date, "queue");
            int i = 1;

            grfQue.Rows.Count = dt.Rows.Count + 1;
            foreach (DataRow row in dt.Rows)
            {
                try
                {
                    String  status = "", vn = "";
                    Patient ptt = new Patient();
                    vn = row["MNC_VN_NO"].ToString() + "/" + row["MNC_VN_SEQ"].ToString() + "(" + row["MNC_VN_SUM"].ToString() + ")";
                    ptt.patient_birthday     = bc.datetoDB(row["mnc_bday"].ToString());
                    grfQue[i, 0]             = (i);
                    grfQue[i, colQueId]      = vn;
                    grfQue[i, colQueVnShow]  = vn;
                    grfQue[i, colQueVsDate]  = bc.datetoShow(row["mnc_date"].ToString());
                    grfQue[i, colQueHn]      = row["MNC_HN_NO"].ToString();
                    grfQue[i, colQuePttName] = row["prefix"].ToString() + "" + row["MNC_FNAME_T"].ToString() + "" + row["MNC_LNAME_T"].ToString();
                    grfQue[i, colQueVsTime]  = bc.FormatTime(row["mnc_time"].ToString());
                    //grfQue[i, colQueVnShow] = row["MNC_REQ_DAT"].ToString();
                    grfQue[i, colQueSex]     = row["mnc_sex"].ToString();
                    grfQue[i, colQueAge]     = ptt.AgeStringShort();
                    grfQue[i, colQuePaid]    = row["MNC_FN_TYP_DSC"].ToString();
                    grfQue[i, colQueSymptom] = row["MNC_SHIF_MEMO"].ToString();
                    grfQue[i, colQueHeight]  = row["mnc_high"].ToString();
                    grfQue[i, coolQueBw]     = row["mnc_weight"].ToString();
                    grfQue[i, colQueBp]      = row["mnc_bp1_l"].ToString();
                    grfQue[i, colQuePulse]   = row["MNC_ratios"].ToString();
                    grfQue[i, colQyeTemp]    = row["MNC_temp"].ToString();
                    grfQue[i, colQuePreNo]   = row["MNC_pre_no"].ToString();
                    grfQue[i, colQueDsc]     = row["MNC_ref_dsc"].ToString();
                    if ((i % 2) == 0)
                    {
                        grfQue.Rows[i].StyleNew.BackColor = ColorTranslator.FromHtml(bc.iniC.grfRowColor);
                    }

                    i++;
                }
                catch (Exception ex)
                {
                    new LogWriter("e", "FrmDoctorView setGrfQue ex " + ex.Message);
                }
            }

            //addDevice.MenuItems.Add("", new EventHandler(ContextMenu_upload));
            //menuGw.MenuItems.Add(addDevice);
            //}


            //row1[colVSE2] = row[ic.ivfDB.pApmDB.pApm.e2].ToString().Equals("1") ? imgCorr : imgTran;
            grfQue.Cols[colQueId].Visible    = false;
            grfQue.Cols[colQuePreNo].Visible = false;

            grfQue.Cols[colQueVnShow].AllowEditing  = false;
            grfQue.Cols[colQueHn].AllowEditing      = false;
            grfQue.Cols[colQuePttName].AllowEditing = false;
            grfQue.Cols[colQueVsDate].AllowEditing  = false;
            grfQue.Cols[colQueVsTime].AllowEditing  = false;
            grfQue.Cols[colQueSex].AllowEditing     = false;
            grfQue.Cols[colQueAge].AllowEditing     = false;
            grfQue.Cols[colQuePaid].AllowEditing    = false;
            grfQue.Cols[colQueSymptom].AllowEditing = false;
            grfQue.Cols[colQueHeight].AllowEditing  = false;
            grfQue.Cols[coolQueBw].AllowEditing     = false;
            grfQue.Cols[colQueBp].AllowEditing      = false;
            grfQue.Cols[colQuePulse].AllowEditing   = false;
            grfQue.Cols[colQyeTemp].AllowEditing    = false;
            grfQue.Cols[colQuePreNo].AllowEditing   = false;
            grfQue.Cols[colQueDsc].AllowEditing     = false;
            //grfQue.Cols[colQueVnShow].AllowEditing = false;
        }
예제 #26
0
        private void setGrfReq()
        {
            //grfDept.Rows.Count = 7;
            grfReq.Clear();
            grfReq.Rows.Count = 1;
            DataTable dt   = new DataTable();
            String    date = "";

            date = System.DateTime.Now.Year + "-" + System.DateTime.Now.ToString("MM-dd");

            dt = bc.bcDB.xrDB.selectVisitStatusPacsReqByDate(date);
            //grfExpn.Rows.Count = dt.Rows.Count + 1;

            grfReq.Rows.Count = dt.Rows.Count + 1;
            grfReq.Cols.Count = 16;
            //C1TextBox txt = new C1TextBox();
            //C1ComboBox cboproce = new C1ComboBox();
            //ic.ivfDB.itmDB.setCboItem(cboproce);
            //grfBillD.Cols[colName].Editor = txt;
            //grfBillD.Cols[colAmt].Editor = txt;
            //grfBillD.Cols[colDiscount].Editor = txt;
            //grfBillD.Cols[colNetAmt].Editor = txt;

            grfReq.Cols[colReqHn].Width       = 80;
            grfReq.Cols[colReqName].Width     = 200;
            grfReq.Cols[colReqVn].Width       = 80;
            grfReq.Cols[colReqXn].Width       = 80;
            grfReq.Cols[colReqDtr].Width      = 100;
            grfReq.Cols[colReqDpt].Width      = 100;
            grfReq.Cols[colreqsex].Width      = 60;
            grfReq.Cols[colreqdob].Width      = 60;
            grfReq.Cols[colreqsickness].Width = 160;
            grfReq.Cols[colxrdesc].Width      = 180;

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

            grfReq.Cols[colReqHn].Caption       = "HN";
            grfReq.Cols[colReqName].Caption     = "Name";
            grfReq.Cols[colReqVn].Caption       = "VN";
            grfReq.Cols[colReqXn].Caption       = "XN";
            grfReq.Cols[colReqDtr].Caption      = "Doctor";
            grfReq.Cols[colReqDpt].Caption      = "Department";
            grfReq.Cols[colreqsex].Caption      = "Sex";
            grfReq.Cols[colreqdob].Caption      = "DOB";
            grfReq.Cols[colreqsickness].Caption = "Sickness";
            grfReq.Cols[colxrdesc].Caption      = "X-Ray";

            Color color = ColorTranslator.FromHtml(bc.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;
            Decimal inc = 0, ext = 0;

            foreach (DataRow row in dt.Rows)
            {
                try
                {
                    grfReq[i, 0]          = i;
                    grfReq[i, colReqId]   = "";
                    grfReq[i, colReqHn]   = row["mnc_hn_no"].ToString();
                    grfReq[i, colReqName] = row["prefix"].ToString() + " " + row["MNC_FNAME_T"].ToString() + " " + row["MNC_LNAME_T"].ToString();
                    grfReq[i, colReqVn]   = row["mnc_vn_no"].ToString() + "." + row["mnc_vn_seq"].ToString() + "." + row["mnc_vn_sum"].ToString();

                    grfReq[i, colReqXn]       = "";
                    grfReq[i, colReqDtr]      = "";
                    grfReq[i, colReqDpt]      = "";
                    grfReq[i, colReqreqyr]    = row["mnc_req_yr"].ToString();
                    grfReq[i, colReqreqno]    = row["mnc_req_no"].ToString();
                    grfReq[i, colreqhnyr]     = row["mnc_hn_yr"].ToString();
                    grfReq[i, colreqpreno]    = row["mnc_pre_no"].ToString();
                    grfReq[i, colreqsex]      = row["mnc_sex"].ToString();
                    grfReq[i, colreqsickness] = row["mnc_shif_memo"].ToString();
                    DateTime dt1 = new DateTime();
                    DateTime.TryParse(row["mnc_bday"].ToString(), out dt1);

                    grfReq[i, colreqdob] = dt1.Year + dt1.ToString("MMdd");
                    grfReq[i, colxrdesc] = row["MNC_XR_DSC"].ToString();
                    i++;
                }
                catch (Exception ex)
                {
                    String err = "";
                }
            }
            CellNoteManager mgr = new CellNoteManager(grfReq);

            grfReq.Cols[colReqId].Visible    = false;
            grfReq.Cols[colReqreqyr].Visible = false;
            grfReq.Cols[colReqreqno].Visible = false;
            grfReq.Cols[colreqhnyr].Visible  = false;
            grfReq.Cols[colreqpreno].Visible = false;
            grfReq.Cols[colReqDpt].Visible   = false;
            grfReq.Cols[colReqDtr].Visible   = false;

            grfReq.Cols[colReqHn].AllowEditing   = false;
            grfReq.Cols[colReqName].AllowEditing = false;
            grfReq.Cols[colReqVn].AllowEditing   = false;
            grfReq.Cols[colReqXn].AllowEditing   = false;
            grfReq.Cols[colReqDtr].AllowEditing  = false;
            grfReq.Cols[colReqDpt].AllowEditing  = false;
        }
예제 #27
0
        private void setGrfHn()
        {
            String datestart = "", dateend = "", hn = "", txt = "";

            String[]  hn1;
            DataTable dt = new DataTable();

            datestart = bc.datetoDB(txtDateStart.Text);
            dateend   = bc.datetoDB(txtDateEnd.Text);
            hn        = txtHn.Text.Trim();
            hn1       = hn.Split(',');
            if (hn1.Length <= 0)
            {
                MessageBox.Show("No data HN", "");
                return;
            }

            for (int j = 0; j < hn1.Length; j++)
            {
                hn1[j] = "'" + hn1[j].Trim() + "'";
                txt   += hn1[j] + ",";
            }
            if (txt.Length > 0)
            {
                if (txt.Substring(txt.Length - 1).Equals(","))
                {
                    txt = txt.Substring(0, txt.Length - 1);
                }
            }
            dt = bc.bcDB.vsDB.selectVisitByLikeHn(txt, datestart, dateend);

            grfHn.Clear();
            grfHn.Rows.Count = 1;
            //grfQue.Rows.Count = 1;
            grfHn.Cols.Count = 20;
            Column colChk = grfHn.Cols[colHnPrnReqLab];

            colChk.DataType = typeof(Boolean);
            Column colChk2 = grfHn.Cols[colHnPrnReqXray];

            colChk2.DataType = typeof(Boolean);
            Column colChk3 = grfHn.Cols[colHnPrnResLab];

            colChk3.DataType = typeof(Boolean);
            Column colChk4 = grfHn.Cols[colHnPrnResXray];

            colChk4.DataType = typeof(Boolean);
            Column colChk5 = grfHn.Cols[colHnPrnDrug];

            colChk5.DataType = typeof(Boolean);
            Column colChk6 = grfHn.Cols[colHnPrnStaffNote];

            colChk6.DataType = typeof(Boolean);
            grfHn.Cols[colHnPrnDrug].Caption      = "ใบยา";
            grfHn.Cols[colHnPrnStaffNote].Caption = "Staff N.";
            grfHn.Cols[colHnPrnReqLab].Caption    = "Req Lab";
            grfHn.Cols[colHnPrnReqXray].Caption   = "Req Xray";
            grfHn.Cols[colHnPrnResLab].Caption    = "Req Lab";
            grfHn.Cols[colHnPrnResXray].Caption   = "Res Xray";
            grfHn.Cols[colHnVnShow].Caption       = "VN";
            grfHn.Cols[colHnHn].Caption           = "HN";
            grfHn.Cols[colHnPttName].Caption      = "Patient Name";
            grfHn.Cols[colHnVsDate].Caption       = "Date";
            grfHn.Cols[colHnVsTime].Caption       = "Time";
            grfHn.Cols[colHnSex].Caption          = "Sex";
            grfHn.Cols[colHnAge].Caption          = "Age";
            grfHn.Cols[colHnPaid].Caption         = "Paid";
            grfHn.Cols[colHnDsc].Caption          = "Description";

            grfHn.Cols[colHnPrnStaffNote].Width = 60;
            grfHn.Cols[colHnPrnReqLab].Width    = 60;
            grfHn.Cols[colHnPrnReqLab].Width    = 60;
            grfHn.Cols[colHnPrnReqXray].Width   = 60;
            grfHn.Cols[colHnPrnResLab].Width    = 60;
            grfHn.Cols[colHnPrnResXray].Width   = 65;
            grfHn.Cols[colHnVnShow].Width       = 80;
            grfHn.Cols[colHnHn].Width           = 80;
            grfHn.Cols[colHnPttName].Width      = 310;
            grfHn.Cols[colHnVsDate].Width       = 110;
            grfHn.Cols[colHnVsTime].Width       = 80;
            grfHn.Cols[colHnSex].Width          = 60;
            grfHn.Cols[colHnAge].Width          = 80;
            grfHn.Cols[colHnPaid].Width         = 110;
            grfHn.Cols[colHnDsc].Width          = 300;

            grfHn.ShowCursor = true;
            //grf.Cols[colPic1].ImageAndText = true;
            //grf.Cols[colPic2].ImageAndText = true;
            //grf.Cols[colPic3].ImageAndText = true;
            //grf.Cols[colPic4].ImageAndText = true;
            //grf.Styles.Normal.ImageAlign = ImageAlignEnum.CenterTop;
            //grf.Styles.Normal.TextAlign = TextAlignEnum.CenterBottom;
            ContextMenu menuGw = new ContextMenu();

            //menuGw.MenuItems.Add("&แก้ไข Image", new EventHandler(ContextMenu_edit));
            //menuGw.MenuItems.Add("&Rotate Image", new EventHandler(ContextMenu_retate));
            //menuGw.MenuItems.Add("Delete Image", new EventHandler(ContextMenu_delete));
            grfHn.ContextMenu = menuGw;
            //foreach (DocGroupScan dgs in bc.bcDB.dgsDB.lDgs)
            //{
            //menuGw.MenuItems.Add("&เลือกประเภทเอกสาร และUpload Image ["+dgs.doc_group_name+"]", new EventHandler(ContextMenu_upload));
            String date = "";

            //if (lDgss.Count <= 0) getlBsp();
            date = txtDateStart.Text;

            int i = 1;

            grfHn.Rows.Count = dt.Rows.Count + 1;
            foreach (DataRow row in dt.Rows)
            {
                try
                {
                    String  status = "", vn = "";
                    Patient ptt = new Patient();
                    vn = row["MNC_VN_NO"].ToString() + "/" + row["MNC_VN_SEQ"].ToString() + "(" + row["MNC_VN_SUM"].ToString() + ")";
                    ptt.patient_birthday        = bc.datetoDB(row["mnc_bday"].ToString());
                    grfHn[i, 0]                 = (i);
                    grfHn[i, colHnPrn]          = true;
                    grfHn[i, colHnPrnDrug]      = chkDrug.Checked;
                    grfHn[i, colHnPrnStaffNote] = chkStaffNote.Checked;
                    grfHn[i, colHnPrnReqLab]    = chkReqLab.Checked;
                    grfHn[i, colHnPrnReqXray]   = chkReqXray.Checked;
                    grfHn[i, colHnPrnResLab]    = chkResLab.Checked;
                    grfHn[i, colHnPrnResXray]   = chkResXray.Checked;
                    grfHn[i, colHnId]           = vn;
                    grfHn[i, colHnVnShow]       = vn;
                    grfHn[i, colHnVsDate]       = bc.datetoShow(row["mnc_date"].ToString());
                    grfHn[i, colHnHn]           = row["MNC_HN_NO"].ToString();
                    grfHn[i, colHnPttName]      = row["prefix"].ToString() + " " + row["MNC_FNAME_T"].ToString() + " " + row["MNC_LNAME_T"].ToString();
                    grfHn[i, colHnVsTime]       = bc.FormatTime(row["mnc_time"].ToString());
                    //grfQue[i, colQueVnShow] = row["MNC_REQ_DAT"].ToString();
                    grfHn[i, colHnSex]     = row["mnc_sex"].ToString();
                    grfHn[i, colHnAge]     = ptt.AgeStringShort();
                    grfHn[i, colHnPaid]    = row["MNC_FN_TYP_DSC"].ToString();
                    grfHn[i, colHnSymptom] = row["MNC_SHIF_MEMO"].ToString();

                    grfHn[i, colHnPreNo] = row["MNC_pre_no"].ToString();
                    grfHn[i, colHnDsc]   = row["MNC_ref_dsc"].ToString();
                    if ((i % 2) == 0)
                    {
                        grfHn.Rows[i].StyleNew.BackColor = ColorTranslator.FromHtml(bc.iniC.grfRowColor);
                    }

                    i++;
                }
                catch (Exception ex)
                {
                    new LogWriter("e", "FrmPrintCri setGrfHn ex " + ex.Message);
                }
            }

            //addDevice.MenuItems.Add("", new EventHandler(ContextMenu_upload));
            //menuGw.MenuItems.Add(addDevice);
            //}

            //row1[colVSE2] = row[ic.ivfDB.pApmDB.pApm.e2].ToString().Equals("1") ? imgCorr : imgTran;
            grfHn.Cols[colHnId].Visible    = false;
            grfHn.Cols[colHnPreNo].Visible = false;
            grfHn.Cols[colHnPrn].Visible   = false;

            grfHn.Cols[colHnVnShow].AllowEditing  = false;
            grfHn.Cols[colHnHn].AllowEditing      = false;
            grfHn.Cols[colHnPttName].AllowEditing = false;
            grfHn.Cols[colHnVsDate].AllowEditing  = false;
            grfHn.Cols[colHnVsTime].AllowEditing  = false;
            grfHn.Cols[colHnSex].AllowEditing     = false;
            grfHn.Cols[colHnAge].AllowEditing     = false;
            grfHn.Cols[colHnPaid].AllowEditing    = false;
            grfHn.Cols[colHnSymptom].AllowEditing = false;
            grfHn.Cols[colHnPreNo].AllowEditing   = false;
            grfHn.Cols[colHnDsc].AllowEditing     = false;
            //grfQue.Cols[colQueVnShow].AllowEditing = false;
        }
예제 #28
0
        private void setGrfEggStiDay()
        {
            //grfDept.Rows.Count = 7;
            grfEggsd.Clear();
            DataTable dt = new DataTable();

            dt = ic.ivfDB.eggsdDB.selectByEggStiId(txtId.Text);
            //grfExpn.Rows.Count = dt.Rows.Count + 1;
            grfEggsd.Rows.Count = 1;
            grfEggsd.Cols.Count = 15;
            C1TextBox  txt          = new C1TextBox();
            C1ComboBox cboday3      = new C1ComboBox();
            C1ComboBox cboday3desc1 = new C1ComboBox();
            C1ComboBox cbomedi      = new C1ComboBox();

            cboday3.AutoCompleteMode        = AutoCompleteMode.Suggest;
            cboday3.AutoCompleteSource      = AutoCompleteSource.ListItems;
            cboday3desc1.AutoCompleteMode   = AutoCompleteMode.Suggest;
            cboday3desc1.AutoCompleteSource = AutoCompleteSource.ListItems;
            cbomedi.AutoCompleteMode        = AutoCompleteMode.Suggest;
            cbomedi.AutoCompleteSource      = AutoCompleteSource.ListItems;
            ic.ivfDB.fdtDB.setCboEggStiRtOvary1(cboday3, "");
            ic.ivfDB.fdtDB.setCboEggStiRtOvary2(cboday3desc1, "");
            ic.ivfDB.fdtDB.setCboEggStiMedication(cbomedi, "");
            grfEggsd.Cols[colLt1].Editor      = cboday3;
            grfEggsd.Cols[colLt2].Editor      = cboday3desc1;
            grfEggsd.Cols[colRt1].Editor      = cboday3;
            grfEggsd.Cols[colRt2].Editor      = cboday3desc1;
            grfEggsd.Cols[colMedi].Editor     = cbomedi;
            grfEggsd.Cols[colDay].Width       = 40;
            grfEggsd.Cols[colDate].Width      = 100;
            grfEggsd.Cols[colE2].Width        = 70;
            grfEggsd.Cols[colLH].Width        = 70;
            grfEggsd.Cols[colFSH].Width       = 70;
            grfEggsd.Cols[colProlactin].Width = 70;
            grfEggsd.Cols[colRt1].Width       = 120;
            grfEggsd.Cols[colRt2].Width       = 70;
            grfEggsd.Cols[colLt1].Width       = 120;
            grfEggsd.Cols[colLt2].Width       = 70;
            grfEggsd.Cols[colEndo].Width      = 70;
            grfEggsd.Cols[colMedi].Width      = 120;

            grfEggsd.Cols[colE2].AllowSorting  = false;
            grfEggsd.Cols[colLH].AllowSorting  = false;
            grfEggsd.Cols[colFSH].AllowSorting = false;

            grfEggsd.ShowCursor = true;
            //grdFlex.Cols[colID].Caption = "no";
            //grfDept.Cols[colCode].Caption = "รหัส";
            grfEggsd.Cols[colDay].Caption       = "day";
            grfEggsd.Cols[colDate].Caption      = "date";
            grfEggsd.Cols[colE2].Caption        = "E2";
            grfEggsd.Cols[colLH].Caption        = "LH";
            grfEggsd.Cols[colFSH].Caption       = "FSH";
            grfEggsd.Cols[colProlactin].Caption = "Prolactin";
            grfEggsd.Cols[colRt1].Caption       = "Rt ovary";
            grfEggsd.Cols[colRt2].Caption       = "Rt ovary";
            grfEggsd.Cols[colLt1].Caption       = "Lt ovary";
            grfEggsd.Cols[colLt2].Caption       = "Lt ovary";
            grfEggsd.Cols[colEndo].Caption      = "Endo";
            grfEggsd.Cols[colMedi].Caption      = "Medication";

            Color color = ColorTranslator.FromHtml(ic.iniC.grfRowColor);
            //CellRange rg1 = grfBank.GetCellRange(1, colE, grfBank.Rows.Count, colE);
            //rg1.Style = grfBank.Styles["date"];
            int    i = 1;
            String staffId = "", checkId = "", dateday2 = "";

            foreach (DataRow row in dt.Rows)
            {
                Row row1 = grfEggsd.Rows.Add();
                //staffId = row[ic.ivfDB.opuEmDevDB.opuEmDev.staff_id].ToString();
                //checkId = row[ic.ivfDB.opuEmDevDB.opuEmDev.checked_id].ToString();
                row1[colId]        = row[ic.ivfDB.eggsdDB.eggsd.egg_sti_day_id].ToString();
                row1[colDay]       = row[ic.ivfDB.eggsdDB.eggsd.day1].ToString();
                row1[colDate]      = ic.datetoShow(row[ic.ivfDB.eggsdDB.eggsd.date].ToString());
                row1[colE2]        = row[ic.ivfDB.eggsdDB.eggsd.e2].ToString();
                row1[colLH]        = row[ic.ivfDB.eggsdDB.eggsd.lh].ToString();
                row1[colFSH]       = row[ic.ivfDB.eggsdDB.eggsd.fsh].ToString();
                row1[colProlactin] = row[ic.ivfDB.eggsdDB.eggsd.prolactin].ToString();
                row1[colRt1]       = row[ic.ivfDB.eggsdDB.eggsd.rt_ovary_1].ToString();
                row1[colRt2]       = row[ic.ivfDB.eggsdDB.eggsd.rt_ovary_2].ToString();
                row1[colLt1]       = row[ic.ivfDB.eggsdDB.eggsd.lt_ovary_1].ToString();
                row1[colLt2]       = row[ic.ivfDB.eggsdDB.eggsd.lt_ovary_2].ToString();
                row1[colEndo]      = row[ic.ivfDB.eggsdDB.eggsd.endo].ToString();
                row1[colMedi]      = row[ic.ivfDB.eggsdDB.eggsd.medication].ToString();
                row1[colEdit]      = "";
                row1[0]            = i;
                i++;
            }
            grfEggsd.Rows.Add();
            grfEggsd.Cols[colId].Visible   = false;
            grfEggsd.Cols[colEdit].Visible = false;
            //grfEggsd.Cols[colProlactin].Visible = false;
            grfEggsd.AutoClipboard = true;
        }
예제 #29
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);
        }
예제 #30
0
        private void setGrfQue()
        {
            //grfDept.Rows.Count = 7;
            grfQue.Clear();
            DataTable dt = new DataTable();

            dt = ic.ivfDB.orreqDB.selectByStatusReq();

            //grfExpn.Rows.Count = dt.Rows.Count + 1;
            grfQue.Rows.Count = dt.Rows.Count + 1;
            grfQue.Cols.Count = 10;


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

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

            grfQue.Cols[colQueHn].Caption      = "HN";
            grfQue.Cols[colQueName].Caption    = "Patient Name";
            grfQue.Cols[colQueOpera].Caption   = "Operation";
            grfQue.Cols[colQueOrDate].Caption  = "OR Date";
            grfQue.Cols[colQueOrTime].Caption  = "OR Time";
            grfQue.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("receive operation", new EventHandler(ContextMenu_order));

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

            menuGw.MenuItems.Add(addDevice);
            addDevice.MenuItems.Add(new MenuItem("Form1", new EventHandler(ContextMenu_order)));
            addDevice.MenuItems.Add(new MenuItem("Form2", new EventHandler(ContextMenu_order)));
            addDevice.MenuItems.Add(new MenuItem("Form3", new EventHandler(ContextMenu_order)));

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

            grfQue.Cols[colQueId].Visible           = false;
            grfQue.Cols[colQueHn].AllowEditing      = false;
            grfQue.Cols[colQueName].AllowEditing    = false;
            grfQue.Cols[colQueOpera].AllowEditing   = false;
            grfQue.Cols[colQueOrDate].AllowEditing  = false;
            grfQue.Cols[colQueOrTime].AllowEditing  = false;
            grfQue.Cols[colQueSurgeon].AllowEditing = false;
            //theme1.SetTheme(grfQue, ic.theme);
        }
예제 #31
0
        private void setGrf()
        {
            grfVs.Clear();
            grfVs.Rows.Count = 1;
            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   = 100;
            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          = false;
            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, "");
            dt = bc.bcDB.vsDB.selectVisitByHn3(txtHn.Text);
            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" : "-";
                vn                = row1["MNC_VN_NO"].ToString() + "/" + row1["MNC_VN_SEQ"].ToString() + "(" + row1["MNC_VN_SUM"].ToString() + ")";
                rowa[colVsVsDate] = bc.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] = bc.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].Visible = 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");
        }