public EventContactInfo GetCopy() { EventContactInfo newEntity = new EventContactInfo(); if (!this.event_id.IsNull_flag) { newEntity.event_id.Value = this.event_id.Value; } if (!this.contact_company_name.IsNull_flag) { newEntity.contact_company_name.Value = this.contact_company_name.Value; } if (!this.contact_address1.IsNull_flag) { newEntity.contact_address1.Value = this.contact_address1.Value; } if (!this.contact_address2.IsNull_flag) { newEntity.contact_address2.Value = this.contact_address2.Value; } if (!this.contact_country_code.IsNull_flag) { newEntity.contact_country_code.Value = this.contact_country_code.Value; } if (!this.contact_attn.IsNull_flag) { newEntity.contact_attn.Value = this.contact_attn.Value; } if (!this.contact_phone.IsNull_flag) { newEntity.contact_phone.Value = this.contact_phone.Value; } if (!this.contact_fax.IsNull_flag) { newEntity.contact_fax.Value = this.contact_fax.Value; } if (!this.contact_email.IsNull_flag) { newEntity.contact_email.Value = this.contact_email.Value; } if (!this.contact_city.IsNull_flag) { newEntity.contact_city.Value = this.contact_city.Value; } if (!this.contact_state.IsNull_flag) { newEntity.contact_state.Value = this.contact_state.Value; } if (!this.contact_zip.IsNull_flag) { newEntity.contact_zip.Value = this.contact_zip.Value; } return(newEntity); }
/// <summary> /// Initialize object from DB /// </summary> public bool Init_from_DB() { if (this.event_contact_info_id < 0) { return(false); } HssUtility.SQLserver.DB_select db_sel = new HssUtility.SQLserver.DB_select(EventContactInfo.Get_cmdTP()); db_sel.tableName = "EventContactInfo"; HssUtility.SQLserver.SQL_relation rela = new HssUtility.SQLserver.SQL_relation("event_contact_info_id", HssUtility.General.RelationalOperator.Equals, this.event_contact_info_id); db_sel.SetCondition(rela); bool res_flag = false; HssUtility.SQLserver.DB_reader reader = new HssUtility.SQLserver.DB_reader(db_sel, Utility.Get_ESP2_hDB()); if (reader.Read()) { this.Init_from_reader(reader); res_flag = true; } reader.Close(); return(res_flag); }
internal HssUtility.SQLserver.DB_update Get_DBupdate() { if (!this.CheckValueChanges()) { return(null); } HssUtility.SQLserver.DB_update upd = new HssUtility.SQLserver.DB_update(EventContactInfo.Get_cmdTP()); if (this.event_id.ValueChanged) { upd.AddValue("event_id", this.event_id); } if (this.contact_company_name.ValueChanged) { upd.AddValue("contact_company_name", this.contact_company_name); } if (this.contact_address1.ValueChanged) { upd.AddValue("contact_address1", this.contact_address1); } if (this.contact_address2.ValueChanged) { upd.AddValue("contact_address2", this.contact_address2); } if (this.contact_country_code.ValueChanged) { upd.AddValue("contact_country_code", this.contact_country_code); } if (this.contact_attn.ValueChanged) { upd.AddValue("contact_attn", this.contact_attn); } if (this.contact_phone.ValueChanged) { upd.AddValue("contact_phone", this.contact_phone); } if (this.contact_fax.ValueChanged) { upd.AddValue("contact_fax", this.contact_fax); } if (this.contact_email.ValueChanged) { upd.AddValue("contact_email", this.contact_email); } if (this.contact_city.ValueChanged) { upd.AddValue("contact_city", this.contact_city); } if (this.contact_state.ValueChanged) { upd.AddValue("contact_state", this.contact_state); } if (this.contact_zip.ValueChanged) { upd.AddValue("contact_zip", this.contact_zip); } HssUtility.SQLserver.SQL_relation rela = new HssUtility.SQLserver.SQL_relation("event_contact_info_id", HssUtility.General.RelationalOperator.Equals, this.pk_ID); upd.SetCondition(rela); return(upd); }
internal HssUtility.SQLserver.DB_insert Get_DBinsert() { HssUtility.SQLserver.DB_insert dbIns = new HssUtility.SQLserver.DB_insert(EventContactInfo.Get_cmdTP()); dbIns.AddValue("event_id", this.event_id.Value); dbIns.AddValue("contact_company_name", this.contact_company_name); /*Optional 3*/ dbIns.AddValue("contact_address1", this.contact_address1); /*Optional 4*/ dbIns.AddValue("contact_address2", this.contact_address2); /*Optional 5*/ dbIns.AddValue("contact_country_code", this.contact_country_code); /*Optional 6*/ dbIns.AddValue("contact_attn", this.contact_attn); /*Optional 7*/ dbIns.AddValue("contact_phone", this.contact_phone); /*Optional 8*/ dbIns.AddValue("contact_fax", this.contact_fax); /*Optional 9*/ dbIns.AddValue("contact_email", this.contact_email); /*Optional 10*/ dbIns.AddValue("contact_city", this.contact_city); /*Optional 11*/ dbIns.AddValue("contact_state", this.contact_state); /*Optional 12*/ dbIns.AddValue("contact_zip", this.contact_zip); /*Optional 13*/ return(dbIns); }