internal void GetRemoteConfig() { if (configs == null) { configs = new List <ConfigEntity>(); } SQLDBHelper sqlHelper = new SQLDBHelper(); DataTable dt = sqlHelper.Query("select * from TF_Config"); if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { ConfigEntity config = new ConfigEntity(); config.id = Convert.ToInt32(dt.Rows[i]["ID"]); config.configname = dt.Rows[i]["ConfigName"].ToString(); config.configvalue = dt.Rows[i]["ConfigValue"].ToString(); config.configtype = Convert.ToInt32(dt.Rows[i]["ConfigType"]); config.remark = dt.Rows[i]["Remark"].ToString(); config.extension = Convert.ToInt32(dt.Rows[i]["Extension"]); config.flag = Convert.ToInt32(dt.Rows[i]["Flag"]); configs.Add(config); } } }
private static bool SaveConfigToRemote(List <ConfigEntity> configs, out Exception ex) { ex = null; if (configs != null) { try { SQLDBHelper sqlHelper = new SQLDBHelper(); foreach (ConfigEntity config in configs) { string sql = "if exists (select 1 from TF_Config where ID=" + config.id + ") update TF_Config set ConfigName='" + config.configname + "',ConfigValue='" + config.configvalue + "',ConfigType=" + config.configtype + ",Remark='" + config.remark + "',Extension=" + config.extension + ",Flag=" + config.flag + " where ID=" + config.id + " else insert into TF_Config(ConfigName,ConfigValue,ConfigType,Remark,Extension,Flag) values ('" + config.configname + "','" + config.configvalue + "'," + config.configtype + ",'" + config.remark + "'," + config.extension + "," + config.flag + ")"; sqlHelper.ExecuteSql(sql); } return(true); } catch (Exception e) { ex = e; } } else { ex = new Exception("configs参数不能为空!"); } return(false); }
public static ConfigLogic GetInstance() { sqlHelper = new SQLDBHelper(); if (Config == null) { lock (lockObj) { if (Config == null) { Config = new ConfigLogic(); } } } return(Config); }
private static bool SaveConfigToRemote(List <ConfigEntity> configs) { if (configs != null) { try { SQLDBHelper sqlHelper = new SQLDBHelper(); foreach (ConfigEntity config in configs) { string sql = "if exists (select 1 from TF_Config where ID=" + config.id + ") update TF_Config set ConfigName='',ConfigValue='',Remark='',Extension=,Flag= where ID=" + config.id + " else insert into TF_Config(ConfigName,ConfigValue,Remark,Extension,Flag) values ('" + config.configname + "','" + config.configvalue + "','" + config.remark + "'," + config.extension + "," + config.flag + ")"; sqlHelper.ExecuteSql(sql); } return(true); } catch (Exception e) { MessageBox.Show(e.Message); } } return(false); }
private FollowupLogic() { sqlHelper = new SQLDBHelper(); }
private InventoryLogic() { sqlHelper = new SQLDBHelper(); }
private FormItemLogic() { sqlHelper = new SQLDBHelper(); }
private PersonalTrainLogic() { sqlHelper = new SQLDBHelper(); }
private ModuleLogic() { sqlHelper = new SQLDBHelper(); }
private FinanceDetailLogic() { sqlHelper = new SQLDBHelper(); }
private PropertyLogic() { sqlHelper = new SQLDBHelper(); }
private MoneyRecordLogic() { sqlHelper = new SQLDBHelper(); }
private MemberLogic() { sqlHelper = new SQLDBHelper(); }
private DepartmentLogic() { sqlHelper = new SQLDBHelper(); }
private TaskStageLogic() { sqlHelper = new SQLDBHelper(); }
private WorklogLogic() { sqlHelper = new SQLDBHelper(); }
private StaffLogic() { sqlHelper = new SQLDBHelper(); }
private UserLogic() { sqlHelper = new SQLDBHelper(); }
private FormObjectLogic() { sqlHelper = new SQLDBHelper(); }
private RenewLogic() { sqlHelper = new SQLDBHelper(); }
private AttachmentLogic() { sqlHelper = new SQLDBHelper(); }
private ConfigLogic() { sqlHelper = new SQLDBHelper(); }
private ActionLogic() { sqlHelper = new SQLDBHelper(); }
private CardTypeLogic() { sqlHelper = new SQLDBHelper(); }
private IncomeLogic() { sqlHelper = new SQLDBHelper(); }
private StaffConditionLogic() { sqlHelper = new SQLDBHelper(); }
private TaskInfoLogic() { sqlHelper = new SQLDBHelper(); }
private PermissionLogic() { sqlHelper = new SQLDBHelper(); }
private FormTypeLogic() { sqlHelper = new SQLDBHelper(); }
private RoleLogic() { sqlHelper = new SQLDBHelper(); }