public static void Init_from_DB() { if ((DateTime.Now - RateMaster_edi.lastUpdateTime).TotalHours < Utility.RefreshInterval) { return; } RateMaster_edi.Reset(); DB_select selt = new DB_select(StatutoryRate_edi.Get_cmdTP()); DB_reader reader = new DB_reader(selt, Utility.Get_DRWIN_hDB()); while (reader.Read()) { StatutoryRate_edi rt = new StatutoryRate_edi(); rt.Init_from_reader(reader); string key = rt.coi.Value; if (key == null) { key = ""; } if (!RateMaster_edi.coi_dic.ContainsKey(key)) { List <StatutoryRate_edi> list = new List <StatutoryRate_edi>(); RateMaster_edi.coi_dic[key] = list; } RateMaster_edi.coi_dic[key].Add(rt); } reader.Close(); RateMaster_edi.lastUpdateTime = DateTime.Now; }
internal HssUtility.SQLserver.DB_update Get_DBupdate() { if (!this.CheckValueChanges()) { return(null); } HssUtility.SQLserver.DB_update upd = new HssUtility.SQLserver.DB_update(StatutoryRate_edi.Get_cmdTP()); if (this.coi.ValueChanged) { upd.AddValue("coi", this.coi); } if (this.cor.ValueChanged) { upd.AddValue("cor", this.cor); } if (this.statry_rt.ValueChanged) { upd.AddValue("statry_rt", this.statry_rt); } if (this.int_rt.ValueChanged) { upd.AddValue("int_rt", this.int_rt); } if (this.effect_dt.ValueChanged) { upd.AddValue("effect_dt", this.effect_dt); } if (this.created_dt.ValueChanged) { upd.AddValue("created_dt", this.created_dt); } if (this.modified_dt.ValueChanged) { upd.AddValue("modified_dt", this.modified_dt); } if (this.migratedId.ValueChanged) { upd.AddValue("migratedId", this.migratedId); } if (this.sec_type.ValueChanged) { upd.AddValue("sec_type", this.sec_type); } if (this.bo_typ.ValueChanged) { upd.AddValue("bo_typ", this.bo_typ); } HssUtility.SQLserver.SQL_relation rela = new HssUtility.SQLserver.SQL_relation("id", HssUtility.General.RelationalOperator.Equals, this.pk_ID); upd.SetCondition(rela); return(upd); }
public StatutoryRate_edi GetCopy() { StatutoryRate_edi newEntity = new StatutoryRate_edi(); if (!this.coi.IsNull_flag) { newEntity.coi.Value = this.coi.Value; } if (!this.cor.IsNull_flag) { newEntity.cor.Value = this.cor.Value; } if (!this.statry_rt.IsNull_flag) { newEntity.statry_rt.Value = this.statry_rt.Value; } if (!this.int_rt.IsNull_flag) { newEntity.int_rt.Value = this.int_rt.Value; } if (!this.effect_dt.IsNull_flag) { newEntity.effect_dt.Value = this.effect_dt.Value; } if (!this.created_dt.IsNull_flag) { newEntity.created_dt.Value = this.created_dt.Value; } if (!this.modified_dt.IsNull_flag) { newEntity.modified_dt.Value = this.modified_dt.Value; } if (!this.migratedId.IsNull_flag) { newEntity.migratedId.Value = this.migratedId.Value; } if (!this.sec_type.IsNull_flag) { newEntity.sec_type.Value = this.sec_type.Value; } if (!this.bo_typ.IsNull_flag) { newEntity.bo_typ.Value = this.bo_typ.Value; } return(newEntity); }
/// <summary> /// Initialize object from DB /// </summary> public bool Init_from_DB() { if (this.id < 0) { return(false); } HssUtility.SQLserver.DB_select db_sel = new HssUtility.SQLserver.DB_select(StatutoryRate_edi.Get_cmdTP()); db_sel.tableName = "edi_strtapprv"; HssUtility.SQLserver.SQL_relation rela = new HssUtility.SQLserver.SQL_relation("id", HssUtility.General.RelationalOperator.Equals, this.id); 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); }
internal HssUtility.SQLserver.DB_insert Get_DBinsert() { HssUtility.SQLserver.DB_insert dbIns = new HssUtility.SQLserver.DB_insert(StatutoryRate_edi.Get_cmdTP()); dbIns.AddValue("coi", this.coi); /*Optional 2*/ dbIns.AddValue("cor", this.cor); /*Optional 3*/ dbIns.AddValue("statry_rt", this.statry_rt); /*Optional 4*/ dbIns.AddValue("int_rt", this.int_rt); /*Optional 5*/ dbIns.AddValue("effect_dt", this.effect_dt); /*Optional 6*/ dbIns.AddValue("created_dt", this.created_dt); /*Optional 7*/ dbIns.AddValue("modified_dt", this.modified_dt); /*Optional 8*/ dbIns.AddValue("migratedId", this.migratedId); /*Optional 9*/ dbIns.AddValue("sec_type", this.sec_type); /*Optional 10*/ dbIns.AddValue("bo_typ", this.bo_typ); /*Optional 11*/ return(dbIns); }