private string GetCodeInfo(string id, out string cop, out int counter) { cop = ""; counter = -1; if (!string.IsNullOrEmpty(id)) { string strSQL = "select * from thc_codes where cid='" + id + "'"; DB.DataBaseControl dbCtl = new DB.DataBaseControl(); dbCtl.Open(); System.Data.IDataReader dataReader = dbCtl.GetReader(strSQL, null); string strResult = ""; if (dataReader.Read()) { strResult = dataReader["link"].ToString().Trim(); cop = dataReader["cop"].ToString().Trim(); counter = int.Parse(dataReader["counter"].ToString()); } dataReader.Close(); if (cop.Length > 0) { strSQL = "update thc_codes set counter=counter+1 where cid='" + id + "'"; dbCtl.ExecuteCommad(strSQL, null); counter++; } dbCtl.Close(); return(strResult); } else { return(""); } }
private string GetCodeInfo(string id) { if (!string.IsNullOrEmpty(id)) { string strSQL = "select * from codes where cid='" + id + "'"; DB.DataBaseControl dbCtl = new DB.DataBaseControl(); dbCtl.Open(); System.Data.IDataReader dataReader = dbCtl.GetReader(strSQL, null); string strResult = ""; if (dataReader.Read()) { strResult = dataReader["link"].ToString().Trim(); } dataReader.Close(); dbCtl.Close(); return(strResult); } else { return(""); } }