protected bool recordExists(string tblName, string keyName, string keyValue, string sessionId)
 {
     try {
         return(CommonMethods.getDataSet("SELECT * FROM " + tblName + " WHERE " + keyName + "='" + keyValue + "'", sessionId).Tables[0].Rows.Count > 0);
     } catch {
         return(false);
     }
 }
Exemplo n.º 2
0
        private DataSet GetMySqlCalendar()
        {
            String query = "SELECT DISTINCT " +
                           "webcal_entry.cal_id," +
                           "webcal_entry.cal_date," +
                           "webcal_entry.cal_time," +
                           "webcal_entry.cal_name," +
                           "webcal_entry.cal_location," +
                           "webcal_entry.cal_url," +
                           "webcal_entry.cal_description" +
                           " FROM webcal_entry" +
                           " LEFT OUTER JOIN webcal_entry_categories ON webcal_entry.cal_id = webcal_entry_categories.cal_id" +
                           " LEFT OUTER JOIN webcal_entry_user ON webcal_entry.cal_id = webcal_entry_user.cal_id" +
                           " WHERE cal_status='A' and cat_id=1";

            return(CommonMethods.getDataSet(query, mSessionId));
        }
        public DataSet getDataSet(string sessionId)
        {
            string cmdText = string.Empty;

            if (_selectClause != null)
            {
                cmdText = _selectClause;
            }
            else
            {
                if (!CommonRoutines.isNothing(ChildSelectClause))
                {
                    cmdText = ChildSelectClause;
                }
            }
            if (_whereClause != null)
            {
                cmdText += " WHERE " + _whereClause;
            }
            else
            {
                if (!CommonRoutines.isNothing(ChildWhereClause))
                {
                    cmdText += " WHERE " + ChildWhereClause;
                }
            }
            if (_orderByClause != null)
            {
                cmdText += " ORDER BY " + _orderByClause;
            }
            else
            {
                if (!CommonRoutines.isNothing(ChildOrderByClause))
                {
                    cmdText += " ORDER BY " + ChildOrderByClause;
                }
            }
            return(CommonMethods.getDataSet(cmdText, sessionId));
        }