/// <summary> /// /// </summary> /// <returns></returns> public static IContribute getInstance() { if (cInstance == null) cInstance = new ContributeHTTP(); return (cInstance); }
/// <summary> /// /// </summary> /// <returns></returns> public static IContribute getInstance() { if (cInstance == null) { cInstance = new ContributeHTTP(); } return(cInstance); }
/// <summary> /// /// </summary> public void processMessages() { String lMsgsFolder = Config.GetRegistryValue(Config.RegistryContribution, Config.RegistryContributionMessages); if (lMsgsFolder == null || lMsgsFolder.Length <= 0) { Config.CreateRegistryKey(Config.RegistrySoftwareName, String.Format(@"{0}\{1}", Config.RegistryContribution, Config.RegistryContributionMessages)); } String lMsgsSubKey = String.Format(@"{0}\{1}\{2}", Config.BasisKey, Config.RegistryContribution, Config.RegistryContributionMessages); try { using (RegistryKey key = Registry.CurrentUser.OpenSubKey(lMsgsSubKey, true)) { if (key != null) { foreach (String subkeyName in key.GetValueNames()) { String lData = key.GetValue(subkeyName.ToString()).ToString(); IContribute lContr = ContributeHTTP.getInstance(); if (lContr.sendContribution(lData)) { LogConsole.Main.LogConsole.pushMsg(String.Format("Contribution msg sent ({0}) : {1}", lContr.getMethod(), subkeyName.ToString())); key.DeleteValue(subkeyName.ToString()); } else { LogConsole.Main.LogConsole.pushMsg(String.Format("Contribution msg not sent ({0}) : {1}", lContr.getMethod(), subkeyName.ToString())); } } // foreach (Stri... } // if (key... } // using (Regi... } catch (Exception lEx) { LogConsole.Main.LogConsole.pushMsg("Error sending contribution message : " + lEx.StackTrace); } //Config.SetRegistryValue(Config.RegistryContributionKey, Config.RegistryContributionValue, pStatus); }
public decimal PayAmount(IContribute employee, decimal salary) { switch (employee.Code()) { case EmployeeType.Intern: return Intern.PayAmount(salary); case EmployeeType.Architect: return Architect.PayAmount(salary); case EmployeeType.Consultant: // Death Or Glory return Consultant.PayAmount(salary); case EmployeeType.Developer: return salary; default: throw new WrongEmployeeComplaint(); } }
public decimal PayAmount(IContribute employee, decimal salary) { const int freeLanceRisk = 1000; switch (employee.Code()) { case EmployeeType.Intern: return salary / 2; case EmployeeType.Architect: return salary * 2; case EmployeeType.Consultant: // Death Or Glory return salary * 4 + freeLanceRisk; case EmployeeType.Developer: return salary; default: throw new WrongEmployeeComplaint(); } }