Пример #1
0
        public void ChangeCrawlerMonitorInfo(CrawlerData pCrawlerData)
        {
            for (Int32 i = 0; i < dataGridView_List.Rows.Count; i++)
            {
                Int32 monitorseq = Convert.ToInt32(dataGridView_List.Rows[i].Cells[SeqIndex_].Value);

                if (monitorseq == pCrawlerData.seq_)
                {
                    string            id = "";
                    AuthorityInfoData pAuthorityInfoData = AuthorityManager.Instance.GetAuthrity(pCrawlerData.AuthoritySeq_);
                    if (pAuthorityInfoData != null)
                    {
                        id = pAuthorityInfoData.partnerName_;
                    }

                    dataGridView_List.Rows[i].Cells[1].Value = string.Format("{0}:{1}", pCrawlerData.IP_, pCrawlerData.CrawlerSeq_);
                    dataGridView_List.Rows[i].Cells[2].Value = pCrawlerData.CrawlerName_;
                    dataGridView_List.Rows[i].Cells[3].Value = id;
                    dataGridView_List.Rows[i].Cells[4].Value = pCrawlerData.ChannelName_;
                    dataGridView_List.Rows[i].Cells[5].Value = string.Format("{0}", pCrawlerData.AuthorityLoginName_);
                    dataGridView_List.Rows[i].Cells[6].Value = pCrawlerData.CrawlerState_;
                    break;
                }
            }
        }
Пример #2
0
        private void comboDropDown_SelectedIndexChanged_Authority(object sender, EventArgs e)
        {
            comboBox_Channel.Items.Clear();
            comboBox_Channel.Items.Add("채널을 선택하세요.");

            if (comboBox_Authority.SelectedIndex == 0)
            {
                comboBox_Channel.Enabled = false;
            }
            else
            {
                comboBox_Channel.Enabled = true;

                AuthorityInfoData pAuthorityInfoData = AuthorityManager.Instance.GetAuthrityByComboBoxIndex(comboBox_Authority.SelectedIndex);

                List_TempChannel_.Clear();
                AuthorityLoginManager.Instance.GetChannelListByAuthoritySeq(pAuthorityInfoData.seq_, ref List_TempChannel_);

                foreach (var pData in List_TempChannel_)
                {
                    comboBox_Channel.Items.Add(pData.ChannelName_);
                }
            }

            comboBox_Channel.SelectedIndex = 0;
        }
Пример #3
0
        // 크롤러 모니터 정보 refresh
        public void RefreshGoodsTable()
        {
            GoodsListForm_.ClearList();
            Dictionary <Int32, CGoodsData> plist = GoodsManager.Instance.GetList();

            foreach (var pData in plist)
            {
                AuthorityInfoData pAuthorityInfoData = AuthorityManager.Instance.GetAuthrity(pData.Value.AuthoritySeq_);
                if (pAuthorityInfoData == null)
                {
                    pData.Value.AuthrityName_ = "권리사 찾을수 없음";
                }
                else
                {
                    pData.Value.AuthrityName_ = pAuthorityInfoData.partnerName_;
                }

                ChannelInfoData pChannelInfoData = ChannelManager.Instance.GetChannel(pData.Value.ChannelSeq_);
                if (pChannelInfoData == null)
                {
                    pData.Value.ChannelName_ = "채널 찾을수 없음";
                }
                else
                {
                    pData.Value.ChannelName_ = pChannelInfoData.ChannelName_;
                }

                GoodsListForm_.Add_List(pData.Value);

                //GoodsListForm_.Add_List(pData.Value.Seq_.ToString(), pData.Value.GoodsName_, pData.Value.OptionName_, pData.Value.ChannelName_
                //    , pData.Value.AuthrityName_, "none");
            }
        }
