private void initConfig(SSDataControl sc, Form par1) { String monthId = ""; TabPrepare.Text = "เตรียมข้อมูล"; TabGen.Text = "gen Text"; TabRetrive.Text = "ดึงข้อมูล"; //TabPrepare. monthId = System.DateTime.Now.Month.ToString("00"); sC = sc; par = par1; txtTimeCurrent.Text = sC.setTimeCurrent(); txtTimeCurrentRet.Text = txtTimeCurrent.Text; timer1.Interval = 1000 * 60; timer1.Start(); pB1.Hide(); //txtSplit.min //pB2.Hide(); sC.setCboMonth(cboMonth); sC.setCboYear(cboYear); sC.setCboMonth(cboMonthRet); sC.setCboYear(cboYearRet); sC.setCboMonth(cboMonthGen); sC.setCboYear(cboYearGen); cboMonth.SelectedValue = monthId; cboMonthRet.SelectedValue = monthId; txtPath.Value = sc.iniC.pathFile; txtFileNameBD.Text = sc.iniC.FileNameBillDisp + DateTime.Now.ToString("yyyyMMdd") + ".TXT"; txtFileNameBT.Text = sc.iniC.FileNameBillTran + DateTime.Now.ToString("yyyyMMdd") + ".TXT"; txtFileNameOPS.Text = sc.iniC.FileNameOPServices + DateTime.Now.ToString("yyyyMMdd") + ".TXT"; txtHCODE.Text = sc.iniC.HCODE; txtSSOPBIL.Text = sc.iniC.SSOPBIL; txtPeriod.Value = "1001"; txtPeriodSub.Value = "01"; txtEmailSSOPBIL.Value = sc.iniC.EmailSSOPBIL; //txtHName.Value = sc.iniC.HNAME; Encoding iso = Encoding.GetEncoding(encoding); Encoding utf8 = Encoding.UTF8; byte[] utfBytes = utf8.GetBytes("โรงพยาบาล บางนา5"); byte[] isoBytes = Encoding.Convert(utf8, iso, utfBytes); string msg = iso.GetString(isoBytes); txtHName.Value = msg; genFileName(); setChkSplit(); setTxtSplit(); setGrdViewH(); setGrdViewRetH(); setSplitNum(); }
private void timer1_Tick(object sender, EventArgs e) { txtTimeCurrent.Text = sC.setTimeCurrent(); txtTimeCurrentRet.Text = txtTimeCurrent.Text; if (txtTimeCurrent.Text.Equals(txtAutoStartRet.Text)) { //txtTimeStart.Text = sC.setTimeCurrent(); //DateTime startDate = Convert.ToDateTime(System.DateTime.Now).AddDays(-1); btnRet_Click(null, null); //selectCar(startDate.Year.ToString() + "-" + startDate.ToString("MM-dd"), startDate.Year.ToString() + "-" + startDate.ToString("MM-dd")); //txtTimeEnd.Text = tdsC.setTimeCurrent(); } }