示例#1
0
        private void initGrfLab()
        {
            grfLab          = new C1FlexGrid();
            grfLab.Font     = fEdit;
            grfLab.Dock     = System.Windows.Forms.DockStyle.Fill;
            grfLab.Location = new System.Drawing.Point(0, 0);

            //FilterRow fr = new FilterRow(grfPosi);
            ContextMenu menuGw = new ContextMenu();

            menuGw.MenuItems.Add("เลือก รายการนี้", new EventHandler(ContextMenu_grflab_select));
            //menuGw.MenuItems.Add("Upload สำเนาบัตรประชาชน ที่มีลายเซ็น", new EventHandler(ContextMenu_grfimg_upload_ptt));
            //menuGw.MenuItems.Add("Upload รูป Passport", new EventHandler(ContextMenu_grfimg_upload_ptt));
            //menuGw.MenuItems.Add("ยกเลิก", new EventHandler(ContextMenu_grfimg_Cancel));
            grfLab.ContextMenu        = menuGw;
            grfLab.AfterRowColChange += GrfLab_AfterRowColChange;
            //grfAgn.CellButtonClick += new C1.Win.C1FlexGrid.RowColEventHandler(this.grfPosi_CellButtonClick);
            //grfAgn.CellChanged += new C1.Win.C1FlexGrid.RowColEventHandler(this.grfPosi_CellChanged);

            panel8.Controls.Add(this.grfLab);

            C1Theme theme = C1ThemeController.GetThemeByName("Office2013Red", false);

            C1ThemeController.ApplyThemeToObject(grfLab, theme);
        }
示例#2
0
        private void initGrfFoodsMaterial()
        {
            grfFooM                     = new C1FlexGrid();
            grfFooM.Font                = fEdit;
            grfFooM.Dock                = System.Windows.Forms.DockStyle.Fill;
            grfFooM.Location            = new System.Drawing.Point(0, 0);
            grfFooM.Rows.Count          = 1;
            grfFooM.Cols[colFmId].Width = 60;

            grfFooM.Cols[colFmName].Width   = 200;
            grfFooM.Cols[colFmprice].Width  = 120;
            grfFooM.Cols[colFmWeight].Width = 120;
            grfFooM.Cols[colFmQty].Width    = 70;

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

            grfFooM.Cols[colFmName].Caption   = "Material";
            grfFooM.Cols[colFmprice].Caption  = "Price";
            grfFooM.Cols[colFmWeight].Caption = "Weight";
            grfFooM.Cols[colFmQty].Caption    = "Qty";
            grfFooM.Cols[colFmTotal].Caption  = "Total";
            //FilterRow fr = new FilterRow(grfPosi);

            grfFooM.CellChanged += GrfFooM_CellChanged;

            pnMaterialAdd.Controls.Add(this.grfFooM);

            C1Theme theme = C1ThemeController.GetThemeByName("Office2013Red", false);

            C1ThemeController.ApplyThemeToObject(grfFooM, theme);
        }
示例#3
0
        private void initGrfStfH()
        {
            grfStf          = new C1FlexGrid();
            grfStf.Font     = fEdit;
            grfStf.Dock     = System.Windows.Forms.DockStyle.Fill;
            grfStf.Location = new System.Drawing.Point(0, 0);

            //FilterRow fr = new FilterRow(grfStf);

            grfStf.AfterDataRefresh  += new System.ComponentModel.ListChangedEventHandler(this.StatusBar_AfterDataRefresh);
            grfStf.CellChanged       += new C1.Win.C1FlexGrid.RowColEventHandler(this.grfStf_CellChanged);
            grfStf.LeaveCell         += new System.EventHandler(this.grfStf_LeaveCell);
            grfStf.AfterRowColChange += new C1.Win.C1FlexGrid.RangeEventHandler(this.grfStf_AfterRowColChange);
            //this.grfCus.AfterRowColChange += new C1.Win.C1FlexGrid.RangeEventHandler(this.grfCus_AfterRowColChange);
            //new C1.Win.C1FlexGrid.RangeEventHandler(this.c1FlexGrid1_AfterRowColChange);
            //splitContainer1.Panel1.Controls.Add(this.grfCus);
            panel2.Controls.Add(this.grfStf);
            //grfCus.ShowThemedHeaders = ShowThemedHeadersEnum.None;
            //grfCus.Styles.Clear();
            //Mac(grfCus.Styles);
            //Controls.Add(sB);
            C1Theme theme = C1ThemeController.GetThemeByName("Office2013Red", false);

            C1ThemeController.ApplyThemeToObject(grfStf, theme);
        }
 private void ApplyTheme()
 {
     if (cmbThemes.SelectedItem != null && _selectedControl != null)
     {
         var displayText = cmbThemes.SelectedItem.DisplayText;
         cmbThemes.Text = displayText;
         C1ThemeController.ApplyThemeToControlTree(_selectedControl, C1ThemeController.GetThemeByName(displayText, false), null, true);
     }
 }
 private void cmbThemes_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (cmbThemes.SelectedIndex == -1)
     {
         return;
     }
     cmbThemes.Text = cmbThemes.SelectedItem.DisplayText;
     C1ThemeController.ApplyThemeToControlTree(pnlSample, C1ThemeController.GetThemeByName((string)cmbThemes.SelectedItem.Value, false), null, true);
 }
