public void GetPartmeterString(ExcuteImport excuteImport, ref string orderBySql, ref List <DbParameter> dbParameters) { StringBuilder stringBuilder = new StringBuilder(); using (IEnumerator <ItemStruct> IEnumerator = GetEnumerator()) { while (IEnumerator.MoveNext()) { ItemStruct col = IEnumerator.Current; if (stringBuilder.Length <= 0) { stringBuilder.Append(", "); } stringBuilder.Append(col.Column.GetName); stringBuilder.Append(excuteImport.sqlSetting.Flag + col.Column.GetName); dbParameters.Add(excuteImport.CreateDbParameter(excuteImport.sqlSetting.Flag + col.Column.GetName, col.Value)); } } orderBySql = stringBuilder.ToString(); }
public void GetParameterString(ExcuteImport excuteImport, ref string insertSql, ref List <DbParameter> dbParameters) { StringBuilder stringBuilder = new StringBuilder(); StringBuilder stringBuilder2 = new StringBuilder(); using (IEnumerator <ItemStruct> enumerator = GetEnumerator()) { while (enumerator.MoveNext()) { ItemStruct itemCurrent = enumerator.Current; if (stringBuilder.Length <= 0) { stringBuilder.Append("("); } else { stringBuilder.Append(", "); } stringBuilder.Append(itemCurrent.Column.GetName); if (stringBuilder2.Length <= 0) { stringBuilder2.Append("VALUES( "); } else { stringBuilder2.Append(", "); } stringBuilder2.Append(excuteImport.sqlSetting.Flag + itemCurrent.Column.GetName); dbParameters.Add(excuteImport.CreateDbParameter(excuteImport.sqlSetting.Flag + itemCurrent.Column.GetName, itemCurrent.Value)); } } stringBuilder.Append(") "); stringBuilder2.Append(") "); stringBuilder.Append(stringBuilder2); insertSql = stringBuilder.ToString(); }
public void GetParamString(ExcuteImport excuteImport, ref string sqlupdateClip, ref List <DbParameter> lstdbParameters) { StringBuilder stringBuilder = new StringBuilder(); using (IEnumerator <ItemStruct> enumerator = GetEnumerator()) { while (enumerator.MoveNext()) { ItemStruct itemcurrent = enumerator.Current; if (stringBuilder.Length <= 0) { stringBuilder.Append("SET "); } else { stringBuilder.Append(", "); } stringBuilder.Append(itemcurrent.Column.GetName + "=" + excuteImport.sqlSetting.Flag + itemcurrent.Column.Name); lstdbParameters.Add(excuteImport.CreateDbParameter(excuteImport.sqlSetting.Flag + itemcurrent.Column.Name, itemcurrent.Value)); } stringBuilder.Append(" "); sqlupdateClip = stringBuilder.ToString(); } }
public ConditionItem CharNum(char c, int num) { ConditionItem conditionItem = new ConditionItem(); conditionItem.sqlStr = string.Format(excuteImport.sqlSetting.Column_CharNum, GetName, GetName, excuteImport.sqlSetting.Flag, Name, excuteImport.sqlSetting.Flag, Name); ConditionItem conditionItem2 = conditionItem; conditionItem2.lstDbParmeters.Add(excuteImport.CreateDbParameter(excuteImport.sqlSetting.Flag + Name + "0", c)); conditionItem2.lstDbParmeters.Add(excuteImport.CreateDbParameter(excuteImport.sqlSetting.Flag + Name + "1", num)); return(conditionItem2); }