Пример #4
0
    // 권리사 정보 로드
    public static bool GetAuthorityList(SqlHelper dbHelper)
    {
        try
        {
            AuthorityManager.Instance.InitList();

            MySqlDataReader datareader = dbHelper.call_proc("spNewSelectAuthority", null);

            Int32 ComboBoxIndex = 1;
            while (datareader.Read())
            {
                AuthorityInfoData pAuthorityInfoData = new AuthorityInfoData();

                if (datareader["seq"] != DBNull.Value)
                {
                    pAuthorityInfoData.seq_ = Convert.ToInt32(datareader["seq"]);
                }

                if (datareader["partnerName"] != DBNull.Value)
                {
                    pAuthorityInfoData.partnerName_ = Convert.ToString(datareader["partnerName"]);
                }

                //if (datareader["ChannelSeq"] != DBNull.Value)
                //    pAuthorityInfoData.ChannelSeq_ = Convert.ToInt32(datareader["ChannelSeq"]);

                //if (datareader["ChannelName"] != DBNull.Value)
                //    pAuthorityInfoData.ChannelName_ = Convert.ToString(datareader["ChannelName"]);

                //if (datareader["PartnerSeq"] != DBNull.Value)
                //    pAuthorityInfoData.PartnerSeq_ = Convert.ToInt32(datareader["PartnerSeq"]);

                //if (datareader["AuthorityName"] != DBNull.Value)
                //    pAuthorityInfoData.AuthorityName_ = Convert.ToString(datareader["AuthorityName"]);

                //if (datareader["Name"] != DBNull.Value)
                //    pAuthorityInfoData.AuthorityName_Identity_ = Convert.ToString(datareader["Name"]);

                //if (datareader["ID"] != DBNull.Value)
                //    pAuthorityInfoData.ID_ = Convert.ToString(datareader["ID"]);

                pAuthorityInfoData.ComboIndex_ = ComboBoxIndex++;

                AuthorityManager.Instance.GetList().Add(pAuthorityInfoData.seq_, pAuthorityInfoData);
            }

            datareader.Close();
            datareader.Dispose();
            datareader = null;
        }
        catch (System.Exception ex)
        {
            return(false);
        }

        return(true);
    }
Пример #5
0
        public void SettingCurInfo(CrawlerData pCrawlerData)
        {
            CrawlerData_ = pCrawlerData;

            AuthorityInfoData pAuthorityInfoData = AuthorityManager.Instance.GetAuthrity(pCrawlerData.AuthoritySeq_);

            if (pAuthorityInfoData != null)
            {
                comboBox_Authority.SelectedIndex = pAuthorityInfoData.ComboIndex_;
            }
            else
            {
                comboBox_Authority.SelectedIndex = 0;
            }


            Int32 nSeleIndex = 0;

            if (List_TempChannel_.Count > 0 && pCrawlerData.ChannelSeq_ > 0)
            {
                for (Int32 i = 0; i < List_TempChannel_.Count; i++)
                {
                    if (List_TempChannel_[i].seq_ == pCrawlerData.ChannelSeq_)
                    {
                        nSeleIndex = i + 1;
                        break;
                    }
                }
            }

            comboBox_Channel.SelectedIndex = nSeleIndex;

            nSeleIndex = 0;
            if (List_TempAutoLogin_.Count > 0 && pCrawlerData.AuthorityLoginSeq_ > 0)
            {
                for (Int32 i = 0; i < List_TempAutoLogin_.Count; i++)
                {
                    if (List_TempAutoLogin_[i].seq_ == pCrawlerData.AuthorityLoginSeq_)
                    {
                        nSeleIndex = i + 1;
                        break;
                    }
                }
            }

            comboBox_AuthLogin.SelectedIndex = nSeleIndex;


            textBox_CrawlerSeq.Text = pCrawlerData.CrawlerSeq_.ToString();

            label_MonitorSeq.Text    = pCrawlerData.seq_.ToString();
            textBox_CrawlerName.Text = pCrawlerData.CrawlerName_;

            comboBox_CrawlerMode.SelectedIndex = pCrawlerData.Mode_;
            textBox_Memo.Text = pCrawlerData.Memo_;
        }