示例#6
0
        // apply theme to the FlexPivot page
        private void cbTheme_SelectedIndexChanged(object sender, EventArgs e)
        {
            C1Theme theme = C1ThemeController.GetThemeByName(cbTheme.Text, false);

            if (theme != null)
            {
                C1ThemeController.ApplyThemeToObject(_c1FlexPivotPage, theme);
            }
        }
示例#7
0
 private void ApplyTheme(Control control)
 {
     if (!string.IsNullOrEmpty(ThemeName))
     {
         var theme = C1ThemeController.GetThemeByName(ThemeName, false);
         if (theme != null)
         {
             C1ThemeController.ApplyThemeToControlTree(control, theme);
         }
     }
 }
示例#8
0
 public void ManageLayoutDialog()
 {
     using (var dialog = new ManageLayoutForm(this))
     {
         if (Theme != null)
         {
             C1ThemeController.ApplyThemeToControlTree(dialog, C1ThemeController.GetThemeByName(Theme, false));
         }
         dialog.ShowDialog();
     }
 }
示例#9
0
        private void initGrfInterpret()
        {
            grfInt             = new C1FlexGrid();
            grfInt.Font        = fEdit;
            grfInt.Dock        = System.Windows.Forms.DockStyle.Fill;
            grfInt.Location    = new System.Drawing.Point(0, 0);
            grfInt.ChangeEdit += GrfInt_ChangeEdit;
            //FilterRow fr = new FilterRow(grfPosi);

            gbInterpret.Controls.Add(this.grfInt);

            C1Theme theme = C1ThemeController.GetThemeByName("Office2013Red", false);

            C1ThemeController.ApplyThemeToObject(grfInt, theme);
        }
示例#10
0
 public void RenameLayout(string name)
 {
     using (var dialog = new SaveLayoutForm(name))
     {
         dialog.Text = "Rename Layout";
         if (Theme != null)
         {
             C1ThemeController.ApplyThemeToControlTree(dialog, C1ThemeController.GetThemeByName(Theme, false));
         }
         if (dialog.ShowDialog() == DialogResult.OK && Directory.Exists(_layoutsDir))
         {
             File.Move(GetLayoutPath(name), GetLayoutPath(dialog.FileName));
         }
     }
 }
 private void ApplyTheme(Control control)
 {
     if (!string.IsNullOrEmpty(ThemeName))
     {
         var theme = C1ThemeController.GetThemeByName(ThemeName, false);
         if (theme != null)
         {
             C1ThemeController.ApplyThemeToControlTree(control, theme);
         }
         c1TrueDBGrid1.SuspendLayout();
         for (int i = 0; i < c1TrueDBGrid1.Splits[0].Rows.Count; i++)
         {
             c1TrueDBGrid1.Splits[0].Rows[i].AutoSize();
         }
         c1TrueDBGrid1.ResumeLayout();
     }
 }
示例#12
0
        private void initGrfDept()
        {
            grfDept.Font     = fEdit;
            grfDept.Dock     = System.Windows.Forms.DockStyle.Fill;
            grfDept.Location = new System.Drawing.Point(0, 0);

            FilterRow fr = new FilterRow(grfDept);

            grfDept.AfterRowColChange += new C1.Win.C1FlexGrid.RangeEventHandler(this.grfDept_AfterRowColChange);
            grfDept.CellButtonClick   += new C1.Win.C1FlexGrid.RowColEventHandler(this.grfDept_CellButtonClick);
            grfDept.CellChanged       += new C1.Win.C1FlexGrid.RowColEventHandler(this.grfDept_CellChanged);
            this.Controls.Add(this.grfDept);

            C1Theme theme = C1ThemeController.GetThemeByName("Office2013Red", false);

            C1ThemeController.ApplyThemeToObject(grfDept, theme);
        }
