public Information() { InitializeComponent(); #region csw修改,需要此exe下配置文件IMEQPIVAs.ini bPre = ChargeFactory.GetCharge(dbHelp.IniReadValuePivas("Charge", "HospitalType")); #endregion }
/// <summary> /// 调用接口前需初始化参数; /// 从数据库或配置文件中加载配置 /// </summary> /// <returns></returns> private static bool InitConfig() { try { loadalready(); IsOtherLabel = dbHelp.GetPivasAllSet("第三方瓶签");//获取第三方瓶签的设置 if (IsOtherLabel == "1") { LabelLength = int.Parse(dbHelp.GetPivasAllSetValue2("第三方瓶签")); //获取瓶签长度 LabelBS = dbHelp.GetPivasAllSetValue3("第三方瓶签"); //获取瓶签标识 InternalLogger.Log.Debug("LabelLength" + LabelLength.ToString() + "LabelBS" + LabelBS.ToString()); } //读取计费配置值并获取接口对象 IsCharge = dbHelp.IniReadValuePivas("Charge", "PZ") == "1"; #region 测试 charge = ChargeFactory.GetCharge(HOSPITAL_TYPE); #endregion return(true); } catch (Exception ex) { InternalLogger.Log.Error("初始化发生错误,请检查配置;" + ex.Message); } return(false); }
public void UsualChargeTestMethod() { //arrange vFakeOutput.Clean(); vNokia1100.ChargerComponent = ChargeFactory.GetCharge(Charges.UsualCharge, vFakeOutput); string controlValue = "\nUsualCharge charging slowly"; //act vNokia1100.Charge(); //assert Assert.AreEqual(controlValue, vFakeOutput.Output); }
private void ToHIS_Load(object sender, EventArgs e) { try { Thread th = new Thread(() => { #region csw修改,需要此exe下配置文件IMEQPIVAs.ini ICharge charge = ChargeFactory.GetCharge(dbHelp.IniReadValuePivas("Charge", "HospitalType")); #endregion ok = charge.PrintCharge(p, userID); }); th.IsBackground = true; th.Start(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
static void Main(string[] args) { try { var console = new ConsoleOutput(); MobilePhoneBase myNokia1100 = new Nokia1100(777); Console.WriteLine("Select playback component:"); Console.WriteLine("1 - iPhoneHeadset"); Console.WriteLine("2 - SamsungHeadset"); Console.WriteLine("3 - UnofficialiPhoneHeadset"); Console.WriteLine("4 - PhoneSpeaker"); int playbackNumber = readNumber(); myNokia1100.PlaybackComponent = HeadsetFactory.GetHeadset((Headsets)playbackNumber, console); myNokia1100.PlaybackComponent.Play("Hi"); Console.WriteLine(); Console.WriteLine("Select charger component:"); Console.WriteLine("1 - FastCharge"); Console.WriteLine("2 - UsualCharge"); int chargerNumber = readNumber(); myNokia1100.ChargerComponent = ChargeFactory.GetCharge((Charges)chargerNumber, console); myNokia1100.Charge(); Console.ReadKey(); } catch (Exception ex) { Console.WriteLine(ex.Message); Console.ReadKey(); } finally { Console.WriteLine("Goodbye"); } }
private void button_ApplyCharger_Click(object sender, EventArgs e) { Nokia1100.ChargerComponent = ChargeFactory.GetCharge(currentCharges, formOutput); Nokia1100.Charge(); }