public static void Refresh() { lock (olock) { instance = new SystemConfigFacade(); } }
public static string ValidFFZF(string strContent) { if (FinalString(strContent).Length > 0) { string[] strFFZF = SystemConfigFacade.Instance().FFZF.Split(','); for (int i = 0; i < strFFZF.Length; i++) { if (strContent.IndexOf(strFFZF[i].Trim()) >= 0) { return(strFFZF[i]); } } } return(string.Empty); }
public static SystemConfigFacade Instance() { if (instance == null) { //取得实例的时候先锁定对象,然后判定是否存在 lock (olock) { //如果实例没有被初始化则实例化变量 if (instance == null) { instance = new SystemConfigFacade(); } } } return(instance); }
public static bool IsUserValid(string uname, string upass) { uname = CommonMethodFacade.FinalString(uname); upass = CommonMethodFacade.FinalString(upass); if (uname.Length > 0 && upass.Length > 0) { string sqlLogin = @"UPDATE XiHuan_UserInfo SET LastLoginTime=getdate(), Score=Score+(CASE WHEN LastLoginTime<'{0}' THEN {1} ELSE 0 END ) WHERE UserName='******' AND OrignalPwd='{3}' ;"; int effcount = Query.ProcessSqlNonQuery(string.Format(sqlLogin, DateTime.Now.ToString("yyyy-MM-dd"), SystemConfigFacade.Instance().LoginAddScore(), ValidatorHelper.SafeSql(uname), ValidatorHelper.SafeSql(upass)), GlobalVar.DataBase_Name); return(effcount > 0); } else { return(false); } }