示例#13
0
        private void initGrfContH()
        {
            grfCont          = new C1FlexGrid();
            grfCont.Font     = fEdit;
            grfCont.Dock     = System.Windows.Forms.DockStyle.Fill;
            grfCont.Location = new System.Drawing.Point(0, 0);

            FilterRow fr = new FilterRow(grfCont);

            grfCont.DoubleClick += new System.EventHandler(this.grfCont_DoubleClick);
            //grfBank.CellButtonClick += new C1.Win.C1FlexGrid.RowColEventHandler(this.grfBank_CellButtonClick);

            panel2.Controls.Add(this.grfCont);

            C1Theme theme = C1ThemeController.GetThemeByName("Office2013Red", false);

            C1ThemeController.ApplyThemeToObject(grfCont, theme);
        }
示例#14
0
        private void initGrfDiag()
        {
            grfReq          = new C1FlexGrid();
            grfReq.Font     = fEdit;
            grfReq.Dock     = System.Windows.Forms.DockStyle.Fill;
            grfReq.Location = new System.Drawing.Point(0, 0);

            //FilterRow fr = new FilterRow(grfPosi);

            grfReq.AfterRowColChange += new C1.Win.C1FlexGrid.RangeEventHandler(this.grfPosi_AfterRowColChange);
            //grfAgn.CellButtonClick += new C1.Win.C1FlexGrid.RowColEventHandler(this.grfPosi_CellButtonClick);
            //grfAgn.CellChanged += new C1.Win.C1FlexGrid.RowColEventHandler(this.grfPosi_CellChanged);

            panel5.Controls.Add(this.grfReq);

            C1Theme theme = C1ThemeController.GetThemeByName("Office2013Red", false);

            C1ThemeController.ApplyThemeToObject(grfReq, theme);
        }
示例#15
0
        private void ribbonStyleCombo_ChangeCommitted(object sender, EventArgs e)
        {
            this.SuspendPainting();
            C1Theme theme = null;

            try
            {
                theme = C1ThemeController.GetThemeByName(ribbonStyleCombo.Text, false);
            }
            catch
            {
            }
            if (theme != null)
            {
                C1ThemeController.ApplyThemeToControlTree(this, theme);
            }
            this.ResumePainting();
            this.Activate();
        }
示例#16
0
 public bool SaveLayoutDialog(out string filePath)
 {
     filePath = null;
     using (var dialog = new SaveLayoutForm())
     {
         if (Theme != null)
         {
             C1ThemeController.ApplyThemeToControlTree(dialog, C1ThemeController.GetThemeByName(Theme, false));
         }
         if (dialog.ShowDialog() == DialogResult.OK)
         {
             if (!Directory.Exists(_layoutsDir))
             {
                 Directory.CreateDirectory(_layoutsDir);
             }
             filePath = _layoutsDir + @"\" + dialog.FileName + ".xml";
             return(true);
         }
     }
     return(false);
 }
示例#17
0
        private void initGrfMatr()
        {
            grfMatr          = new C1FlexGrid();
            grfMatr.Font     = fEdit;
            grfMatr.Dock     = System.Windows.Forms.DockStyle.Fill;
            grfMatr.Location = new System.Drawing.Point(0, 0);

            //FilterRow fr = new FilterRow(grfPosi);

            //grfMatr.AfterRowColChange += new C1.Win.C1FlexGrid.RangeEventHandler(this.grfPosi_AfterRowColChange);
            //grfMatr.CellButtonClick += new C1.Win.C1FlexGrid.RowColEventHandler(this.grfPosi_CellButtonClick);
            //grfMatr.CellChanged += GrfMatr_CellChanged;
            grfMatr.AfterEdit    += GrfMatr_AfterEdit;
            grfMatr.ComboCloseUp += GrfMatr_ComboCloseUp;
            panel2.Controls.Add(this.grfMatr);

            setControl();

            C1Theme theme = C1ThemeController.GetThemeByName("Office2013Red", false);

            C1ThemeController.ApplyThemeToObject(grfMatr, theme);
        }
