public static void FillObject(Business.DataObjectPollAnswer item, SqlDataReader sqlReader) { item.Answer = (int)(sqlReader["Answer"]); item.Position = (int)(sqlReader["Position"]); item.Comment = sqlReader["Comment"].ToString(); item.IP = sqlReader["IP"].ToString(); }
private static void SetParameters(Business.DataObjectPollAnswer item, SqlParameterCollection parameters) { parameters.AddWithValue("@Position", item.Position); parameters.AddWithValue("@Answer", item.Answer); if (!string.IsNullOrEmpty(item.Comment)) { parameters.AddWithValue("@AnswerComment", item.Comment); } else { parameters.AddWithValue("@AnswerComment", DBNull.Value); } parameters.AddWithValue("@AnswerIP", item.IP); }
public static string GetUpdateSQL(Business.DataObjectPollAnswer item, SqlParameterCollection parameters) { // SetParameters(item, parameters); // return "UPDATE hiobj_PollAnswer SET [Answer] = @Answer, [Comment] = @AnswerComment"; return(string.Empty); }
public static string GetInsertSQL(Business.DataObjectPollAnswer item, SqlParameterCollection parameters) { SetParameters(item, parameters); return("INSERT INTO hiobj_PollAnswer ([OBJ_ID],[Position],[Answer],[Comment],[IP]) VALUES (@OBJ_ID,@Position,@Answer,@AnswerComment,@AnswerIP)"); }