Пример #6
0
        private void comboDropDown_SelectedIndexChanged_Channel(object sender, EventArgs e)
        {
//            MessageBox.Show("comboDropDown_SelectedIndexChanged_Channel");
            if (SelectIndex_Channel_ == comboBox_Channel.SelectedIndex)
            {
                return;
            }

            SelectIndex_Channel_ = comboBox_Channel.SelectedIndex;

            AuthorityInfoData pAuthorityInfoData = AuthorityManager.Instance.GetAuthrityByComboBoxIndex(SelectIndex_Authority_);

            comboBox_AuthLogin.Items.Clear();
            comboBox_AuthLogin.Items.Add("모든 권리사 로그인");

            List_TempAutoLogin_.Clear();

            if (SelectIndex_Channel_ > 0)
            {
                //ChannelInfoTempData pChannelInfoTempData = ChannelTempManager.Instance.GetChannelByComboBoxIndex(SelectIndex_Channel_);
                AuthorityLoginManager.Instance.GetAuthorityLoginListByAuthoSeqAndChannelSeq(pAuthorityInfoData.seq_
                                                                                            , List_TempChannel_[SelectIndex_Channel_ - 1].seq_, ref List_TempAutoLogin_);

                foreach (var pData in List_TempAutoLogin_)
                {
                    comboBox_AuthLogin.Items.Add(pData.Name_);
                }
            }

            if (SelectIndex_Channel_ == 0)
            {
                comboBox_AuthLogin.Enabled = false;
            }
            else
            {
                comboBox_AuthLogin.Enabled = true;
            }

            SelectIndex_AuthorityLogin_      = -1;
            comboBox_AuthLogin.SelectedIndex = 0;
        }
Пример #7
0
        private void comboDropDown_SelectedIndexChanged_Auth(object sender, EventArgs e)
        {
            if (SelectIndex_Authority_ == comboBox_Auth.SelectedIndex)
            {
                return;
            }

            SelectIndex_Authority_ = comboBox_Auth.SelectedIndex;

            comboBox_Channel.Items.Clear();
            comboBox_Channel.Items.Add("모든 채널");

            if (SelectIndex_Authority_ > 0)
            {
                AuthorityInfoData pAuthorityInfoData = AuthorityManager.Instance.GetAuthrityByComboBoxIndex(SelectIndex_Authority_);
                List_TempChannel_.Clear();
                AuthorityLoginManager.Instance.GetChannelListByAuthoritySeq(pAuthorityInfoData.seq_, ref List_TempChannel_);

                foreach (var pData in List_TempChannel_)
                {
                    comboBox_Channel.Items.Add(pData.ChannelName_);
                }
            }

            if (SelectIndex_Authority_ == 0)
            {
                comboBox_Channel.Enabled = false;
            }
            else
            {
                comboBox_Channel.Enabled = true;
            }

            SelectIndex_Channel_           = -1;
            comboBox_Channel.SelectedIndex = 0;
        }
Пример #8
0
        private void comboDropDown_SelectedIndexChanged_Channel(object sender, EventArgs e)
        {
            comboBox_AuthLogin.Items.Clear();
            comboBox_AuthLogin.Items.Add("권리사 로그인을 선택하세요.");

            if (comboBox_Channel.SelectedIndex == 0)
            {
                comboBox_AuthLogin.Enabled = false;
            }
            else
            {
                comboBox_AuthLogin.Enabled = true;
                AuthorityInfoData pAuthorityInfoData = AuthorityManager.Instance.GetAuthrityByComboBoxIndex(comboBox_Authority.SelectedIndex);
                TempChannel       pTempChannel       = List_TempChannel_[comboBox_Channel.SelectedIndex - 1];
                List_TempAutoLogin_.Clear();
                AuthorityLoginManager.Instance.GetAuthorityLoginListByAuthoSeqAndChannelSeq(pAuthorityInfoData.seq_, pTempChannel.seq_, ref List_TempAutoLogin_);
                foreach (var pData in List_TempAutoLogin_)
                {
                    comboBox_AuthLogin.Items.Add(pData.Name_);
                }
            }

            comboBox_AuthLogin.SelectedIndex = 0;
        }
Пример #9
0
        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;
                            }
                        }
                    }
                }
            }
        }
