예제 #1
0
        private void setGrfStf()
        {
            DataTable dt = new DataTable();

            dt = bc.bcDB.stfDB.selectByLevel("'5','6'");

            grfStf.Rows.Count = 1;
            //grfLab.Cols[colOrderId].Visible = false;
            grfStf.Rows.Count               = dt.Rows.Count + 1;
            grfStf.Cols.Count               = dt.Columns.Count + 1;
            grfStf.Cols[colStfId].Caption   = "ID";
            grfStf.Cols[colStfName].Caption = "Name";

            grfStf.Cols[colStfName].Width = 350;
            grfStf.Cols[colStfId].Width   = 100;

            int     i   = 0;
            decimal aaa = 0;

            for (int col = 0; col < dt.Columns.Count; ++col)
            {
                grfStf.Cols[col + 1].DataType = dt.Columns[col].DataType;
                //grfOrdDrug.Cols[col + 1].Caption = dt.Columns[col].ColumnName;
                grfStf.Cols[col + 1].Name = dt.Columns[col].ColumnName;
            }
            foreach (DataRow row1 in dt.Rows)
            {
                i++;
                if (i == 1)
                {
                    continue;
                }
                grfStf[i, colStfId]   = row1["MNC_USR_NAME"].ToString();
                grfStf[i, colStfName] = row1["MNC_USR_FULL"].ToString();

                //row1[0] = (i - 2);
            }
            CellNoteManager mgr = new CellNoteManager(grfStf);

            //grfOrdDrug.Cols[colXrayResult].Visible = false;
            grfStf.Cols[colStfId].AllowEditing   = false;
            grfStf.Cols[colStfName].AllowEditing = false;

            FilterRow fr = new FilterRow(grfStf);

            grfStf.AllowFiltering = true;
            grfStf.AfterFilter   += GrfStf_AfterFilter;
            //}).Start();
        }
예제 #2
0
        private void setGrfFinish(String search)
        {
            //grfDept.Rows.Count = 7;
            //grfFinish.Clear();
            DataTable dt = new DataTable();
            //if (search.Equals(""))        //-0020
            //{        //-0020
            String date = System.DateTime.Now.Year + "-" + System.DateTime.Now.ToString("MM-dd");

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

            grfFinish.Rows.Count = 1;
            grfFinish.Rows.Count = dt.Rows.Count + 1;
            grfFinish.Cols.Count = 14;
            C1TextBox txt = new C1TextBox();

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

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

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

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

            ContextMenu menuGw = new ContextMenu();

            grfFinish.ContextMenu = menuGw;

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

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

            grfFinish.Cols[colID].Visible            = false;
            grfFinish.Cols[colPttId].Visible         = false;
            grfFinish.Cols[colVn].Visible            = false;
            grfFinish.Cols[colDtr].Visible           = false;
            grfFinish.Cols[colStatusNurse].Visible   = false;
            grfFinish.Cols[colStatusCashier].Visible = false;

            grfFinish.Cols[colVNshow].AllowEditing  = false;
            grfFinish.Cols[colPttHn].AllowEditing   = false;
            grfFinish.Cols[colPttName].AllowEditing = false;
            grfFinish.Cols[colVsDate].AllowEditing  = false;
            grfFinish.Cols[colVsTime].AllowEditing  = false;
            grfFinish.Cols[colVsEtime].AllowEditing = false;
            grfFinish.Cols[colStatus].AllowEditing  = false;
            //theme1.SetTheme(grfFinish, ic.theme);
        }
예제 #3
0
        private void setGrfQue(String search)
        {
            //grfDept.Rows.Count = 7;
            //grfQue.Clear();
            DataTable dt1 = new DataTable();
            DataTable dt  = new DataTable();

            if (search.Equals(""))
            {
                String   date = "";
                DateTime dt11 = new DateTime();
                if (DateTime.TryParse(txtDateStart.Text, out dt11))
                {
                    //dt11 = dt11.AddDays(-1);
                    date = dt11.Year + "-" + dt11.ToString("MM-dd");
                    //dt = ic.ivfDB.ovsDB.selectByDate(date);
                }
                if (chkAll.Checked)
                {
                    //dt = ic.ivfDB.ovsDB.selectByReceptionSend();      //      -0020
                    //dt = ic.ivfDB.vsDB.selectByReceptionSend();        //      +0020                else
                    //dt = ic.ivfDB.ovsDB.selectByStatusCashierFinish(cboVisitBsp.SelectedItem == null ? "" : ((ComboBoxItem)cboVisitBsp.SelectedItem).Value);      //      -0020
                    dt = ic.ivfDB.vsDB.selectByStatusCashierFinish();        //      +0020
                }
            }
            else
            {
                //grfPtt.DataSource = ic.ivfDB.vsOldDB.selectCurrentVisit(search);
            }

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

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

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

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

            ContextMenu menuGw = new ContextMenu();

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

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

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

            grfQue.Cols[colID].Visible    = false;
            grfQue.Cols[colVn].Visible    = false;
            grfQue.Cols[colPttId].Visible = false;

            grfQue.Cols[colVNshow].AllowEditing  = false;
            grfQue.Cols[colPttHn].AllowEditing   = false;
            grfQue.Cols[colPttName].AllowEditing = false;
            grfQue.Cols[colVsDate].AllowEditing  = false;
            grfQue.Cols[colVsTime].AllowEditing  = false;
            grfQue.Cols[colDtr].AllowEditing     = false;
            //theme1.SetTheme(grfQue, ic.theme);
        }
