public DateTime GetDBDate() { try { string sql = "select getdate()"; object ob = DbHelperSQL2.GetSingle(sql); DateTime dt = Convert.ToDateTime(ob); return(dt); } catch { return(DateTime.Now); } }
public string GetStringData(string sql, Hashtable pararm = null) { string strobj = string.Empty; // SqlParameter[] parameters = BuildSqlParameters(pararm); object ob = DbHelperSQL2.GetSingle(sql, pararm); try { if (ob != null) { strobj = ob.ToString(); } } catch { } return(strobj); }
public double GetDoubleData(string sql, Hashtable pararm = null) { double dValue = 0; object ob = DbHelperSQL2.GetSingle(sql, pararm); try { if (ob != null) { if (double.TryParse(ob.ToString(), out dValue)) { return(dValue); } return(0); } } catch { } return(dValue); }
public int GetIntData(string sql, Hashtable pararm = null) { int intValue = 0; // SqlParameter[] parameters = BuildSqlParameters(pararm); object ob = DbHelperSQL2.GetSingle(sql, pararm); try { if (ob != null) { if (int.TryParse(ob.ToString(), out intValue)) { return(intValue); } return(0); } } catch { } return(intValue); }
//public int UIDTran(Dictionary<string,IList<SqlParameter>> SQLStringList) //{ // Dictionary<string, SqlParameter[]> tranSQLStringList = new Dictionary<string, SqlParameter[]>(); // foreach (KeyValuePair<string, IList<SqlParameter>> myDE in SQLStringList) // { // IList<SqlParameter> htParams = (IList<SqlParameter>)myDE.Value; // SqlParameter[] parameters = htParams.ToArray<SqlParameter>(); // tranSQLStringList.Add(myDE.Key, parameters); // } // return DbHelperSQL2.ExecuteSqlTran(tranSQLStringList); //} public object GetSingle(string sql, Hashtable pararm = null) { // SqlParameter[] parameters = BuildSqlParameters(pararm); return(DbHelperSQL2.GetSingle(sql, pararm)); }
public int GetMaxID() { string sql = "select seq_id.nextval from dual"; return(Convert.ToInt32(DbHelperSQL2.GetSingle(sql))); }