Пример #10
0
        public void Add_List(CrawlerData pCrawlerData)
        {
            DataGridViewRow r1 = new DataGridViewRow();

            // 모니터 시퀀스
            DataGridViewTextBoxCell cell_seq = new DataGridViewTextBoxCell();

            cell_seq.Value = pCrawlerData.seq_;
            r1.Cells.Add(cell_seq);

            // 고유 번호( 아이피 와 크롤러 시퀀스 )
            DataGridViewTextBoxCell cell_IP = new DataGridViewTextBoxCell();

            cell_IP.Value = string.Format("{0}:{1}", pCrawlerData.IP_, pCrawlerData.CrawlerSeq_);
            r1.Cells.Add(cell_IP);

            // 크롤러 이름
            DataGridViewTextBoxCell cell_CName = new DataGridViewTextBoxCell();

            cell_CName.Value = pCrawlerData.CrawlerName_;
            r1.Cells.Add(cell_CName);

            // 권리사
            string            id = "";
            AuthorityInfoData pAuthorityInfoData = AuthorityManager.Instance.GetAuthrity(pCrawlerData.AuthoritySeq_);

            if (pAuthorityInfoData != null)
            {
                id = pAuthorityInfoData.partnerName_;
            }

            DataGridViewTextBoxCell cell_auth = new DataGridViewTextBoxCell();

            cell_auth.Value = id;
            r1.Cells.Add(cell_auth);

            // 채널
            DataGridViewTextBoxCell cell_channel = new DataGridViewTextBoxCell();

            cell_channel.Value = pCrawlerData.ChannelName_;
            r1.Cells.Add(cell_channel);

            // 권리사 로그인
            DataGridViewTextBoxCell cell_authlogin = new DataGridViewTextBoxCell();

            cell_authlogin.Value = string.Format("{0}", pCrawlerData.AuthorityLoginName_);
            r1.Cells.Add(cell_authlogin);

            // 상태
            DataGridViewTextBoxCell cell_state = new DataGridViewTextBoxCell();

            cell_state.Value = pCrawlerData.CrawlerState_;
            r1.Cells.Add(cell_state);

            // 최근 변경 시간
            DataGridViewTextBoxCell cell_update = new DataGridViewTextBoxCell();

            cell_update.Value = pCrawlerData.UpdateDate_;
            r1.Cells.Add(cell_update);

            dataGridView_List.Rows.Add(r1);
        }
Пример #11
0
    // 권리사 정보 로드
    public static bool GetAuthorityList(SqlHelper dbHelper)
    {
        try
        {
            AuthorityManager.Instance.InitList();

            MySqlDataReader datareader = dbHelper.call_proc("spNewSelectAuthority", null);

            Int32 ComboBoxIndex = 1;
            while (datareader.Read())
            {
                AuthorityInfoData pAuthorityInfoData = new AuthorityInfoData();

                if (datareader["seq"] != DBNull.Value)
                    pAuthorityInfoData.seq_ = Convert.ToInt32(datareader["seq"]);

                if (datareader["partnerName"] != DBNull.Value)
                    pAuthorityInfoData.partnerName_ = Convert.ToString(datareader["partnerName"]);

                //if (datareader["ChannelSeq"] != DBNull.Value)
                //    pAuthorityInfoData.ChannelSeq_ = Convert.ToInt32(datareader["ChannelSeq"]);

                //if (datareader["ChannelName"] != DBNull.Value)
                //    pAuthorityInfoData.ChannelName_ = Convert.ToString(datareader["ChannelName"]);

                //if (datareader["PartnerSeq"] != DBNull.Value)
                //    pAuthorityInfoData.PartnerSeq_ = Convert.ToInt32(datareader["PartnerSeq"]);

                //if (datareader["AuthorityName"] != DBNull.Value)
                //    pAuthorityInfoData.AuthorityName_ = Convert.ToString(datareader["AuthorityName"]);

                //if (datareader["Name"] != DBNull.Value)
                //    pAuthorityInfoData.AuthorityName_Identity_ = Convert.ToString(datareader["Name"]);

                //if (datareader["ID"] != DBNull.Value)
                //    pAuthorityInfoData.ID_ = Convert.ToString(datareader["ID"]);

                pAuthorityInfoData.ComboIndex_ = ComboBoxIndex++;

                AuthorityManager.Instance.GetList().Add(pAuthorityInfoData.seq_, pAuthorityInfoData);
            }

            datareader.Close();
            datareader.Dispose();
            datareader = null;
        }
        catch (System.Exception ex)
        {
            return false;
        }

        return true;
    }
Пример #12
0
        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("변경 완료 되었습니다.");
            }
        }