protected override void SetID() { SummitDS.CampaignRow thisRow = _rowToSave as SummitDS.CampaignRow; if (thisRow != null) { this._ID = thisRow.campaign_id; } }
protected override void LoadFromRow(DataRow _dataRow) { SummitDS.CampaignRow _thisRow = _dataRow as SummitDS.CampaignRow; if (_thisRow != null) { this._ID = _thisRow.campaign_id; this.m_strName = _thisRow.name; this.m_strMessage = _thisRow.IsmessageNull() ? String.Empty : _thisRow.message; this.m_iShopId = _thisRow.Isshop_idNull() ? (Nullable <Int32>)null : _thisRow.shop_id; this.m_IsEmail = _thisRow.IsisEmailNull() ? Convert.ToBoolean((Nullable <Boolean>)null) : _thisRow.isEmail; this.m_IsZipCodeMatchesMessage = _thisRow.Isis_zip_code_matches_messageNull() ? Convert.ToBoolean((Nullable <Boolean>)null) : _thisRow.is_zip_code_matches_message; this.m_IsPreferredShopMessage = _thisRow.Isis_preferred_shop_messageNull() ? Convert.ToBoolean((Nullable <Boolean>)null) : _thisRow.is_preferred_shop_message; _rowToSave = _thisRow; } }
protected override void SaveToRow() { SummitDS.CampaignDataTable _thisTable = new SummitDS.CampaignDataTable(); if (_rowToSave == null) { _rowToSave = _thisTable.NewCampaignRow(); } SummitDS.CampaignRow _dataRow = _rowToSave as SummitDS.CampaignRow; if (_dataRow != null) { if (IsExisting()) { _dataRow.name = m_strName; if (String.IsNullOrEmpty(m_strMessage)) { if (!_dataRow.IsmessageNull()) { _dataRow.SetmessageNull(); } } else if (_dataRow.IsmessageNull() ? true : _dataRow.message != m_strMessage) { _dataRow.message = m_strMessage; } if (iShopId.HasValue) { _dataRow.shop_id = iShopId.Value; } else { _dataRow.Setshop_idNull(); } if (m_IsEmail == null) { if (!_dataRow.IsisEmailNull()) { _dataRow.SetisEmailNull(); } } else if (_dataRow.IsisEmailNull() ? true : _dataRow.isEmail != m_IsEmail) { _dataRow.isEmail = m_IsEmail; } if (m_IsZipCodeMatchesMessage == null) { if (!_dataRow.Isis_zip_code_matches_messageNull()) { _dataRow.Setis_zip_code_matches_messageNull(); } } else if (_dataRow.Isis_zip_code_matches_messageNull() ? true : _dataRow.is_zip_code_matches_message != m_IsZipCodeMatchesMessage) { _dataRow.is_zip_code_matches_message = m_IsZipCodeMatchesMessage; } if (m_IsPreferredShopMessage == null) { if (!_dataRow.Isis_preferred_shop_messageNull()) { _dataRow.Setis_preferred_shop_messageNull(); } } else if (_dataRow.Isis_preferred_shop_messageNull() ? true : _dataRow.is_preferred_shop_message != m_IsPreferredShopMessage) { _dataRow.is_preferred_shop_message = m_IsPreferredShopMessage; } } else { _dataRow.name = m_strName; if (String.IsNullOrEmpty(strMessage)) { _dataRow.SetmessageNull(); } else { _dataRow.message = strMessage; } if (iShopId.HasValue) { _dataRow.shop_id = iShopId.Value; } else { _dataRow.Setshop_idNull(); } if (m_IsEmail == null) { if (!_dataRow.IsisEmailNull()) { _dataRow.SetisEmailNull(); } } else if (_dataRow.IsisEmailNull() ? true : _dataRow.isEmail != m_IsEmail) { _dataRow.isEmail = m_IsEmail; } if (m_IsZipCodeMatchesMessage == null) { if (!_dataRow.Isis_zip_code_matches_messageNull()) { _dataRow.Setis_zip_code_matches_messageNull(); } } else if (_dataRow.Isis_zip_code_matches_messageNull() ? true : _dataRow.is_zip_code_matches_message != m_IsZipCodeMatchesMessage) { _dataRow.is_zip_code_matches_message = m_IsZipCodeMatchesMessage; } if (m_IsPreferredShopMessage == null) { if (!_dataRow.Isis_preferred_shop_messageNull()) { _dataRow.Setis_preferred_shop_messageNull(); } } else if (_dataRow.Isis_preferred_shop_messageNull() ? true : _dataRow.is_preferred_shop_message != m_IsPreferredShopMessage) { _dataRow.is_preferred_shop_message = m_IsPreferredShopMessage; } _thisTable.AddCampaignRow(_dataRow); } } }