예제 #4
0
        private void setGrfSearch(String search)
        {
            //grfDept.Rows.Count = 7;
            tC.SelectedTab = tabSearch;
            grfSearch.Clear();
            DataTable dt1 = new DataTable();
            DataTable dt  = new DataTable();

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


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

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

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

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

            ContextMenu menuGw = new ContextMenu();

            grfSearch.ContextMenu = menuGw;

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

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

            grfSearch.Cols[colID].Visible = false;
            //theme1.SetTheme(grfQue, ic.theme);
        }
예제 #5
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);
        }
예제 #6
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;
        }
예제 #7
0
        private void setGrfItem(String itmid, C1FlexGrid grf)
        {
            DataTable dt  = new DataTable();
            long      chk = 0;
            String    re  = "";

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

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

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

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

            grf.Cols[colItmAmt].Visible         = false;
            grf.Cols[colItmAmt].AllowEditing    = false;
            grf.Cols[colItmRemark].AllowEditing = false;
            grf.Cols[colItmDate].AllowEditing   = false;
            grf.Cols[colOnhand].AllowEditing    = false;
            grf.Cols[colItmPrice].AllowEditing  = false;
            grf.Cols[colItmDesc].AllowEditing   = false;
        }
예제 #8
0
        private void setGrfQue(String search)
        {
            //grfDept.Rows.Count = 7;
            //grfStk.Clear();
            grfStk.Rows.Count = 1;
            DataTable dt = new DataTable();

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

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

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

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

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

            ContextMenu menuGw = new ContextMenu();

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

            grfStk.ContextMenu = menuGw;

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

            foreach (DataRow row in dt.Rows)
            {
                try
                {
                    grfStk[i, 0]            = i;
                    grfStk[i, colRecId]     = row["rec_id"].ToString();
                    grfStk[i, colRecDoc]    = row["rec_doc"].ToString();
                    grfStk[i, colRecDate]   = ic.datetoShow(row["rec_date"].ToString());
                    grfStk[i, colRecRemark] = row["remark"].ToString();
                    grfStk[i, colRecStatus] = row["status_stock"].ToString().Equals("1") ? "add receive" : row["status_stock"].ToString().Equals("2") ? "gen stock" : "";
                    grfStk[i, colRecDesc]   = row["description"].ToString();

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

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

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

            //theme1.SetTheme(grfQue, ic.theme);
        }
예제 #9
0
        private void setGrfRx()
        {
            //grfDept.Rows.Count = 7;
            //grfRx.Clear();
            DataTable dt = new DataTable();

            dt = ic.ivfDB.oStkdDB.selectBySockDrug1();

            grfRx.Rows.Count = dt.Rows.Count + 1;
            //grfEmbryo.Rows.Count = dt.Rows.Count + 1;
            //grfRx.DataSource = dt;
            grfRx.Cols.Count = 9;
            CellStyle cs = grfRx.Styles.Add("bool");

            cs.DataType   = typeof(bool);
            cs.ImageAlign = ImageAlignEnum.LeftCenter;

            grfRx.Cols[colRxName].Width    = 300;
            grfRx.Cols[colRxInclude].Width = 60;
            grfRx.Cols[colRxPrice].Width   = 80;
            grfRx.Cols[colRxRemark].Width  = 100;
            grfRx.Cols[colRxUsE].Width     = 400;
            grfRx.Cols[colRxUsT].Width     = 400;
            grfRx.Cols[colRxQty].Width     = 60;

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



            CellRange rg = grfRx.GetCellRange(2, colBlInclude, grfRx.Rows.Count - 1, colBlInclude);

            rg.Style = cs;
            rg.Style = grfRx.Styles["bool"];
            for (int col = 0; col < dt.Columns.Count; ++col)
            {
                grfRx.Cols[col + 1].DataType = dt.Columns[col].DataType;
                grfRx.Cols[col + 1].Caption  = dt.Columns[col].ColumnName;
                grfRx.Cols[col + 1].Name     = dt.Columns[col].ColumnName;
            }
            grfRx.Cols[colRxName].Caption    = "Name";
            grfRx.Cols[colRxInclude].Caption = "Include";
            grfRx.Cols[colRxPrice].Caption   = "Price";
            grfRx.Cols[colRxQty].Caption     = "QTY";
            grfRx.Cols[colRxRemark].Caption  = "Remark";
            grfRx.Cols[colRxUsE].Caption     = "Usage English.";
            grfRx.Cols[colRxUsT].Caption     = "Usage Thai";
            int     i   = 0;
            decimal aaa = 0;

            foreach (DataRow row in dt.Rows)
            {
                try
                {
                    i++;
                    if (i == 1)
                    {
                        continue;
                    }
                    grfRx[i, colBlId]   = row["DUID"].ToString();
                    grfRx[i, colRxName] = row["DUName"].ToString();
                    Decimal.TryParse(row[ic.ivfDB.oLabiDB.labI.Price].ToString(), out aaa);
                    grfRx[i, colRxPrice]  = aaa.ToString("#,##0");
                    grfRx[i, colRxQty]    = "1";
                    grfRx[i, colBlRemark] = "";
                    grfRx[i, colRxUsE]    = row["EUsage"].ToString();
                    grfRx[i, colRxUsT]    = row["TUsage"].ToString();
                    //Row row1 = grfRx.Rows.Add();
                    //row1[colBlId] = row["DUID"].ToString();
                    //row1[colBlName] = row["DUName"].ToString();
                    //row1[colBlPrice] = row["Price"].ToString();
                    //row1[colBlRemark] = "";
                    //if (i == 1) continue;
                    //if (i == 2) continue;
                    grfRx[i, 0] = (i - 2);
                }
                catch (Exception ex)
                {
                    String err = "";
                }
            }
            CellNoteManager mgr = new CellNoteManager(grfRx);

            grfRx.Cols[colBlId].Visible     = false;
            grfRx.Cols[colBlRemark].Visible = false;
            //grfRx.Cols[colBlPrice].Visible = false;
            //FilterRowUnBound fr = new FilterRowUnBound(grfRx);
            grfRx.Cols[colBlName].AllowEditing   = false;
            grfRx.Cols[colBlPrice].AllowEditing  = false;
            grfRx.Cols[colBlRemark].AllowEditing = true;
            grfRx.Cols[colRxUsE].AllowEditing    = true;
            grfRx.Cols[colRxUsT].AllowEditing    = true;

            FilterRow fr = new FilterRow(grfRx);

            grfRx.AllowFiltering = true;
            grfRx.AfterFilter   += GrfRx_AfterFilter;
            //theme1.SetTheme(grfFinish, ic.theme);
        }
예제 #10
0
        private void setGrfOrder(String vn)
        {
            //grfDept.Rows.Count = 7;
            grfOrder.Clear();
            DataTable dtAll = new DataTable();
            DataTable dtbl  = new DataTable();
            DataTable dtse  = new DataTable();
            DataTable dtpx  = new DataTable();
            DataTable dtpkg = new DataTable();

            grfOrder.Rows.Count = 1;
            if (vn.Length <= 0)
            {
                return;
            }
            dtbl = ic.ivfDB.oJlabdDB.selectByVN(vn);
            dtse = ic.ivfDB.ojsdDB.selectByVN(vn);
            //dtpx = ic.ivfDB.oJpxdDB.selectByVN(vn);
            dtpx = ic.ivfDB.oJpxdDB.selectSumQtyByVN(vn);
            //dtpkg = ic.ivfDB.opkgsDB.selectByVN(vn);
            dtpkg = ic.ivfDB.opkgsDB.selectByPID(pttId);    // ต้องดึงตาม HN เพราะ ถ้ามีงวดการชำระ

            //grfExpn.Rows.Count = dt.Rows.Count + 1;
            //grfEmbryo.Rows.Count = dt.Rows.Count + 1;

            dtAll.Columns.Add("id", typeof(String));
            dtAll.Columns.Add("lgid", typeof(String));
            dtAll.Columns.Add("name", typeof(String));
            dtAll.Columns.Add("price", typeof(String));
            dtAll.Columns.Add("qty", typeof(String));
            dtAll.Columns.Add("status", typeof(String));
            dtAll.Columns.Add("row1", typeof(int));
            dtAll.Columns.Add("itmid", typeof(String));
            dtAll.Columns.Add("extra", typeof(String));
            dtAll.Columns.Add("usage", typeof(String));
            dtAll.Columns.Add("usageE", typeof(String));
            int i = 0;

            foreach (DataRow row in dtbl.Rows)
            {
                DataRow row1 = dtAll.NewRow();
                row1["id"]     = row["ID"];
                row1["itmid"]  = row["LID"];
                row1["lgid"]   = row["LGID"];
                row1["name"]   = row["LName"];
                row1["price"]  = row["Price"];
                row1["qty"]    = row["QTY"];
                row1["row1"]   = row["row1"];
                row1["extra"]  = row["Extra"];
                row1["usage"]  = "";
                row1["usageE"] = "";
                if (row["LGID"].ToString().Equals("1"))
                {
                    row1["status"] = "bloodlab";
                }
                else if (row["LGID"].ToString().Equals("2"))
                {
                    row1["status"] = "";
                }
                else if (row["LGID"].ToString().Equals("3"))
                {
                    row1["status"] = "Sperm Lab";
                }
                else if (row["LGID"].ToString().Equals("4"))
                {
                    row1["status"] = "Embryo Lab";
                }
                else if (row["LGID"].ToString().Equals("5"))
                {
                    row1["status"] = "Genetic Lab";
                }
                dtAll.Rows.InsertAt(row1, i);
                i++;
            }
            foreach (DataRow row in dtse.Rows)
            {
                DataRow row1 = dtAll.NewRow();
                row1["id"]     = row["ID"];
                row1["itmid"]  = row["SID"];
                row1["lgid"]   = "";
                row1["name"]   = row["SName"];
                row1["price"]  = row["Price"];
                row1["qty"]    = row["qty"];
                row1["status"] = "specialitem";
                row1["row1"]   = row["row1"];
                row1["extra"]  = row["Extra"];
                row1["usage"]  = "";
                row1["usageE"] = "";
                dtAll.Rows.InsertAt(row1, i);
                i++;
            }
            foreach (DataRow row in dtpx.Rows)
            {
                DataRow row1 = dtAll.NewRow();
                row1["id"]     = row["ID"];
                row1["itmid"]  = row["DUID"];
                row1["lgid"]   = "";
                row1["name"]   = row["DUName"];
                row1["price"]  = row["Price"];
                row1["qty"]    = row["QTY"];
                row1["status"] = "px";
                row1["row1"]   = row["row1"];
                row1["extra"]  = row["Extra"];
                row1["usage"]  = row["TUsage"];
                row1["usageE"] = row["EUsage"];
                dtAll.Rows.InsertAt(row1, i);
                i++;
            }
            foreach (DataRow row in dtpkg.Rows)
            {
                String  bill1 = "", bill2 = "", bill3 = "", bill4 = "", times = "", name = "";
                Decimal price = 0, pay1 = 0, pay2 = 0, pay3 = 0, pay4 = 0, pay = 0;
                Decimal.TryParse(row["price"].ToString(), out price);
                Decimal.TryParse(row["payment1"].ToString(), out pay1);
                Decimal.TryParse(row["payment2"].ToString(), out pay2);
                Decimal.TryParse(row["payment3"].ToString(), out pay3);
                Decimal.TryParse(row["payment4"].ToString(), out pay4);
                times = row["payment_times"].ToString();
                bill1 = row["P1BDetailID"].ToString();
                bill2 = row["P2BDetailID"].ToString();
                bill3 = row["P3BDetailID"].ToString();
                bill4 = row["P4BDetailID"].ToString();
                name  = row["PackageName"].ToString();
                if (price > 0)
                {
                    if ((pay1 > 0) && bill1.Equals("0"))
                    {
                        pay   = pay1;
                        name += "1/" + times;
                    }
                    else if ((pay2 > 0) && bill2.Equals("0"))
                    {
                        pay   = pay2;
                        name += "2/" + times;
                    }
                    else if ((pay3 > 0) && bill3.Equals("0"))
                    {
                        pay   = pay3;
                        name += "3/" + times;
                    }
                    else if ((pay4 > 0) && bill4.Equals("0"))
                    {
                        pay   = pay4;
                        name += "4/" + times;
                    }
                    DataRow row1 = dtAll.NewRow();
                    row1["id"]     = row["PCKSID"];
                    row1["itmid"]  = row["PCKID"];
                    row1["lgid"]   = "";
                    row1["name"]   = name;
                    row1["price"]  = pay;
                    row1["qty"]    = "1";
                    row1["status"] = "package";
                    row1["row1"]   = row["row1"];
                    row1["extra"]  = "0";
                    row1["usage"]  = "";
                    row1["usageE"] = "";
                    dtAll.Rows.InsertAt(row1, i);
                    i++;
                }
            }
            dtAll.DefaultView.Sort = "row1";
            DataView view = dtAll.DefaultView;

            view.Sort = "row1 ASC";
            DataTable sortedDate = view.ToTable();

            //grfOrder.DataSource = dtAll;
            grfOrder.Cols.Count = 14;
            //C1TextBox txt = new C1TextBox();
            //C1CheckBox chk = new C1CheckBox();
            //chk.Text = "Include Package";
            //C1ComboBox cboproce = new C1ComboBox();
            //ic.ivfDB.itmDB.setCboItem(cboproce);
            //grfOrder.Cols[1].Editor = txt;
            //grfOrder.Cols[colOrderPrice].Editor = txt;
            //grfOrder.Cols[colOrderQTY].Editor = txt;
            //grfOrder.Cols[colRxId].Editor = txt;

            grfOrder.Cols[colOrdName].Width    = 280;
            grfOrder.Cols[colOrdPrice].Width   = 120;
            grfOrder.Cols[colOrdQty].Width     = 80;
            grfOrder.Cols[colOrdUsT].Width     = 500;
            grfOrder.Cols[colOrdUsE].Width     = 500;
            grfOrder.Cols[colOrdInclude].Width = 60;
            grfOrder.Cols[colOrdstatus].Width  = 60;

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

            grfOrder.Cols[colOrdName].Caption    = "Name.";
            grfOrder.Cols[colOrdPrice].Caption   = "Price";
            grfOrder.Cols[colOrdQty].Caption     = "QTY";
            grfOrder.Cols[colOrdInclude].Caption = "Include Package";
            grfOrder.Cols[colOrdUsT].Caption     = "Usage";
            grfOrder.Cols[colOrdUsE].Caption     = "Usage";
            grfOrder.Cols[colOrdAmt].Caption     = "Amount";
            //grfOrder.SubtotalPosition = SubtotalPositionEnum.BelowData;
            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;
            i = 1;
            grfOrder.Rows.Count = 1;
            Decimal inc = 0, ext = 0;

            foreach (DataRow row in sortedDate.Rows)
            {
                try
                {
                    Decimal price = 0, qty = 0;
                    Row     row1 = grfOrder.Rows.Add();
                    row1[colOrdid]      = row["id"].ToString();
                    row1[colOrdlpid]    = row["lgid"].ToString();
                    row1[colOrdName]    = row["name"].ToString();
                    row1[colOrdUsT]     = row["usage"].ToString();
                    row1[colOrdUsE]     = row["usageE"].ToString();
                    row1[colOrdstatus]  = row["status"].ToString();
                    row1[colOrdrow1]    = row["row1"].ToString();
                    row1[colOrditmid]   = row["itmid"].ToString();
                    row1[colOrdInclude] = row["extra"].ToString().Equals("1") ? "Extra" : "Include";

                    Decimal.TryParse(row["price"].ToString(), out price);
                    Decimal.TryParse(row["qty"].ToString(), out qty);
                    row1[colOrdPrice] = price.ToString("#,###.00");
                    row1[colOrdQty]   = qty.ToString("#,###.00");
                    row1[colOrdAmt]   = (price * qty).ToString("#,###.00");
                    if (row["extra"].ToString().Equals("1"))
                    {
                        ext += (price * qty);
                    }
                    else
                    {
                        if (row["status"].ToString().Equals("package"))
                        {
                            inc += (price * qty);
                        }
                    }
                    row1[colOrdEdit] = "";
                    row1[0]          = (i);
                    //if (i % 2 == 0)
                    //    grfPtt.Rows[i].StyleNew.BackColor = color;
                    i++;
                }
                catch (Exception ex)
                {
                    String err = "";
                }
            }
            rowOrder = grfOrder.Rows.Count;
            CellNoteManager mgr = new CellNoteManager(grfOrder);

            grfOrder.Cols[colOrdrow1].Visible  = false;
            grfOrder.Cols[colOrdlpid].Visible  = false;
            grfOrder.Cols[colOrdid].Visible    = false;
            grfOrder.Cols[colOrdEdit].Visible  = false;
            grfOrder.Cols[colOrditmid].Visible = false;
            if (cboLangSticker.Text.Trim().Equals("English"))
            {
                grfOrder.Cols[colOrdUsT].Visible = false;
                grfOrder.Cols[colOrdUsE].Visible = true;
            }
            else
            {
                grfOrder.Cols[colOrdUsT].Visible = true;
                grfOrder.Cols[colOrdUsE].Visible = false;
            }

            grfOrder.Cols[colOrdUsT].AllowEditing   = true;
            grfOrder.Cols[colOrdUsE].AllowEditing   = true;
            grfOrder.Cols[colOrdName].AllowEditing  = false;
            grfOrder.Cols[colOrdPrice].AllowEditing = false;
            grfOrder.Cols[colOrdQty].AllowEditing   = false;
            //theme1.SetTheme(grfFinish, ic.theme);
            //UpdateTotals();
            String  total  = "";
            Decimal total1 = 0;

            //total = grfOrder[grfOrder.Rows.Count - 1, colOrdAmt] != null ? grfOrder[grfOrder.Rows.Count - 1, colOrdAmt].ToString() : "";
            total1 = inc + ext;
            //Decimal.TryParse(total, out total1);
            txtTotal.Value   = total1.ToString("#,###.00");
            txtInclude.Value = inc.ToString("#,###.00");
            txtExtra.Value   = ext.ToString("#,###.00");
        }
예제 #11
0
        private void setGrfReq()
        {
            gB.Enabled        = false;
            groupBox1.Enabled = false;
            try
            {
                String   startdate = "", enddate = "";
                DateTime datestart, dateend;
                String   datestart1 = "", dateend1 = "";
                if (DateTime.TryParse(txtDateStart.Text, out datestart))
                {
                    datestart1 = datestart.ToString("yyyy-MM-dd");
                }
                else
                {
                    datestart1 = ic.datetoDB(txtDateStart.Text);
                }
                if (DateTime.TryParse(txtDateEnd.Text, out datestart))
                {
                    dateend1 = datestart.ToString("yyyy-MM-dd");
                }
                else
                {
                    dateend1 = ic.datetoDB(txtDateEnd.Text);
                }
                grfReq.Clear();
                grfReq.Cols.Count = 15;
                grfReq.Rows.Count = 1;
                DataTable dt = new DataTable();
                grfReq.DataSource = null;
                dt = ic.ivfDB.oJsDB.selectByStatusUnAccept1(datestart1, dateend1);
                //grfExpn.Rows.Count = dt.Rows.Count + 1;
                //grfCu.Rows.Count = 41;
                //grfCu.Cols.Count = 4;
                C1TextBox txt = new C1TextBox();
                //C1ComboBox cboproce = new C1ComboBox();
                //ic.ivfDB.itmDB.setCboItem(cboproce);
                grfReq.Cols[colRqReqNum].Editor  = txt;
                grfReq.Cols[colRqHn].Editor      = txt;
                grfReq.Cols[colRqVn].Editor      = txt;
                grfReq.Cols[colRqItmName].Editor = txt;

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

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

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

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

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

            gB.Enabled        = true;
            groupBox1.Enabled = true;
        }
예제 #12
0
        private void setGrfOnhand()
        {
            FrmWaiting frmW = new FrmWaiting();

            frmW.Show();

            long   chk = 0;
            String re  = "";

            re = mposC.mposDB.matDB.genStock();
            if (long.TryParse(re, out chk))
            {
                //btnDoc.Enabled = false;
                //MessageBox.Show("gen stock เรียบร้อย", "");
                //mposC.mposDB.matrdDB.voidMatr(txtMatrId.Text, "");
            }

            grfOrder.Clear();
            DataTable dt = new DataTable();

            dt = mposC.mposDB.matDB.selectAll();
            //grfExpn.Rows.Count = dt.Rows.Count + 1;
            grfOrder.Rows.Count = dt.Rows.Count + 1;
            //grfSperm.DataSource = dt;
            grfOrder.Cols.Count = 7;

            grfOrder.Cols[colCode].Caption   = "CODE";
            grfOrder.Cols[colName].Caption   = "ชื่อ";
            grfOrder.Cols[colPrice].Caption  = "Price";
            grfOrder.Cols[colWeight].Caption = "Weight";
            grfOrder.Cols[colOnhand].Caption = "OnHand";
            grfOrder.Cols[colCode].Width     = 120;
            grfOrder.Cols[colName].Width     = 200;
            grfOrder.Cols[colPrice].Width    = 120;
            grfOrder.Cols[colWeight].Width   = 120;
            grfOrder.Cols[colOnhand].Width   = 120;

            grfOrder.ShowCursor = true;

            int     i   = 0;
            decimal aaa = 0;

            foreach (DataRow row in dt.Rows)
            {
                try
                {
                    i++;
                    //if (i == 1) continue;
                    //Decimal.TryParse(row[ic.ivfDB.oLabiDB.labI.Price].ToString(), out aaa);
                    grfOrder[i, colId]     = row[mposC.mposDB.matDB.mat.material_id].ToString();
                    grfOrder[i, colCode]   = row[mposC.mposDB.matDB.mat.material_code].ToString();
                    grfOrder[i, colName]   = row[mposC.mposDB.matDB.mat.material_name].ToString();
                    grfOrder[i, colPrice]  = row[mposC.mposDB.matDB.mat.price].ToString();
                    grfOrder[i, colWeight] = row[mposC.mposDB.matDB.mat.weight].ToString();
                    grfOrder[i, colOnhand] = row[mposC.mposDB.matDB.mat.on_hand].ToString();
                    //grfOrder[i, colRsLotInput] = row[ic.ivfDB.lbresDB.lbRes.lot_input].ToString();

                    row[0] = (i - 2);
                }
                catch (Exception ex)
                {
                    String err = "";
                }
            }
            CellNoteManager mgr = new CellNoteManager(grfOrder);

            grfOrder.Cols[colId].Visible = false;
            //grfOrder.Cols[colRsLabId].Visible = false;
            //grfOrder.Cols[colRsReqId].Visible = false;
            //grfOrder.Cols[colRsEdit].Visible = false;
            //grfOrder.Cols[colRsLotInput].Visible = false;

            grfOrder.Cols[colCode].AllowEditing   = false;
            grfOrder.Cols[colOnhand].AllowEditing = false;
            grfOrder.Cols[colName].AllowEditing   = false;
            grfOrder.Cols[colPrice].AllowEditing  = false;
            grfOrder.Cols[colWeight].AllowEditing = true;

            frmW.Dispose();
            //theme1.SetTheme(grfFinish, ic.theme);
        }
예제 #13
0
        private void setGrf(C1FlexGrid grf, String matid)
        {
            grf.Clear();
            DataTable dt = new DataTable();

            dt = mposC.mposDB.stkDB.selectByMatId(matid);
            //grfExpn.Rows.Count = dt.Rows.Count + 1;
            grf.Rows.Count = dt.Rows.Count + 1;
            //grfSperm.DataSource = dt;
            grf.Cols.Count = 7;

            grf.Cols[colCode].Caption   = "วันที่";
            grf.Cols[colName].Caption   = "รายการ";
            grf.Cols[colPrice].Caption  = "Price";
            grf.Cols[colWeight].Caption = "Weight";
            grf.Cols[colOnhand].Caption = "OnHand";
            grf.Cols[colCode].Width     = 120;
            grf.Cols[colName].Width     = 200;
            grf.Cols[colPrice].Width    = 120;
            grf.Cols[colWeight].Width   = 120;
            grf.Cols[colOnhand].Width   = 120;

            grf.ShowCursor = true;

            int     i   = 0;
            decimal aaa = 0;

            foreach (DataRow row in dt.Rows)
            {
                try
                {
                    i++;
                    //if (i == 1) continue;
                    //Decimal.TryParse(row[ic.ivfDB.oLabiDB.labI.Price].ToString(), out aaa);
                    grf[i, colId]   = row[mposC.mposDB.stkDB.stkc.stock_id].ToString();
                    grf[i, colCode] = mposC.datetoShow(row[mposC.mposDB.stkDB.stkc.rec_draw_date].ToString());
                    grf[i, colName] = row[mposC.mposDB.stkDB.stkc.status_rec_draw].ToString().Equals("1")
                        ? "รับเข้า" : row[mposC.mposDB.stkDB.stkc.status_rec_draw].ToString().Equals("2")
                        ? "เบิกจ่าย" : row[mposC.mposDB.stkDB.stkc.status_rec_draw].ToString().Equals("3") ? "ขาย" : "อื่นๆ";
                    grf[i, colPrice]  = row[mposC.mposDB.stkDB.stkc.price].ToString();
                    grf[i, colWeight] = row[mposC.mposDB.stkDB.stkc.weight].ToString();
                    grf[i, colOnhand] = row[mposC.mposDB.stkDB.stkc.onhand].ToString();
                    //grfOrder[i, colRsLotInput] = row[ic.ivfDB.lbresDB.lbRes.lot_input].ToString();

                    row[0] = (i - 2);
                }
                catch (Exception ex)
                {
                    String err = "";
                }
            }
            CellNoteManager mgr = new CellNoteManager(grf);

            grf.Cols[colId].Visible = false;
            //grfOrder.Cols[colRsLabId].Visible = false;
            //grfOrder.Cols[colRsReqId].Visible = false;
            //grfOrder.Cols[colRsEdit].Visible = false;
            //grfOrder.Cols[colRsLotInput].Visible = false;

            grf.Cols[colCode].AllowEditing   = false;
            grf.Cols[colOnhand].AllowEditing = false;
            grf.Cols[colName].AllowEditing   = false;
            grf.Cols[colPrice].AllowEditing  = false;
            grf.Cols[colWeight].AllowEditing = true;

            //theme1.SetTheme(grfFinish, ic.theme);
        }
예제 #14
0
        private void setGrfSearch(String search)
        {
            //grfDept.Rows.Count = 7;
            tC.SelectedTab = tabSearch;
            //grfSearch.Clear();
            DataTable dt1 = new DataTable();
            DataTable dt  = new DataTable();

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

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

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

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

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

            ContextMenu menuGw = new ContextMenu();

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

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

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

            grfSearch.Cols[colID].Visible = false;

            grfSearch.Cols[colVNshow].AllowEditing  = false;
            grfSearch.Cols[colPttHn].AllowEditing   = false;
            grfSearch.Cols[colPttName].AllowEditing = false;
            grfSearch.Cols[colVsDate].AllowEditing  = false;
            grfSearch.Cols[colVsTime].AllowEditing  = false;
            grfSearch.Cols[colVsEtime].AllowEditing = false;
            grfSearch.Cols[colStatus].AllowEditing  = false;
            grfSearch.Cols[colPttId].AllowEditing   = false;
            //theme1.SetTheme(grfQue, ic.theme);
        }
예제 #15
0
        private void setGrfStk(String column)
        {
            //grfDept.Rows.Count = 7;
            //grfStk.Clear();
            grfStk.Rows.Count = 1;
            DataTable dt = new DataTable();

            dt = ic.ivfDB.oStkdDB.selectAll2(column);
            //grfBloodLab.Rows.Count = dt.Rows.Count + 1;
            grfStk.Rows.Count = dt.Rows.Count + 1;
            //grfBloodLab.DataSource = dt;
            grfStk.Cols.Count = 8;

            //CellStyle cs = grfStk.Styles.Add("bool");
            //cs.DataType = typeof(bool);
            //cs.ImageAlign = ImageAlignEnum.LeftCenter;

            grfStk.Cols[colName].Width        = 330;
            grfStk.Cols[colUnit].Width        = 80;
            grfStk.Cols[colOrderPoint].Width  = 80;
            grfStk.Cols[colOnhand].Width      = 80;
            grfStk.Cols[colOrderPoint].Width  = 80;
            grfStk.Cols[colOrderAmount].Width = 80;

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

            //CellRange rg = grfStk.GetCellRange(2, colName, grfStk.Rows.Count - 1, colPrice);
            //rg.Style = cs;
            //rg.Style = grfStk.Styles["bool"];
            for (int col = 0; col < dt.Columns.Count; ++col)
            {
                grfStk.Cols[col + 1].DataType = dt.Columns[col].DataType;
                grfStk.Cols[col + 1].Caption  = dt.Columns[col].ColumnName;
                grfStk.Cols[col + 1].Name     = dt.Columns[col].ColumnName;
            }
            grfStk.Cols[colName].Caption        = "Name";
            grfStk.Cols[colUnit].Caption        = "Unit";
            grfStk.Cols[colOnhand].Caption      = "On Hand";
            grfStk.Cols[colOrderPoint].Caption  = "จุดสั่งซื้อ";
            grfStk.Cols[colOrderAmount].Caption = "จำนวนสั่งซื้อ";
            grfStk.Cols[colPrice].Caption       = "Price";
            int     i   = 0;
            decimal aaa = 0;

            foreach (DataRow row in dt.Rows)
            {
                try
                {
                    i++;
                    if (i == 1)
                    {
                        continue;
                    }
                    //if (i == 2) continue;
                    grfStk[i, 0] = (i - 1);
                    Decimal.TryParse(row[ic.ivfDB.oStkdDB.ostkD.Price].ToString(), out aaa);
                    grfStk[i, colPrice]       = aaa.ToString("#,##0");
                    grfStk[i, colId]          = row[ic.ivfDB.oStkdDB.ostkD.DUID].ToString();
                    grfStk[i, colName]        = row[ic.ivfDB.oStkdDB.ostkD.DUName].ToString();
                    grfStk[i, colUnit]        = row[ic.ivfDB.oStkdDB.ostkD.UnitType].ToString();
                    grfStk[i, colOrderPoint]  = row[ic.ivfDB.oStkdDB.ostkD.order_point + column].ToString();
                    grfStk[i, colOrderAmount] = row[ic.ivfDB.oStkdDB.ostkD.order_amount + column].ToString();
                    grfStk[i, colOnhand]      = row[ic.ivfDB.oStkdDB.ostkD.on_hand + column].ToString();
                }
                catch (Exception ex)
                {
                    String err = "";
                }
            }
            CellNoteManager mgr = new CellNoteManager(grfStk);

            grfStk.Cols[colId].Visible = false;
            //grfBloodLab.Cols[colBlInclude].Visible = false;
            //grfBloodLab.Cols[colBlPrice].Visible = false;

            grfStk.Cols[colName].AllowEditing        = false;
            grfStk.Cols[colOrderPoint].AllowEditing  = false;
            grfStk.Cols[colOrderAmount].AllowEditing = false;
            grfStk.Cols[colOnhand].AllowEditing      = false;

            FilterRow fr = new FilterRow(grfStk);

            grfStk.AllowFiltering = true;
            grfStk.AfterFilter   += GrfStk_AfterFilter;
            //theme1.SetTheme(grfFinish, ic.theme);
        }
예제 #16
0
        private void setGrfOpera()
        {
            //grfDept.Rows.Count = 7;
            grfOpera.Clear();
            DataTable dt = new DataTable();

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

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

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

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

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

            ContextMenu menuGw = new ContextMenu();

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

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

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

            grfOpera.ContextMenu = menuGw;

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

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

            grfOpera.Cols[colQueId].Visible           = false;
            grfOpera.Cols[colQueHn].AllowEditing      = false;
            grfOpera.Cols[colQueName].AllowEditing    = false;
            grfOpera.Cols[colQueOpera].AllowEditing   = false;
            grfOpera.Cols[colQueOrDate].AllowEditing  = false;
            grfOpera.Cols[colQueOrTime].AllowEditing  = false;
            grfOpera.Cols[colQueSurgeon].AllowEditing = false;
            //theme1.SetTheme(grfQue, ic.theme);
        }
예제 #17
0
        private void setGrf2019New()
        {
            //grfDept.Rows.Count = 7;
            //grf2019.Clear();
            grf2019.Rows.Count = 1;
            DataTable dt = new DataTable();

            dt = ic.ivfDB.oStkdDB.selectAllOnhand();
            //grfBloodLab.Rows.Count = dt.Rows.Count + 1;
            grf2019.Rows.Count = dt.Rows.Count + 1;
            //grfBloodLab.DataSource = dt;
            grf2019.Cols.Count = 7;

            //CellStyle cs = grf2019.Styles.Add("bool");
            //cs.DataType = typeof(bool);
            //cs.ImageAlign = ImageAlignEnum.LeftCenter;

            grf2019.Cols[colStkName].Width   = 330;
            grf2019.Cols[colStkOnhand].Width = 80;
            grf2019.Cols[colStkStatus].Width = 80;
            grf2019.Cols[colStkRemark].Width = 80;
            grf2019.Cols[colStkUnit].Width   = 80;

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

            //CellRange rg = grf2019.GetCellRange(2, colName, grf2019.Rows.Count - 1, colPrice);
            //rg.Style = cs;
            //rg.Style = grf2019.Styles["bool"];
            for (int col = 0; col < dt.Columns.Count; ++col)
            {
                grf2019.Cols[col + 1].DataType = dt.Columns[col].DataType;
                grf2019.Cols[col + 1].Caption  = dt.Columns[col].ColumnName;
                grf2019.Cols[col + 1].Name     = dt.Columns[col].ColumnName;
            }
            grf2019.Cols[colStkName].Caption   = "Name";
            grf2019.Cols[colStkOnhand].Caption = "On Hand";
            grf2019.Cols[colStkStatus].Caption = "Status";
            grf2019.Cols[colStkRemark].Caption = "หมายเหตุ";
            grf2019.Cols[colStkUnit].Caption   = "unit";

            int     i   = 0;
            decimal aaa = 0;

            foreach (DataRow row in dt.Rows)
            {
                try
                {
                    i++;
                    if (i == 1)
                    {
                        continue;
                    }
                    //if (i == 2) continue;
                    grf2019[i, 0] = (i - 1);
                    //Decimal.TryParse(row[ic.ivfDB.oStkdDB.ostkD.Price].ToString(), out aaa);
                    grf2019[i, colStkName]   = row[ic.ivfDB.oStkdDB.ostkD.DUName].ToString();
                    grf2019[i, colStkId]     = row[ic.ivfDB.oStkdDB.ostkD.DUID].ToString();
                    grf2019[i, colStkOnhand] = row[ic.ivfDB.oStkdDB.ostkD.on_hand].ToString();
                    grf2019[i, colStkUnit]   = row[ic.ivfDB.oStkdDB.ostkD.UnitType].ToString();
                    grf2019[i, colStkStatus] = "onhand";
                    grf2019[i, colStkRemark] = "";
                }
                catch (Exception ex)
                {
                    String err = "";
                }
            }
            CellNoteManager mgr = new CellNoteManager(grf2019);

            grf2019.Cols[colStkId].Visible = false;
            //grfBloodLab.Cols[colBlInclude].Visible = false;
            //grfBloodLab.Cols[colBlPrice].Visible = false;

            grf2019.Cols[colStkName].AllowEditing   = false;
            grf2019.Cols[colStkStatus].AllowEditing = false;

            FilterRow fr = new FilterRow(grf2019);

            grf2019.AllowFiltering = true;
            grf2019.AfterFilter   += Grf2019_AfterFilter;
            //theme1.SetTheme(grfFinish, ic.theme);
        }