Ejemplo n.º 1
0
        private void AddCriteriaDD(ExtendedDropDownList dd, ref String sql, String fieldName, FieldTypeEnum fieldtype, ref Boolean bFirst)
        {
            String fv = dd.SelectedValue.ToWSSafeString();

            if (fv != "*" && !String.IsNullOrWhiteSpace(fv) && fv != "-9999")
            {
                if (bFirst)
                {
                    bFirst = false;
                }
                else
                {
                    sql += " AND ";
                }
                sql += String.Format("{0}={2}{1}{2}", fieldName, fv, fieldtype == FieldTypeEnum.text ? "'" : String.Empty);
            }
        }
Ejemplo n.º 2
0
        private void AddCriteriaDDNull(ExtendedDropDownList dd, ref string sql, string fieldName, FieldTypeEnum fieldtype, ref Boolean bFirst)
        {
            string fv = dd.SelectedValue.ToWSSafeString();

            switch (fv)
            {
            case "Yes":
                if (bFirst)
                {
                    bFirst = false;
                }
                else
                {
                    sql += " AND ";
                }
                sql += String.Format(" ({0} IS NOT NULL AND {0}<>'') ", fieldName);
                break;

            case "No":
                if (bFirst)
                {
                    bFirst = false;
                }
                else
                {
                    sql += " AND ";
                }
                sql += String.Format(" (({0} IS NULL) OR ({0}='')) ", fieldName);
                break;

            case "View All":
                break;

            default:
                break;
            }
        }