public PrimaryCustodian GetCopy() { PrimaryCustodian newEntity = new PrimaryCustodian(); if (!this.custodian_number.IsNull_flag) { newEntity.custodian_number.Value = this.custodian_number.Value; } if (!this.name.IsNull_flag) { newEntity.name.Value = this.name.Value; } if (!this.address1.IsNull_flag) { newEntity.address1.Value = this.address1.Value; } if (!this.address2.IsNull_flag) { newEntity.address2.Value = this.address2.Value; } if (!this.city.IsNull_flag) { newEntity.city.Value = this.city.Value; } if (!this.state.IsNull_flag) { newEntity.state.Value = this.state.Value; } if (!this.zip.IsNull_flag) { newEntity.zip.Value = this.zip.Value; } if (!this.country_code.IsNull_flag) { newEntity.country_code.Value = this.country_code.Value; } if (!this.attn.IsNull_flag) { newEntity.attn.Value = this.attn.Value; } if (!this.phone.IsNull_flag) { newEntity.phone.Value = this.phone.Value; } if (!this.fax.IsNull_flag) { newEntity.fax.Value = this.fax.Value; } if (!this.email.IsNull_flag) { newEntity.email.Value = this.email.Value; } if (!this.event_id.IsNull_flag) { newEntity.event_id.Value = this.event_id.Value; } if (!this.psafe.IsNull_flag) { newEntity.psafe.Value = this.psafe.Value; } if (!this.safe_keeping_account_number.IsNull_flag) { newEntity.safe_keeping_account_number.Value = this.safe_keeping_account_number.Value; } if (!this.depositary_name.IsNull_flag) { newEntity.depositary_name.Value = this.depositary_name.Value; } return(newEntity); }
internal HssUtility.SQLserver.DB_insert Get_DBinsert() { HssUtility.SQLserver.DB_insert dbIns = new HssUtility.SQLserver.DB_insert(PrimaryCustodian.Get_cmdTP()); dbIns.AddValue("custodian_number", this.custodian_number.Value); dbIns.AddValue("name", this.name.Value); dbIns.AddValue("address1", this.address1); /*Optional 4*/ dbIns.AddValue("address2", this.address2); /*Optional 5*/ dbIns.AddValue("city", this.city); /*Optional 6*/ dbIns.AddValue("state", this.state); /*Optional 7*/ dbIns.AddValue("zip", this.zip); /*Optional 8*/ dbIns.AddValue("country_code", this.country_code.Value); dbIns.AddValue("attn", this.attn); /*Optional 10*/ dbIns.AddValue("phone", this.phone); /*Optional 11*/ dbIns.AddValue("fax", this.fax); /*Optional 12*/ dbIns.AddValue("email", this.email); /*Optional 13*/ dbIns.AddValue("event_id", this.event_id.Value); dbIns.AddValue("psafe", this.psafe.Value); dbIns.AddValue("safe_keeping_account_number", this.safe_keeping_account_number);/*Optional 16*/ dbIns.AddValue("depositary_name", this.depositary_name.Value); return(dbIns); }
internal HssUtility.SQLserver.DB_update Get_DBupdate() { if (!this.CheckValueChanges()) { return(null); } HssUtility.SQLserver.DB_update upd = new HssUtility.SQLserver.DB_update(PrimaryCustodian.Get_cmdTP()); if (this.custodian_number.ValueChanged) { upd.AddValue("custodian_number", this.custodian_number); } if (this.name.ValueChanged) { upd.AddValue("name", this.name); } if (this.address1.ValueChanged) { upd.AddValue("address1", this.address1); } if (this.address2.ValueChanged) { upd.AddValue("address2", this.address2); } if (this.city.ValueChanged) { upd.AddValue("city", this.city); } if (this.state.ValueChanged) { upd.AddValue("state", this.state); } if (this.zip.ValueChanged) { upd.AddValue("zip", this.zip); } if (this.country_code.ValueChanged) { upd.AddValue("country_code", this.country_code); } if (this.attn.ValueChanged) { upd.AddValue("attn", this.attn); } if (this.phone.ValueChanged) { upd.AddValue("phone", this.phone); } if (this.fax.ValueChanged) { upd.AddValue("fax", this.fax); } if (this.email.ValueChanged) { upd.AddValue("email", this.email); } if (this.event_id.ValueChanged) { upd.AddValue("event_id", this.event_id); } if (this.psafe.ValueChanged) { upd.AddValue("psafe", this.psafe); } if (this.safe_keeping_account_number.ValueChanged) { upd.AddValue("safe_keeping_account_number", this.safe_keeping_account_number); } if (this.depositary_name.ValueChanged) { upd.AddValue("depositary_name", this.depositary_name); } HssUtility.SQLserver.SQL_relation rela = new HssUtility.SQLserver.SQL_relation("primary_custodian_id", HssUtility.General.RelationalOperator.Equals, this.pk_ID); upd.SetCondition(rela); return(upd); }
/// <summary> /// Initialize object from DB /// </summary> public bool Init_from_DB() { if (this.primary_custodian_id < 0) { return(false); } HssUtility.SQLserver.DB_select db_sel = new HssUtility.SQLserver.DB_select(PrimaryCustodian.Get_cmdTP()); db_sel.tableName = "PrimaryCustodian"; HssUtility.SQLserver.SQL_relation rela = new HssUtility.SQLserver.SQL_relation("primary_custodian_id", HssUtility.General.RelationalOperator.Equals, this.primary_custodian_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); }