public static int Insert_DTC_Participants(List <DTC_Participants> dp_list) { if (dp_list == null) { return(-1); } Bulk_DBcmd bk_cmd = new Bulk_DBcmd(); foreach (DTC_Participants dp in dp_list) { if (dp == null) { continue; } bk_cmd.Add_DBcmd(dp.Get_DBinsert()); } int count = bk_cmd.SaveToDB(Utility.Get_DRWIN_hDB()); if (count > 0) { DTC_Participants_master.Reset(); } return(count); }
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; }