public static void Init_from_DB() { if ((DateTime.Now - DTC_Participants_master.lastUpdateTime).TotalHours < Utility.RefreshInterval) { return; } DTC_Participants_master.Reset(); DB_select selt = new DB_select(DTC_Participants.Get_cmdTP()); DB_reader reader = new DB_reader(selt, Utility.Get_DRWIN_hDB()); while (reader.Read()) { DTC_Participants dp = new DTC_Participants(); dp.Init_from_reader(reader); DTC_Participants_master.ID_dic[dp.DTC] = dp; DTC_Participants_master.DTCnum_dic[dp.DTC_Number.Value] = dp; } reader.Close(); DTC_Participants_master.lastUpdateTime = DateTime.Now; }
public DTC_Participants GetCopy() { DTC_Participants newEntity = new DTC_Participants(); if (!this.DTC_Number.IsNull_flag) { newEntity.DTC_Number.Value = this.DTC_Number.Value; } if (!this.Company_Name.IsNull_flag) { newEntity.Company_Name.Value = this.Company_Name.Value; } if (!this.ATTN.IsNull_flag) { newEntity.ATTN.Value = this.ATTN.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.Country.IsNull_flag) { newEntity.Country.Value = this.Country.Value; } if (!this.Zip_Postal_Code.IsNull_flag) { newEntity.Zip_Postal_Code.Value = this.Zip_Postal_Code.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.WebsiteUrl.IsNull_flag) { newEntity.WebsiteUrl.Value = this.WebsiteUrl.Value; } if (!this.Email.IsNull_flag) { newEntity.Email.Value = this.Email.Value; } if (!this.Fixed_Payment_ATTN.IsNull_flag) { newEntity.Fixed_Payment_ATTN.Value = this.Fixed_Payment_ATTN.Value; } if (!this.Type.IsNull_flag) { newEntity.Type.Value = this.Type.Value; } if (!this.Depositary.IsNull_flag) { newEntity.Depositary.Value = this.Depositary.Value; } if (!this.RejectEmail.IsNull_flag) { newEntity.RejectEmail.Value = this.RejectEmail.Value; } if (!this.PaymentEmail.IsNull_flag) { newEntity.PaymentEmail.Value = this.PaymentEmail.Value; } if (!this.DocInventoryEmail.IsNull_flag) { newEntity.DocInventoryEmail.Value = this.DocInventoryEmail.Value; } if (!this.SecurityTypeID.IsNull_flag) { newEntity.SecurityTypeID.Value = this.SecurityTypeID.Value; } if (!this.AccountNumber.IsNull_flag) { newEntity.AccountNumber.Value = this.AccountNumber.Value; } if (!this.IssuerCSD.IsNull_flag) { newEntity.IssuerCSD.Value = this.IssuerCSD.Value; } if (!this.ACH_Override.IsNull_flag) { newEntity.ACH_Override.Value = this.ACH_Override.Value; } if (!this.ACH_Bank.IsNull_flag) { newEntity.ACH_Bank.Value = this.ACH_Bank.Value; } if (!this.ACH_ABA.IsNull_flag) { newEntity.ACH_ABA.Value = this.ACH_ABA.Value; } if (!this.ACH_Account.IsNull_flag) { newEntity.ACH_Account.Value = this.ACH_Account.Value; } if (!this.ClearingSystem.IsNull_flag) { newEntity.ClearingSystem.Value = this.ClearingSystem.Value; } if (!this.CustomWireMemo.IsNull_flag) { newEntity.CustomWireMemo.Value = this.CustomWireMemo.Value; } if (!this.ModifiedDateTime.IsNull_flag) { newEntity.ModifiedDateTime.Value = this.ModifiedDateTime.Value; } if (!this.Email_backup.IsNull_flag) { newEntity.Email_backup.Value = this.Email_backup.Value; } if (!this.PaymentEmail_backup.IsNull_flag) { newEntity.PaymentEmail_backup.Value = this.PaymentEmail_backup.Value; } if (!this.RejectEmail_backup.IsNull_flag) { newEntity.RejectEmail_backup.Value = this.RejectEmail_backup.Value; } if (!this.DocInventoryEmail_backup.IsNull_flag) { newEntity.DocInventoryEmail_backup.Value = this.DocInventoryEmail_backup.Value; } return(newEntity); }
internal HssUtility.SQLserver.DB_update Get_DBupdate() { if (!this.CheckValueChanges()) { return(null); } HssUtility.SQLserver.DB_update upd = new HssUtility.SQLserver.DB_update(DTC_Participants.Get_cmdTP()); if (this.DTC_Number.ValueChanged) { upd.AddValue("DTC_Number", this.DTC_Number); } if (this.Company_Name.ValueChanged) { upd.AddValue("Company_Name", this.Company_Name); } if (this.ATTN.ValueChanged) { upd.AddValue("ATTN", this.ATTN); /*Optional 4*/ } if (this.Address1.ValueChanged) { upd.AddValue("Address1", this.Address1); /*Optional 5*/ } if (this.Address2.ValueChanged) { upd.AddValue("Address2", this.Address2); /*Optional 6*/ } if (this.City.ValueChanged) { upd.AddValue("City", this.City); /*Optional 7*/ } if (this.State.ValueChanged) { upd.AddValue("State", this.State); /*Optional 8*/ } if (this.Country.ValueChanged) { upd.AddValue("Country", this.Country); /*Optional 9*/ } if (this.Zip_Postal_Code.ValueChanged) { upd.AddValue("Zip_Postal_Code", this.Zip_Postal_Code); /*Optional 10*/ } if (this.Phone.ValueChanged) { upd.AddValue("Phone", this.Phone); /*Optional 11*/ } if (this.Fax.ValueChanged) { upd.AddValue("Fax", this.Fax); /*Optional 12*/ } if (this.WebsiteUrl.ValueChanged) { upd.AddValue("WebsiteUrl", this.WebsiteUrl); /*Optional 13*/ } if (this.Email.ValueChanged) { upd.AddValue("Email", this.Email); /*Optional 14*/ } if (this.Fixed_Payment_ATTN.ValueChanged) { upd.AddValue("Fixed_Payment_ATTN", this.Fixed_Payment_ATTN); /*Optional 15*/ } if (this.Type.ValueChanged) { upd.AddValue("Type", this.Type); /*Optional 16*/ } if (this.Depositary.ValueChanged) { upd.AddValue("Depositary", this.Depositary); /*Optional 17*/ } if (this.RejectEmail.ValueChanged) { upd.AddValue("RejectEmail", this.RejectEmail); /*Optional 18*/ } if (this.PaymentEmail.ValueChanged) { upd.AddValue("PaymentEmail", this.PaymentEmail); /*Optional 19*/ } if (this.DocInventoryEmail.ValueChanged) { upd.AddValue("DocInventoryEmail", this.DocInventoryEmail); /*Optional 20*/ } if (this.SecurityTypeID.ValueChanged) { upd.AddValue("SecurityTypeID", this.SecurityTypeID); } if (this.AccountNumber.ValueChanged) { upd.AddValue("AccountNumber", this.AccountNumber); } if (this.IssuerCSD.ValueChanged) { upd.AddValue("IssuerCSD", this.IssuerCSD); /*Optional 23*/ } if (this.ACH_Override.ValueChanged) { upd.AddValue("ACH_Override", this.ACH_Override); /*Optional 24*/ } if (this.ACH_Bank.ValueChanged) { upd.AddValue("ACH_Bank", this.ACH_Bank); /*Optional 25*/ } if (this.ACH_ABA.ValueChanged) { upd.AddValue("ACH_ABA", this.ACH_ABA); /*Optional 26*/ } if (this.ACH_Account.ValueChanged) { upd.AddValue("ACH_Account", this.ACH_Account); /*Optional 27*/ } if (this.ClearingSystem.ValueChanged) { upd.AddValue("ClearingSystem", this.ClearingSystem); } if (this.CustomWireMemo.ValueChanged) { upd.AddValue("CustomWireMemo", this.CustomWireMemo); /*Optional 29*/ } if (this.ModifiedDateTime.ValueChanged) { upd.AddValue("ModifiedDateTime", this.ModifiedDateTime); /*Optional 30*/ } if (this.Email_backup.ValueChanged) { upd.AddValue("Email_backup", this.Email_backup); /*Optional 31*/ } if (this.PaymentEmail_backup.ValueChanged) { upd.AddValue("PaymentEmail_backup", this.PaymentEmail_backup); /*Optional 32*/ } if (this.RejectEmail_backup.ValueChanged) { upd.AddValue("RejectEmail_backup", this.RejectEmail_backup); /*Optional 33*/ } if (this.DocInventoryEmail_backup.ValueChanged) { upd.AddValue("DocInventoryEmail_backup", this.DocInventoryEmail_backup); /*Optional 34*/ } HssUtility.SQLserver.SQL_relation rela = new HssUtility.SQLserver.SQL_relation("DTC", 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(DTC_Participants.Get_cmdTP()); dbIns.AddValue("DTC", this.DTC); dbIns.AddValue("DTC_Number", this.DTC_Number); dbIns.AddValue("Company_Name", this.Company_Name); dbIns.AddValue("ATTN", this.ATTN); /*Optional 4*/ dbIns.AddValue("Address1", this.Address1); /*Optional 5*/ dbIns.AddValue("Address2", this.Address2); /*Optional 6*/ dbIns.AddValue("City", this.City); /*Optional 7*/ dbIns.AddValue("State", this.State); /*Optional 8*/ dbIns.AddValue("Country", this.Country); /*Optional 9*/ dbIns.AddValue("Zip_Postal_Code", this.Zip_Postal_Code); /*Optional 10*/ dbIns.AddValue("Phone", this.Phone); /*Optional 11*/ dbIns.AddValue("Fax", this.Fax); /*Optional 12*/ dbIns.AddValue("WebsiteUrl", this.WebsiteUrl); /*Optional 13*/ dbIns.AddValue("Email", this.Email); /*Optional 14*/ dbIns.AddValue("Fixed_Payment_ATTN", this.Fixed_Payment_ATTN); /*Optional 15*/ dbIns.AddValue("Type", this.Type); /*Optional 16*/ dbIns.AddValue("Depositary", this.Depositary); /*Optional 17*/ dbIns.AddValue("RejectEmail", this.RejectEmail); /*Optional 18*/ dbIns.AddValue("PaymentEmail", this.PaymentEmail); /*Optional 19*/ dbIns.AddValue("DocInventoryEmail", this.DocInventoryEmail); /*Optional 20*/ dbIns.AddValue("SecurityTypeID", this.SecurityTypeID); dbIns.AddValue("AccountNumber", this.AccountNumber); dbIns.AddValue("IssuerCSD", this.IssuerCSD); /*Optional 23*/ dbIns.AddValue("ACH_Override", this.ACH_Override); /*Optional 24*/ dbIns.AddValue("ACH_Bank", this.ACH_Bank); /*Optional 25*/ dbIns.AddValue("ACH_ABA", this.ACH_ABA); /*Optional 26*/ dbIns.AddValue("ACH_Account", this.ACH_Account); /*Optional 27*/ dbIns.AddValue("ClearingSystem", this.ClearingSystem); dbIns.AddValue("CustomWireMemo", this.CustomWireMemo); /*Optional 29*/ dbIns.AddValue("ModifiedDateTime", this.ModifiedDateTime); /*Optional 30*/ dbIns.AddValue("Email_backup", this.Email_backup); /*Optional 31*/ dbIns.AddValue("PaymentEmail_backup", this.PaymentEmail_backup); /*Optional 32*/ dbIns.AddValue("RejectEmail_backup", this.RejectEmail_backup); /*Optional 33*/ dbIns.AddValue("DocInventoryEmail_backup", this.DocInventoryEmail_backup); /*Optional 34*/ return(dbIns); }
/// <summary> /// Initialize object from DB /// </summary> public bool Init_from_DB() { if (this.DTC < 0) { return(false); } HssUtility.SQLserver.DB_select db_sel = new HssUtility.SQLserver.DB_select(DTC_Participants.Get_cmdTP()); db_sel.tableName = "DTC_Participants"; HssUtility.SQLserver.SQL_relation rela = new HssUtility.SQLserver.SQL_relation("DTC", HssUtility.General.RelationalOperator.Equals, this.DTC); db_sel.SetCondition(rela); bool res_flag = false; HssUtility.SQLserver.DB_reader reader = new HssUtility.SQLserver.DB_reader(db_sel, Utility.Get_DRWIN_hDB()); if (reader.Read()) { this.Init_from_reader(reader); res_flag = true; } reader.Close(); return(res_flag); }