public Int32 GetAuthorityLoginListByAuthoSeqAndChannelSeq(Int32 authseq, Int32 ChannelSeq, ref List <TempAutoLogin> list) { Int32 Result_Count = 0; foreach (var pData in List_) { if (pData.Value.PartnerSeq_ == authseq && pData.Value.ChannelSeq_ == ChannelSeq) { TempAutoLogin pTempAutoLogin = new TempAutoLogin(); pTempAutoLogin.seq_ = pData.Value.seq_; pTempAutoLogin.Name_ = pData.Value.Name_; list.Add(pTempAutoLogin); Result_Count++; } } return(Result_Count); }
void RefreshList() { const Int32 AuthoIndex = 6; const Int32 ChannelIndex = 3; const Int32 AuthoLoginIndex = 9; // 일단 다 켜고 for (Int32 i = 0; i < dataGridView_GoodList.Rows.Count; i++) { dataGridView_GoodList.Rows[i].Visible = true; } if (SelectIndex_Authority_ > 0) { AuthorityInfoData pAuthorityInfoData = AuthorityManager.Instance.GetAuthrityByComboBoxIndex(SelectIndex_Authority_); for (Int32 i = 0; i < dataGridView_GoodList.Rows.Count; i++) { if (dataGridView_GoodList.Rows[i].Visible == true) { string str_autho = dataGridView_GoodList.Rows[i].Cells[AuthoIndex].Value.ToString(); if (string.IsNullOrEmpty(str_autho) == true) { dataGridView_GoodList.Rows[i].Visible = false; } else { Int32 authoSeq = Convert.ToInt32(str_autho); if (authoSeq != pAuthorityInfoData.seq_) { dataGridView_GoodList.Rows[i].Visible = false; } } } } } if (SelectIndex_Channel_ > 0 && SelectIndex_Channel_ <= List_TempChannel_.Count) { TempChannel pTempChannel = List_TempChannel_[SelectIndex_Channel_ - 1]; for (Int32 i = 0; i < dataGridView_GoodList.Rows.Count; i++) { if (dataGridView_GoodList.Rows[i].Visible == true) { string str_channel = dataGridView_GoodList.Rows[i].Cells[ChannelIndex].Value.ToString(); if (string.IsNullOrEmpty(str_channel) == true) { dataGridView_GoodList.Rows[i].Visible = false; } else { Int32 channelseq = Convert.ToInt32(str_channel); if (channelseq != pTempChannel.seq_) { dataGridView_GoodList.Rows[i].Visible = false; } } } } } if (SelectIndex_AuthorityLogin_ > 0 && SelectIndex_AuthorityLogin_ <= List_TempAutoLogin_.Count) { TempAutoLogin pTempAutoLogin = List_TempAutoLogin_[SelectIndex_AuthorityLogin_ - 1]; for (Int32 i = 0; i < dataGridView_GoodList.Rows.Count; i++) { if (dataGridView_GoodList.Rows[i].Visible == true) { string str_authologin = dataGridView_GoodList.Rows[i].Cells[AuthoLoginIndex].Value.ToString(); if (string.IsNullOrEmpty(str_authologin) == true) { dataGridView_GoodList.Rows[i].Visible = false; } else { Int32 autologinseq = Convert.ToInt32(str_authologin); if (autologinseq != pTempAutoLogin.seq_) { dataGridView_GoodList.Rows[i].Visible = false; } } } } } }
private void button_Confirm_Click(object sender, EventArgs e) { bool bChanged = false; MainForm pMainForm = (MainForm)this.Owner; if (comboBox_Authority.SelectedIndex == 0) { MessageBox.Show("권리사를 선택하세요"); return; } if (comboBox_Channel.SelectedIndex == 0 || List_TempChannel_.Count == 0) { MessageBox.Show("채널을 선택하세요"); return; } if (comboBox_AuthLogin.SelectedIndex == 0 || List_TempAutoLogin_.Count == 0) { MessageBox.Show("권리사 로그인을 선택하세요"); return; } if (comboBox_CrawlerMode.SelectedIndex == 0) { MessageBox.Show("모드를 선택하세요"); return; } Int32 xMonitorSeq = Convert.ToInt32(label_MonitorSeq.Text); string xCrawlerName = textBox_CrawlerName.Text; TempChannel pTempChannel = List_TempChannel_[comboBox_Channel.SelectedIndex - 1]; //ChannelInfoData pChannelInfoData = ChannelManager.Instance.GetChannelByComboBoxIndex(comboBox_Channel.SelectedIndex); Int32 xChannelSeq = pTempChannel.seq_; string xChannelName = pTempChannel.ChannelName_; TempAutoLogin pTempAutoLogin = List_TempAutoLogin_[comboBox_AuthLogin.SelectedIndex - 1]; Int32 xAuthLoginSeq = pTempAutoLogin.seq_; string xAuthLoginName = pTempAutoLogin.Name_; AuthorityInfoData pAuthorityInfoData = AuthorityManager.Instance.GetAuthrityByComboBoxIndex(comboBox_Authority.SelectedIndex); Int32 xAuthoritySeq = pAuthorityInfoData.seq_; string xAuthorityName = pAuthorityInfoData.partnerName_; Int32 xCrawlerSeq = 0; try { xCrawlerSeq = Convert.ToInt32(textBox_CrawlerSeq.Text); } catch (System.Exception ex) { xCrawlerSeq = 0; } if (xCrawlerSeq == 0) { MessageBox.Show("크롤러 시퀀스 값이 이상합니다."); return; } Int32 xMode = comboBox_CrawlerMode.SelectedIndex; string xCrawler_OnOff = ""; string xCrawler_location = ""; Int32 xCrawlerCheckTime = 0; Int32 xDBUpdateTime = 0; string xMemo = textBox_Memo.Text; if (xCrawlerName != CrawlerData_.CrawlerName_ || xCrawlerSeq != CrawlerData_.CrawlerSeq_ || xChannelSeq != CrawlerData_.ChannelSeq_ || xAuthoritySeq != CrawlerData_.AuthoritySeq_ || xMode != CrawlerData_.Mode_ || xMemo != CrawlerData_.Memo_ || xAuthLoginSeq != CrawlerData_.AuthorityLoginSeq_) { bChanged = CMDBInterFace.UpdateCrawlerMonitorInfo(CInfoManager.Instance.DB(), xMonitorSeq, xCrawlerName, xChannelSeq, xChannelName , xAuthoritySeq, xAuthorityName, xCrawlerSeq, xMode, xCrawler_OnOff, xCrawler_location, xCrawlerCheckTime, xDBUpdateTime , xMemo, xAuthLoginSeq, xAuthLoginName); if (bChanged == true) { CrawlerData_.CrawlerName_ = xCrawlerName; CrawlerData_.CrawlerSeq_ = xCrawlerSeq; CrawlerData_.ChannelSeq_ = xChannelSeq; CrawlerData_.ChannelName_ = xChannelName; CrawlerData_.AuthoritySeq_ = xAuthoritySeq; CrawlerData_.AuthorityLoginSeq_ = xAuthLoginSeq; CrawlerData_.AuthorityLoginName_ = xAuthLoginName; CrawlerData_.Mode_ = xMode; CrawlerData_.Memo_ = xMemo; pMainForm.ChangeCrawlerMonitorInfo(CrawlerData_); } } CrawlerData_ = null; Close(); if (bChanged == true) { MessageBox.Show("변경 완료 되었습니다."); } }