示例#18
0
        private void initGrfStockDrug()
        {
            grfDrug          = new C1FlexGrid();
            grfDrug.Font     = fEdit;
            grfDrug.Dock     = System.Windows.Forms.DockStyle.Fill;
            grfDrug.Location = new System.Drawing.Point(0, 0);

            //FilterRow fr = new FilterRow(grfPosi);

            grfDrug.AfterRowColChange += GrfPkg_AfterRowColChange;
            //grfAgn.CellButtonClick += new C1.Win.C1FlexGrid.RowColEventHandler(this.grfPosi_CellButtonClick);
            //grfAgn.CellChanged += new C1.Win.C1FlexGrid.RowColEventHandler(this.grfPosi_CellChanged);

            panel1.Controls.Add(this.grfDrug);
            FilterRow fr = new FilterRow(grfDrug);

            grfDrug.AllowFiltering = true;
            grfDrug.AfterFilter   += GrfDrug_AfterFilter;
            C1Theme theme = C1ThemeController.GetThemeByName("Office2013Red", false);

            C1ThemeController.ApplyThemeToObject(grfDrug, theme);
        }
        private void BtnCheck2_Click(object sender, EventArgs e)
        {
            int     cnt = 0, cntErr = 0;
            Decimal sum = 0, price1 = 0, net = 0, minus = 0;

            //throw new NotImplementedException();
            pB2.Show();
            pB2.Minimum = 0;
            pB2.Maximum = lItm.Count;
            ConnectDB conn;

            conn         = new ConnectDB(bc.iniC);
            lItmC        = new List <string>();
            lItmE        = new List <string>();
            label11.Text = chkBn1.Checked ? "bangna1" : chkBn2.Checked ? "bangna2" : chkBn5.Checked ? "bangna5" : "";
            label12.Text = cboYear.Text;
            label13.Text = cboMonth.Text;
            label14.Text = cboPeriod.Text;
            Application.DoEvents();
            //foreach (String str in lItm)
            foreach (DataRow str in dtChk.Rows)
            {
                try
                {
                    //String[] itm = str.Split('|');
                    //String[] itm = str.Split('|');
                    String col1 = "", date = "", hn = "", name = "", fntype = "", col6 = "", labname = "", labcode = "", labdate1 = "", labdate = "", labdateOld = "", price = "";
                    //col1 = itm[0];
                    //date = itm[1];
                    //hn = itm[2];
                    //name = itm[3];
                    //fntype = itm[4];
                    //col6 = itm[5];
                    //price = itm[6];
                    //labcode = itm[7];
                    //labname = itm[8];

                    col1    = str["col1"].ToString();
                    date    = str["date"].ToString();
                    hn      = str["hn"].ToString();
                    name    = str["ptt_name"].ToString();
                    fntype  = str["paidtype"].ToString();
                    col6    = str["net_price"].ToString();
                    price   = str["price"].ToString();
                    labcode = str["lab_code"].ToString();
                    labname = str["lab_name"].ToString();

                    labdate1 = (int.Parse(date.Substring(6)) - 543) + "-" + date.Substring(3, 2) + "-" + date.Substring(0, 2);
                    price1   = 0;
                    if (Decimal.TryParse(price, out price1))
                    {
                        sum += price1;
                    }
                    String    sql = "";
                    DataTable dt  = new DataTable();
                    //sql = "select lab_t05.MNC_req_no,LAB_T01.MNC_PRE_NO " +
                    //    "from PATIENT_T01 " +
                    //    "inner join LAB_T01 on LAB_T01.mnc_hn_no = PATIENT_T01.mnc_hn_no " +
                    //    "and LAB_T01.mnc_pre_no = PATIENT_T01.mnc_pre_no " +
                    //    "and LAB_T01.mnc_date = PATIENT_T01.MNC_DATE " +
                    //    "inner join LAB_T05 on lab_t05.MNC_REQ_YR = lab_t01.MNC_REQ_YR " +
                    //    "and lab_t05.MNC_REQ_no = lab_t01.MNC_REQ_no " +
                    //    "and lab_t05.MNC_REQ_dat = lab_t01.MNC_REQ_dat " +
                    //    "where lab_t05.MNC_REQ_DAT >= '" + labdate1 + "' " +
                    //    "and lab_t05.MNC_REQ_DAT <= '" + labdate1 + "' " +
                    //    //"and patient_t01.MNC_STS = 'f' " +
                    //    //"and LAB_T01.MNC_REQ_STS = 'Q' " +
                    //    "and LAB_T01.mnc_hn_no ='" + hn + "' " +
                    //    "and lab_t05.mnc_lb_cd ='" + labcode + "'";
                    sql = "select lab_t02.MNC_req_no,LAB_T01.MNC_PRE_NO " +
                          "from PATIENT_T01 " +
                          "inner join LAB_T01 on LAB_T01.mnc_hn_no = PATIENT_T01.mnc_hn_no " +
                          "and LAB_T01.mnc_pre_no = PATIENT_T01.mnc_pre_no " +
                          "and LAB_T01.mnc_date = PATIENT_T01.MNC_DATE " +
                          "inner join lab_t02 on lab_t02.MNC_REQ_YR = lab_t01.MNC_REQ_YR " +
                          "and lab_t02.MNC_REQ_no = lab_t01.MNC_REQ_no " +
                          "and lab_t02.MNC_REQ_dat = lab_t01.MNC_REQ_dat " +
                          "where lab_t02.MNC_REQ_DAT >= '" + labdate1 + "' " +
                          "and lab_t02.MNC_REQ_DAT <= '" + labdate1 + "' " +
                          //"and patient_t01.MNC_STS = 'f' " +
                          //"and LAB_T01.MNC_REQ_STS = 'Q' " +
                          "and LAB_T01.mnc_hn_no ='" + hn + "' " +
                          "and lab_t02.mnc_lb_cd ='" + labcode + "'";
                    dt = conn.selectData(conn.connMainHIS, sql);
                    if (dt.Rows.Count > 0)
                    {
                        //itm[8] = dt.Rows[0]["MNC_PRE_NO"].ToString();
                        //itm[9] = dt.Rows[0]["MNC_req_no"].ToString();
                        str["status_chk"] = "1";
                        listBox2.Items.Add(date + " " + hn + " " + name + " " + labcode + " " + labname);
                        lItmC.Add(col1 + "|" + date + "|" + hn + "|" + name + "|" + fntype + "|" + col6 + "|" + price + "|" + labcode + "|" + labname + "|" + dt.Rows[0]["MNC_PRE_NO"].ToString() + "|" + dt.Rows[0]["MNC_req_no"].ToString());
                        cnt++;
                        net += price1;
                        if ((cnt % 100) == 0)
                        {
                            Application.DoEvents();
                        }
                    }
                    else
                    {
                        cntErr++;
                        minus += price1;
                        listBox3.Items.Add(date + " " + hn + " " + name + " " + labcode + " " + labname);
                        lItmC.Add(col1 + "|" + date + "|" + hn + "|" + name + "|" + fntype + "|" + col6 + "|" + price + "|" + labcode + "|" + labname + "|0|0|-" + "|-");
                        lItmE.Add(col1 + "|" + date + "|" + hn + "|" + name + "|" + fntype + "|" + col6 + "|" + price + "|" + labcode + "|" + labname + "|0|0|-" + "|-");
                        int cnt1 = 0;
                        foreach (String paid in lPaid)
                        {
                            if (paid.Equals(fntype))
                            {
                                //int cnt2 = 0;
                                lPaidCntErr[cnt1]++;
                                //int.TryParse(lPaidCnt[cnt1],out cnt2);
                            }
                            cnt1++;
                        }
                        //itm[8] = dt.Rows[0]["MNC_PRE_NO"].ToString();
                        //itm[9] = dt.Rows[0]["MNC_req_no"].ToString();
                        //listBox2.Items.Add(itm.ToString());
                    }
                    pB2.Value++;
                }
                catch (Exception ex)
                {
                    MessageBox.Show("ex" + ex.Message, "");
                }
            }
            //Control ctn = this.GetControl("listBoxSum3");
            ListBox listsum = new ListBox();

            foreach (Control ctl in this.Controls)
            {
                if ((ctl is C1DockingTab) && (ctl.Name.Equals("tC")))
                {
                    foreach (Control ctl1 in ctl.Controls)
                    {
                        if ((ctl1 is C1DockingTabPage) && (ctl1.Name.Equals("tab3")))
                        {
                            foreach (Control ctl2 in ctl1.Controls)
                            {
                                if ((ctl2 is Panel) && (ctl2.Name.Equals("panel3")))
                                {
                                    foreach (Control ctl3 in ctl2.Controls)
                                    {
                                        if ((ctl3 is C1DockingTab) && (ctl3.Name.Equals("tC3")))
                                        {
                                            foreach (Control ctl4 in ctl3.Controls)
                                            {
                                                if ((ctl4 is C1DockingTabPage) && (ctl4.Name.Equals("tabsum")))
                                                {
                                                    foreach (Control ctl5 in ctl4.Controls)
                                                    {
                                                        if ((ctl5 is ListBox) && (ctl5.Name.Equals("listBoxSum3")))
                                                        {
                                                            listsum = (ListBox)ctl5;
                                                            listsum.Items.Clear();
                                                            int i = 0;
                                                            foreach (String txt in lPaid)
                                                            {
                                                                listsum.Items.Add(txt + "  จำนวน " + lPaidCnt[i] + " ไม่พบ จำนวน " + lPaidCntErr[i]);
                                                                i++;
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }

            //listsum.Items.Clear();
            //int i = 0;
            //foreach (String txt in lPaid)
            //{
            //    listsum.Items.Add(txt + "  จำนวน " + lPaidCnt[i]+" ไม่พบ จำนวน "+ lPaidCntErr[i]);
            //    i++;
            //}

            pB1.Hide();
            label18.Text    = lItm.Count.ToString();
            label17.Text    = cnt.ToString();
            label16.Text    = cntErr.ToString();
            label15.Text    = sum.ToString("#,###.00");
            label23.Text    = net.ToString("#,###.00");
            label26.Text    = minus.ToString("#,###.00");
            btnTab3.Enabled = true;
            pB2.Hide();
            tC.SelectedTab = tab3;
            setGrf();
            //DataTable dt11 = new DataTable();
            dtChkGrp = GroupBy("paidtype", "paidtype", dtChk);
            setGrf11(dtChkGrp);
            if (dtChkGrp.Rows.Count > 0)
            {
                foreach (DataRow row in dtChkGrp.Rows)
                {
                    C1DockingTabPage tab1 = new C1DockingTabPage();
                    tab1.Text = row["paidtype"].ToString();
                    tC3.TabPages.Add(tab1);
                    C1FlexGrid grf = new C1FlexGrid();
                    grf.Font     = fEdit;
                    grf.Dock     = System.Windows.Forms.DockStyle.Fill;
                    grf.Location = new System.Drawing.Point(0, 0);
                    tab1.Controls.Add(grf);
                    DataRow[] result = dtChk.Select("paidtype = '" + row["paidtype"].ToString() + "'");
                    DataTable dt1    = new DataTable();
                    addColumn(dt1);
                    foreach (DataRow row1 in result)
                    {
                        DataRow row2 = dt1.NewRow();
                        ///row2 = row1;
                        row2["row1"]       = int.Parse(row1["row1"].ToString()) + 1;
                        row2["lab_code"]   = row1["lab_code"];
                        row2["lab_name"]   = row1["lab_name"];
                        row2["qty"]        = row1["qty"];
                        row2["price"]      = row1["price"];
                        row2["net_price"]  = row1["net_price"];
                        row2["amount"]     = row1["amount"];
                        row2["paidtype"]   = row1["paidtype"];
                        row2["status_chk"] = row1["status_chk"];
                        row2["ptt_name"]   = row1["ptt_name"];
                        row2["date"]       = row1["date"];
                        row2["hn"]         = row1["hn"];
                        row2["col1"]       = row1["col1"];
                        dt1.Rows.Add(row2);
                    }
                    DataTable dt2 = new DataTable();
                    dt2 = GroupBy1("lab_code", "lab_code", dt1);
                    foreach (DataRow row3 in dt2.Rows)
                    {
                        DataRow[] result1 = dtChk.Select("lab_code = '" + row3 ["lab_code"].ToString() + "'");
                        if (result.Length > 0)
                        {
                            row3["lab_name"] = result1[0]["lab_name"].ToString();
                        }
                        Console.WriteLine("{0}, {1}", row[0], row[1]);
                    }
                    //dt1.ad
                    grf.DataSource                = dt2;
                    grf.Cols["price"].Visible     = false;
                    grf.Cols["net_price"].Visible = false;
                    grf.Cols["amount"].Visible    = false;
                    grf.Cols["lab_code"].Width    = 100;
                    grf.Cols["lab_name"].Width    = 300;
                    C1Theme theme = C1ThemeController.GetThemeByName("Office2013Red", false);
                    C1ThemeController.ApplyThemeToObject(grf, theme);
                }
            }
            //pB1.Show();
        }