Esempio n. 1
0
        public void AddValue(string variable, string new_value, ENUM_SQL_UNIT mode)
        {
            this.AddSelect(variable);
            StringBuilder stringBuilder = new StringBuilder();

            if (mode == ENUM_SQL_UNIT.chartype && !this.KeepNames)
            {
                new_value = new_value.Replace("'", "{SE$1}");
                new_value = new_value.Replace("\"", "{SE$2}");
                new_value = new_value.Replace(",", "{SE$3}");
                new_value = new_value.Replace("\r\n", "{SE$4}");
            }
            switch (mode)
            {
            case ENUM_SQL_UNIT.chartype:
            case ENUM_SQL_UNIT.datetime:
                stringBuilder.Append(" '");
                stringBuilder.Append(new_value);
                stringBuilder.Append("'");
                this._value.Add((object)stringBuilder.ToString());
                break;

            case ENUM_SQL_UNIT.inttype:
                stringBuilder.Append(" ");
                stringBuilder.Append(new_value);
                this._value.Add((object)stringBuilder.ToString());
                break;
            }
        }
Esempio n. 2
0
        public void AddUpdate(string variable, string new_value, ENUM_SQL_UNIT mode)
        {
            StringBuilder stringBuilder = new StringBuilder();

            switch (mode)
            {
            case ENUM_SQL_UNIT.chartype:
            case ENUM_SQL_UNIT.datetime:
                stringBuilder.Append(" ");
                stringBuilder.Append(variable);
                stringBuilder.Append("='");
                stringBuilder.Append(new_value);
                stringBuilder.Append("'");
                this._update.Add((object)stringBuilder.ToString());
                break;

            case ENUM_SQL_UNIT.inttype:
                stringBuilder.Append(" ");
                stringBuilder.Append(variable);
                stringBuilder.Append("=");
                stringBuilder.Append(new_value);
                this._update.Add((object)stringBuilder.ToString());
                break;
            }
        }
Esempio n. 3
0
 public bool updateField(string data, string label, ENUM_SQL_UNIT type)
 {
     try
     {
         if (type == ENUM_SQL_UNIT.datetime)
         {
             this._content[(object)label] = (object)Convert.ToDateTime(data);
             return(true);
         }
         if (type == ENUM_SQL_UNIT.inttype)
         {
             this._content[(object)label] = (object)Convert.ToInt64(data);
             return(true);
         }
         if (type != ENUM_SQL_UNIT.chartype)
         {
             return(false);
         }
         this._content[(object)label] = (object)data;
         return(true);
     }
     catch (Exception ex)
     {
         ex.ToString();
         return(false);
     }
 }
Esempio n. 4
0
 public void AddEndLike(string variable, string new_value, ENUM_SQL_UNIT mode)
 {
     if (mode != ENUM_SQL_UNIT.chartype)
     {
         return;
     }
     this._where.Add((object)(variable + " like '%" + new_value + "'"));
 }
Esempio n. 5
0
        public void AddWhere(string variable, string new_value, ENUM_SQL_UNIT mode)
        {
            switch (mode)
            {
            case ENUM_SQL_UNIT.chartype:
                this._where.Add((object)(variable + "='" + new_value + "'"));
                break;

            case ENUM_SQL_UNIT.inttype:
                this._where.Add((object)(variable + "=" + new_value));
                break;

            case ENUM_SQL_UNIT.datetime:
                this._where.Add((object)(variable + "='" + new_value + "'"));
                break;
            }
        }