static void Main() { Type t = Type.GetType("Cn.Youdundianzi.Share.Util.Motor.MotorSignalSettings"); CSettings settings = (CSettings)ModuleConfig.GetSettings(t, "Test.config"); signLen = new SignLength(); signLen.GAN_LENGTH = settings.SignConfig.GanLength; signLen.XIAN_LENGTH = settings.SignConfig.XianLength; signLen.CHE_LENGTH = settings.SignConfig.CheLength; SimForm simForm = new Cn.Youdundianzi.Share.Util.Sim6G6X4C.SimForm(); ISignalMonitor monitor = SignalMonitorFactory.CreateSignalMonitor("Motor.exe", "Cn.Youdundianzi.Share.Signal.Motor.MotorMonitor", settings); oldData = monitor.CreateMonDate(signLen); monitor.HotKeyHandle = simForm.Handle; monitor.RegMonitor(simForm); Program p = new Program(); monitor.RegMonitor(p); ITranslator translator = TranslatorFactory.CreateTranslater("Motor.exe", "Cn.Youdundianzi.Exam.MotorSignalTranslator", monitor); //IStateManager sm = StateManagerFactory.CreateStateManager("Motor.exe", "Cn.Youdundianzi.Exam.State.MotorState.MotorStateManager", translator, settings); //IStateManager sm = StateManagerFactory.CreateStateManager("Motor.exe", "Cn.Youdundianzi.Exam.State.XA2WMotorState.MotorStateManager", translator, settings); IStateManager sm = StateManagerFactory.CreateStateManager("Motor.exe", "Cn.Youdundianzi.Exam.State.XA3WMotorState.MotorStateManager", translator, settings); sm.CurrentState = sm.EntryState; monitor.Start(); Application.Run(simForm); }
private void frmLptDetailEmployee_Load(object sender, EventArgs e) { crvDetail.ReportSource = reportDocument; //kiem tra tuy chon ExportRepost if (ExportReport) { settings = ModuleConfig.GetSettings(); string reportPart = settings.ReportPath; string Targetfile = reportPart + "\\" + reportName + "_" + reportDate.Month + "_" + reportDate.Year + ".rpt"; FileInfo fil = new FileInfo(Targetfile); if (fil.Exists) { if ( MessageBox.Show("Đã tồn tại báo cáo này, có ghi đè không?", "Thông báo", MessageBoxButtons.YesNo) == DialogResult.Yes) { fil.Delete(); } else { return; } } //reportDocument.SaveAs(Targetfile, true); //Application.DoEvents(); reportDocument.ExportToDisk(ExportFormatType.CrystalReport, Targetfile); } }
// private void RestoreSettings() // { // Setting newSetting; // // try // { // newSetting = ((Setting) WorkingContext.Setting.Restore()); // // } // catch (UserSettingsException ex) // { // // in case of failure, keep current WorkingContext.Settings // MessageBox.Show(ex.ToString()); // newSetting = WorkingContext.Setting; // // } // // WorkingContext.Setting = newSetting; // // UpdateDisplay(); // // } /// <summary> /// Hiển thị thông tin cấu hình /// </summary> // private void UpdateDisplay() // { // txtServer.Text = WorkingContext.Setting.Server; // txtDatabase.Text = WorkingContext.Setting.Database; // txtUserName.Text = WorkingContext.Setting.UserID; // txtPassWord.Text = WorkingContext.Setting.Password; // // txtPicturePath.Text = WorkingContext.Setting.PicturePath; // } /// <summary> /// /// </summary> private void getSettings() { LoadServerCbo(); settings = ModuleConfig.GetSettings(); txtDatabase.Text = settings.Database; txtUserName.Text = settings.UserName; txtPassWord.Text = settings.Password; txtServer.Text = settings.Server; txtPicturePath.Text = settings.PicturePath; txtReportPath.Text = settings.ReportPath; switch (settings.Language) { case "en-US": rdoEnglish.Checked = true; break; case "vi-VN": rdoVietnamese.Checked = true; break; case "ja-JP": rdoJapanese.Checked = true; break; } }
public void ShowInsuranceC47(DataSet ds, int IMonth, int IYear) { //ReportDocument rptDoc = new ReportDocument(); ReportDocument rptDoc = null; //rptDoc.Load(@"Reports\BHXH\InsuranceC47.rpt"); rptDoc = new Reports.BHXH.InsuranceC47(); rptDoc.Refresh(); rptDoc.SetDatabaseLogon(WorkingContext.Setting.UserName, WorkingContext.Setting.Password, WorkingContext.Setting.Server, WorkingContext.Setting.Database); rptDoc.SetDataSource(ds); rptDoc.Subreports["Part2"].SetDataSource(ds); rptDoc.DataDefinition.ParameterFields["IMonth"].ApplyCurrentValues(GetReportPara((object)IMonth)); rptDoc.DataDefinition.ParameterFields["IYear"].ApplyCurrentValues(GetReportPara(IYear)); if (rptDoc != null) { SetDBLogonForReport(rptDoc); } crViewer.ReportSource = rptDoc; settings = ModuleConfig.GetSettings(); string reportPart = settings.ReportPath; string Targetfile = reportPart + "\\" + "BHXH mẫu C47" + "_" + IMonth + "_" + IYear + ".rpt"; FileInfo fil = new FileInfo(Targetfile); if (fil.Exists) { if ( MessageBox.Show("Đã tồn tại báo cáo này, có ghi đè không?", "Thông báo", MessageBoxButtons.YesNo) == DialogResult.Yes) { fil.Delete(); } else { return; } } //reportDocument.SaveAs(Targetfile, true); //Application.DoEvents(); rptDoc.ExportToDisk(ExportFormatType.CrystalReport, Targetfile); this.Show(); }
static void Main() { CSettings settings = (CSettings)ModuleConfig.GetSettings(new CTestSettings().GetType(), "Test.config"); signLen = new SignLength(); signLen.GAN_LENGTH = settings.SignConfig.GanLength; signLen.XIAN_LENGTH = settings.SignConfig.XianLength; signLen.CHE_LENGTH = settings.SignConfig.CheLength; Util.Sim6G6X4C.SimForm simForm = new Cn.Youdundianzi.Share.Util.Sim6G6X4C.SimForm(); ISignalMonitor monitor = SignalMonitorFactory.CreateSignalMonitor("Share.exe", "Cn.Youdundianzi.Share.Signal.JKY.CTestMonitor", settings); oldData = monitor.CreateMonDate(signLen); monitor.HotKeyHandle = simForm.Handle; monitor.RegMonitor(simForm); Program p = new Program(); monitor.RegMonitor(p); monitor.Start(); Application.Run(simForm); }
public CSetup(SettingPair set) { _settings = ModuleConfig.GetSettings(set.ImplementClass, set.FilePath); this._configFilePath = set.FilePath; }
public void ShowInsuranceC46(int IQuarter, int IYear, string SocialInsuranceOffice, string ComName, string ComAddress, string ComAcc, string ComBank, string ComTel, string ComFax, string YC1, string YC2, string YC3, string YC4, string YC5, string YC6, string YC7, string YC8, DateTime CreateDate, string CopyNum, string ComID) { //ReportDocument rptDoc = new ReportDocument(); ReportDocument rptDoc = null; //rptDoc.Load(@"Reports\BHXH\InsuranceC46.rpt"); rptDoc = new Reports.BHXH.InsuranceC46(); rptDoc.Refresh(); rptDoc.SetDatabaseLogon(WorkingContext.Setting.UserName, WorkingContext.Setting.Password, WorkingContext.Setting.Server, WorkingContext.Setting.Database); rptDoc.DataDefinition.ParameterFields["IQuarter"].ApplyCurrentValues(GetReportPara(IQuarter)); rptDoc.DataDefinition.ParameterFields["IYear"].ApplyCurrentValues(GetReportPara(IYear)); rptDoc.DataDefinition.ParameterFields["SocialInsuranceOffice"].ApplyCurrentValues(GetReportPara(SocialInsuranceOffice)); rptDoc.DataDefinition.ParameterFields["ComName"].ApplyCurrentValues(GetReportPara(ComName)); rptDoc.DataDefinition.ParameterFields["ComAddress"].ApplyCurrentValues(GetReportPara(ComAddress)); rptDoc.DataDefinition.ParameterFields["ComAcc"].ApplyCurrentValues(GetReportPara(ComAcc)); rptDoc.DataDefinition.ParameterFields["ComBank"].ApplyCurrentValues(GetReportPara(ComBank)); rptDoc.DataDefinition.ParameterFields["ComTel"].ApplyCurrentValues(GetReportPara(ComTel)); rptDoc.DataDefinition.ParameterFields["ComFax"].ApplyCurrentValues(GetReportPara(ComFax)); rptDoc.DataDefinition.ParameterFields["YC1"].ApplyCurrentValues(GetReportPara(YC1)); rptDoc.DataDefinition.ParameterFields["YC2"].ApplyCurrentValues(GetReportPara(YC2)); rptDoc.DataDefinition.ParameterFields["YC3"].ApplyCurrentValues(GetReportPara(YC3)); rptDoc.DataDefinition.ParameterFields["YC4"].ApplyCurrentValues(GetReportPara(YC4)); rptDoc.DataDefinition.ParameterFields["YC5"].ApplyCurrentValues(GetReportPara(YC5)); rptDoc.DataDefinition.ParameterFields["YC6"].ApplyCurrentValues(GetReportPara(YC6)); rptDoc.DataDefinition.ParameterFields["YC7"].ApplyCurrentValues(GetReportPara(YC7)); rptDoc.DataDefinition.ParameterFields["YC8"].ApplyCurrentValues(GetReportPara(YC8)); rptDoc.DataDefinition.ParameterFields["CreateDate"].ApplyCurrentValues(GetReportPara(CreateDate)); rptDoc.DataDefinition.ParameterFields["CopyNum"].ApplyCurrentValues(GetReportPara(CopyNum)); rptDoc.DataDefinition.ParameterFields["ComID"].ApplyCurrentValues(GetReportPara(ComID)); if (rptDoc != null) { SetDBLogonForReport(rptDoc); } crViewer.ReportSource = rptDoc; settings = ModuleConfig.GetSettings(); string reportPart = settings.ReportPath; string Targetfile = reportPart + "\\" + "BHXH mẫu C46" + "_" + IYear + ".rpt"; FileInfo fil = new FileInfo(Targetfile); if (fil.Exists) { if ( MessageBox.Show("Đã tồn tại báo cáo này, có ghi đè không?", "Thông báo", MessageBoxButtons.YesNo) == DialogResult.Yes) { fil.Delete(); } else { return; } } //reportDocument.SaveAs(Targetfile, true); //Application.DoEvents(); rptDoc.ExportToDisk(ExportFormatType.CrystalReport, Targetfile); this.Show(); }