private void DropAllAddSQL(ref List<DropAll> list) { if (!DBInfoConnection.TestConnection()) { ShowWindow("Нет подключения"); } foreach (var npc_list in DropAll) { if (npc_list.NpcID == list[0].NpcID) { var npc = new DataBase.sqlTable.Data.t_npc_drop_all(); var db = new InquirySQL(); npc_list.Item = list[0].Item; npc.a_npc_idx = npc_list.NpcID; db.DellDropAll_NPC(npc, DBInfoConnection); foreach (var item in npc_list.Item) { npc.a_npc_idx = npc_list.NpcID; npc.a_item_idx = item.idx; npc.a_prob = item.percent; db.DropAll_NPC_Add(npc, DBInfoConnection); } break; } } ShowWindow("Готово"); }
private void DropAllAction(InquirySQL.ActionSQL action, int npcId, int item = 0, int prob = 0) { var npc = new DataBase.sqlTable.Data.t_npc_drop_all(); npc.a_npc_idx = npcId; npc.a_item_idx = item; npc.a_prob = prob; InquirySQL sql = new InquirySQL(); if (action == InquirySQL.ActionSQL.DEL) sql.DellDropAll_NPC(npc, DBInfoConnection); else if (action == InquirySQL.ActionSQL.ADD) sql.DropAll_NPC_Add(npc, DBInfoConnection); }