internal HssUtility.SQLserver.DB_update Get_DBupdate() { if (!this.CheckValueChanges()) { return(null); } HssUtility.SQLserver.DB_update upd = new HssUtility.SQLserver.DB_update(Country_ProcedureTypes.Get_cmdTP()); if (this.IsSponsored.ValueChanged) { upd.AddValue("IsSponsored", this.IsSponsored); } if (this.At_Source.ValueChanged) { upd.AddValue("At_Source", this.At_Source); } if (this.Quick_Refund.ValueChanged) { upd.AddValue("Quick_Refund", this.Quick_Refund); } if (this.Long_Form.ValueChanged) { upd.AddValue("Long_Form", this.Long_Form); } HssUtility.SQLserver.SQL_relation rela = new HssUtility.SQLserver.SQL_relation("Country", HssUtility.General.RelationalOperator.Equals, this.pk_ID); upd.SetCondition(rela); return(upd); }
public static void Init_from_DB() { if ((DateTime.Now - ProcedureTypeMaster.lastUpdateTime).TotalHours < Utility.RefreshInterval) { return; } ProcedureTypeMaster.Reset(); DB_select selt = new DB_select(Country_ProcedureTypes.Get_cmdTP()); DB_reader reader = new DB_reader(selt, Utility.Get_DRWIN_hDB()); while (reader.Read()) { Country_ProcedureTypes cpt = new Country_ProcedureTypes(); cpt.Init_from_reader(reader); if (!ProcedureTypeMaster.CPT_dic.ContainsKey(cpt.Country)) { List <Country_ProcedureTypes> list = new List <Country_ProcedureTypes>(); ProcedureTypeMaster.CPT_dic[cpt.Country] = list; } ProcedureTypeMaster.CPT_dic[cpt.Country].Add(cpt); } reader.Close(); ProcedureTypeMaster.lastUpdateTime = DateTime.Now; }
/// <summary> /// Initialize object from DB /// </summary> public bool Init_from_DB() { if (string.IsNullOrEmpty(this.Country)) { return(false); } HssUtility.SQLserver.DB_select db_sel = new HssUtility.SQLserver.DB_select(Country_ProcedureTypes.Get_cmdTP()); db_sel.tableName = "Country_ProcedureTypes"; HssUtility.SQLserver.SQL_relation rela = new HssUtility.SQLserver.SQL_relation("Country", HssUtility.General.RelationalOperator.Equals, this.Country); 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(Country_ProcedureTypes.Get_cmdTP()); dbIns.AddValue("IsSponsored", this.IsSponsored);/*Optional 2*/ dbIns.AddValue("At_Source", this.At_Source.Value); dbIns.AddValue("Quick_Refund", this.Quick_Refund.Value); dbIns.AddValue("Long_Form", this.Long_Form.Value); return(dbIns); }