public void AddNewSurveyIPRange(SurveyIPRangeData updIPRange) { SqlConnection connection = new SqlConnection(DbConnection.NewDbConnectionString); SqlCommand command = new SqlCommand("vts_spSurveyIPRangeAddNew", connection); command.CommandType = CommandType.StoredProcedure; command.Parameters.Add(new SqlParameter("@SurveyID", updIPRange.SurveyIPRange[0].SurveyId)); command.Parameters.Add(new SqlParameter("@IPStart", updIPRange.SurveyIPRange[0].IPStart)); command.Parameters.Add(new SqlParameter("@IPEnd", updIPRange.SurveyIPRange[0].IPEnd)); DbConnection.db.UpdateDataSet(updIPRange, "SurveyIPRange", command, new SqlCommand(), new SqlCommand(), UpdateBehavior.Transactional); }
public SurveyIPRangeData GetAllSurveyIPRanges(int surveyID) { SurveyIPRangeData surveyIPRangeData = new SurveyIPRangeData(); ArrayList commandParameters = new ArrayList(); { commandParameters.Add(new SqlParameter("@SurveyId", surveyID).SqlValue); } DbConnection.db.LoadDataSet( "vts_spIPRangeGetForSurvey",surveyIPRangeData, new string[]{"surveyIPRange"},commandParameters.ToArray()); return surveyIPRangeData; }
public SurveyIPRangeData GetAllSurveyIPRanges(int surveyID) { SurveyIPRangeData surveyIPRangeData = new SurveyIPRangeData(); ArrayList commandParameters = new ArrayList(); { commandParameters.Add(new SqlParameter("@SurveyId", surveyID).SqlValue); } DbConnection.db.LoadDataSet("vts_spIPRangeGetForSurvey", surveyIPRangeData, new string[] { "surveyIPRange" }, commandParameters.ToArray()); return(surveyIPRangeData); }
private void InsertUpdateIPRange(bool isInsert, int?surveyIPRangeId, int surveyId, string IPStart, string IPEnd) { SurveyIPRangeData data = new SurveyIPRangeData(); SurveyIPRangeData.SurveyIPRangeRow row = data.SurveyIPRange.NewSurveyIPRangeRow(); row.SurveyId = surveyId; row.IPStart = IPStart; row.IPEnd = IPEnd; row.SurveyIPRangeId = surveyIPRangeId ?? 0; data.SurveyIPRange.Rows.Add(row); if (isInsert) { new SurveyIPRange().AddNewSurveyIPRange(data); } new SurveyIPRange().UpdateIPRange(data); }
private void InsertUpdateIPRange(bool isInsert,int? surveyIPRangeId,int surveyId, string IPStart, string IPEnd) { SurveyIPRangeData data = new SurveyIPRangeData(); SurveyIPRangeData.SurveyIPRangeRow row = data.SurveyIPRange.NewSurveyIPRangeRow(); row.SurveyId = surveyId; row.IPStart = IPStart; row.IPEnd = IPEnd; row.SurveyIPRangeId = surveyIPRangeId ?? 0; data.SurveyIPRange.Rows.Add(row); if (isInsert) new SurveyIPRange().AddNewSurveyIPRange(data); new SurveyIPRange().UpdateIPRange(data); }
public void AddNewSurveyIPRange(SurveyIPRangeData data) { SurveyIPRangeFactory.Create().AddNewSurveyIPRange(data); }
public void UpdateIPRange(SurveyIPRangeData data) { SurveyIPRangeFactory.Create().UpdateSurveyIPRange(data); }