void AddToList(CGoodsData pCGoodsData) { DataGridViewRow r1 = new DataGridViewRow(); // 상품 시퀀스 DataGridViewTextBoxCell cell_seq = new DataGridViewTextBoxCell(); cell_seq.Value = pCGoodsData.Seq_; r1.Cells.Add(cell_seq); // 상품명 DataGridViewTextBoxCell cell_GoodsName = new DataGridViewTextBoxCell(); cell_GoodsName.Value = pCGoodsData.GoodsName_; r1.Cells.Add(cell_GoodsName); // 옵션명 DataGridViewTextBoxCell cell_OptionName = new DataGridViewTextBoxCell(); cell_OptionName.Value = pCGoodsData.OptionName_; r1.Cells.Add(cell_OptionName); // 채널 DataGridViewTextBoxCell cell_Channel = new DataGridViewTextBoxCell(); cell_Channel.Value = pCGoodsData.ChannelName_; r1.Cells.Add(cell_Channel); dataGridView_GoodsList.Rows.Add(r1); }
public void Add_List(CGoodsData pCGoodsData) { DataGridViewRow r1 = new DataGridViewRow(); // 시퀀스 DataGridViewTextBoxCell cell_seq = new DataGridViewTextBoxCell(); cell_seq.Value = pCGoodsData.Seq_; r1.Cells.Add(cell_seq); // 상품명 DataGridViewTextBoxCell cell_Name = new DataGridViewTextBoxCell(); cell_Name.Value = pCGoodsData.GoodsName_; r1.Cells.Add(cell_Name); // 옵션명 DataGridViewTextBoxCell cell_Option = new DataGridViewTextBoxCell(); cell_Option.Value = pCGoodsData.OptionName_; r1.Cells.Add(cell_Option); // 채널 DataGridViewTextBoxCell cell_channel = new DataGridViewTextBoxCell(); //cell_channel.Value = pCGoodsData.ChannelName_; cell_channel.Value = pCGoodsData.ChannelSeq_.ToString(); r1.Cells.Add(cell_channel); // 상품명(닉 DataGridViewTextBoxCell cell_goods_nick = new DataGridViewTextBoxCell(); cell_goods_nick.Value = pCGoodsData.GoodsNickName_; r1.Cells.Add(cell_goods_nick); // 옵션명(닉 DataGridViewTextBoxCell cell_option_nick = new DataGridViewTextBoxCell(); cell_option_nick.Value = pCGoodsData.OptionNickName_; r1.Cells.Add(cell_option_nick); // 권리사 DataGridViewTextBoxCell cell_Auth = new DataGridViewTextBoxCell(); cell_Auth.Value = pCGoodsData.AuthoritySeq_; r1.Cells.Add(cell_Auth); // 크롤러 시퀀스 DataGridViewTextBoxCell cell_crawler_seq = new DataGridViewTextBoxCell(); cell_crawler_seq.Value = pCGoodsData.CrawlerSeq_; r1.Cells.Add(cell_crawler_seq); // 상태 DataGridViewTextBoxCell cell_State = new DataGridViewTextBoxCell(); cell_State.Value = pCGoodsData.State_; r1.Cells.Add(cell_State); // 권리사 로그인 시퀀스 DataGridViewTextBoxCell cell_AuLogin = new DataGridViewTextBoxCell(); cell_AuLogin.Value = pCGoodsData.AuthorityLoginSeq_; r1.Cells.Add(cell_AuLogin); dataGridView_GoodList.Rows.Add(r1); }
public void SettingCurInfo(CGoodsData pCGoodsData) { CGoodsData_ = pCGoodsData; label_GoodsSeq.Text = pCGoodsData.Seq_.ToString(); textBox_Crawler_Seq.Text = pCGoodsData.CrawlerSeq_.ToString(); textBox_GoodNick.Text = pCGoodsData.GoodsNickName_; textBox_OptionNick.Text = pCGoodsData.OptionNickName_; textBox_GoodName.Text = pCGoodsData.GoodsName_; textBox_Option.Text = pCGoodsData.OptionName_; }
public void ChangeCrawlerSeq(CGoodsData pCGoodsData) { for (Int32 i = 0; i < dataGridView_GoodList.Rows.Count; i++) { Int32 goodsseq = Convert.ToInt32(dataGridView_GoodList.Rows[i].Cells[0].Value); if (goodsseq == pCGoodsData.Seq_) { dataGridView_GoodList.Rows[i].Cells[7].Value = pCGoodsData.CrawlerSeq_; break; } } }
public void ChangeGoodsNickAndOptionNick(CGoodsData pCGoodsData) { for (Int32 i = 0; i < dataGridView_GoodList.Rows.Count; i++) { Int32 goodsseq = Convert.ToInt32(dataGridView_GoodList.Rows[i].Cells[0].Value); if (goodsseq == pCGoodsData.Seq_) { dataGridView_GoodList.Rows[i].Cells[4].Value = pCGoodsData.GoodsNickName_; dataGridView_GoodList.Rows[i].Cells[5].Value = pCGoodsData.OptionNickName_; break; } } }
void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex >= 0) { this.dataGridView_GoodList.Rows[e.RowIndex].Selected = true; MainForm pForm = (MainForm)this.ParentForm; string value = dataGridView_GoodList.Rows[e.RowIndex].Cells[0].Value.ToString(); ManagerNavigation.Instance.Selected_Goods_Seq_ = Convert.ToInt32(value); CGoodsData pCGoodsData = GoodsManager.Instance.GetCGoodsData(ManagerNavigation.Instance.Selected_Goods_Seq_); UpdateGoodsForm pUpdateGoodsForm = new UpdateGoodsForm(); pUpdateGoodsForm.SettingCurInfo(pCGoodsData); pUpdateGoodsForm.ShowDialog(this); } }
private void button_Confirm_Click(object sender, EventArgs e) { bool bChanged = false; MainForm pMainForm = (MainForm)this.Owner; Int32 CrawlerSeq = Convert.ToInt32(textBox_Crawler_Seq.Text); string GoodNick = textBox_GoodNick.Text; string optionNick = textBox_OptionNick.Text; if (CrawlerSeq != CGoodsData_.CrawlerSeq_) { if (CMDBInterFace.UpdateGoodsCrawlerSeq(CInfoManager.Instance.DB(), CGoodsData_.Seq_, CrawlerSeq) == true) { CGoodsData_.CrawlerSeq_ = CrawlerSeq; pMainForm.ChangeCrawlerSeq(CGoodsData_); bChanged = true; } } if (GoodNick != CGoodsData_.GoodsNickName_ || optionNick != CGoodsData_.OptionNickName_) { if (CMDBInterFace.UpdateGoodsNickName(CInfoManager.Instance.DB(), CGoodsData_.Seq_, GoodNick, optionNick) == true) { CGoodsData_.GoodsNickName_ = GoodNick; CGoodsData_.OptionNickName_ = optionNick; pMainForm.ChangeGoodsNickAndOptionNick(CGoodsData_); bChanged = true; } } // 초기화 CGoodsData_ = null; Close(); if (bChanged == true) { MessageBox.Show("변경 완료 되었습니다."); } }
private void button_Confirm_Click(object sender, EventArgs e) { bool bChanged = false; MainForm pMainForm = (MainForm)this.Owner; Int32 CrawlerSeq = Convert.ToInt32(textBox_Crawler_Seq.Text); string GoodNick = textBox_GoodNick.Text; string optionNick = textBox_OptionNick.Text; if (CrawlerSeq != CGoodsData_.CrawlerSeq_) { if (CMDBInterFace.UpdateGoodsCrawlerSeq(CInfoManager.Instance.DB(), CGoodsData_.Seq_, CrawlerSeq) == true) { CGoodsData_.CrawlerSeq_ = CrawlerSeq; pMainForm.ChangeCrawlerSeq(CGoodsData_); bChanged = true; } } if (GoodNick != CGoodsData_.GoodsNickName_ || optionNick != CGoodsData_.OptionNickName_) { if (CMDBInterFace.UpdateGoodsNickName(CInfoManager.Instance.DB(), CGoodsData_.Seq_, GoodNick, optionNick) == true) { CGoodsData_.GoodsNickName_ = GoodNick; CGoodsData_.OptionNickName_ = optionNick; pMainForm.ChangeGoodsNickAndOptionNick(CGoodsData_); bChanged = true; } } // 초기화 CGoodsData_ = null; Close(); if (bChanged == true) MessageBox.Show("변경 완료 되었습니다."); }
public void ChangeCrawlerSeq(CGoodsData pCGoodsData) { for(Int32 i = 0; i < dataGridView_GoodList.Rows.Count; i++) { Int32 goodsseq = Convert.ToInt32(dataGridView_GoodList.Rows[i].Cells[0].Value); if (goodsseq == pCGoodsData.Seq_) { dataGridView_GoodList.Rows[i].Cells[7].Value = pCGoodsData.CrawlerSeq_; break; } } }
// 상품 정보 로드하기 public static bool GetGoodsTable(SqlHelper dbHelper) { try { GoodsManager.Instance.InitList(); MySqlDataReader datareader = dbHelper.call_proc("spNewSelectGoods", null); while (datareader.Read()) { CGoodsData pCGoodsData = new CGoodsData(); if (datareader["seq"] != DBNull.Value) { pCGoodsData.Seq_ = Convert.ToInt32(datareader["seq"]); } if (datareader["GoodsCode"] != DBNull.Value) { pCGoodsData.Goods_Code_ = Convert.ToString(datareader["GoodsCode"]); } if (datareader["GoodsName"] != DBNull.Value) { pCGoodsData.GoodsName_ = Convert.ToString(datareader["GoodsName"]); } if (datareader["GoodsNick"] != DBNull.Value) { pCGoodsData.GoodsNickName_ = Convert.ToString(datareader["GoodsNick"]); } if (datareader["GoodsOptionName"] != DBNull.Value) { pCGoodsData.OptionName_ = Convert.ToString(datareader["GoodsOptionName"]); } if (datareader["GoodsNickName"] != DBNull.Value) { pCGoodsData.OptionNickName_ = Convert.ToString(datareader["GoodsNickName"]); } if (datareader["ChannelSeq"] != DBNull.Value) { pCGoodsData.ChannelSeq_ = Convert.ToInt32(datareader["ChannelSeq"]); } if (datareader["AuthoritySeq"] != DBNull.Value) { pCGoodsData.AuthoritySeq_ = Convert.ToInt32(datareader["AuthoritySeq"]); } if (datareader["AuthorityLoginSeq"] != DBNull.Value) { pCGoodsData.AuthorityLoginSeq_ = Convert.ToInt32(datareader["AuthorityLoginSeq"]); } if (datareader["CrawlerSeq"] != DBNull.Value) { pCGoodsData.CrawlerSeq_ = Convert.ToInt32(datareader["CrawlerSeq"]); } if (datareader["State"] != DBNull.Value) { pCGoodsData.State_ = Convert.ToString(datareader["State"]); } GoodsManager.Instance.GetList().Add(pCGoodsData.Seq_, pCGoodsData); } datareader.Close(); datareader.Dispose(); datareader = null; } catch (System.Exception ex) { return(false); } return(true); }
public void ChangeGoodsNickAndOptionNick(CGoodsData pCGoodsData_) { GoodsListForm_.ChangeGoodsNickAndOptionNick(pCGoodsData_); }
public void ChangeCrawlerSeq(CGoodsData pCGoodsData_) { GoodsListForm_.ChangeCrawlerSeq(pCGoodsData_); }
// 상품 정보 로드하기 public static bool GetGoodsTable(SqlHelper dbHelper) { try { GoodsManager.Instance.InitList(); MySqlDataReader datareader = dbHelper.call_proc("spNewSelectGoods", null); while (datareader.Read()) { CGoodsData pCGoodsData = new CGoodsData(); if (datareader["seq"] != DBNull.Value) pCGoodsData.Seq_ = Convert.ToInt32(datareader["seq"]); if (datareader["GoodsCode"] != DBNull.Value) pCGoodsData.Goods_Code_ = Convert.ToString(datareader["GoodsCode"]); if (datareader["GoodsName"] != DBNull.Value) pCGoodsData.GoodsName_ = Convert.ToString(datareader["GoodsName"]); if (datareader["GoodsNick"] != DBNull.Value) pCGoodsData.GoodsNickName_ = Convert.ToString(datareader["GoodsNick"]); if (datareader["GoodsOptionName"] != DBNull.Value) pCGoodsData.OptionName_ = Convert.ToString(datareader["GoodsOptionName"]); if (datareader["GoodsNickName"] != DBNull.Value) pCGoodsData.OptionNickName_ = Convert.ToString(datareader["GoodsNickName"]); if (datareader["ChannelSeq"] != DBNull.Value) pCGoodsData.ChannelSeq_ = Convert.ToInt32(datareader["ChannelSeq"]); if (datareader["AuthoritySeq"] != DBNull.Value) pCGoodsData.AuthoritySeq_ = Convert.ToInt32(datareader["AuthoritySeq"]); if (datareader["AuthorityLoginSeq"] != DBNull.Value) pCGoodsData.AuthorityLoginSeq_ = Convert.ToInt32(datareader["AuthorityLoginSeq"]); if (datareader["CrawlerSeq"] != DBNull.Value) pCGoodsData.CrawlerSeq_ = Convert.ToInt32(datareader["CrawlerSeq"]); if (datareader["State"] != DBNull.Value) pCGoodsData.State_ = Convert.ToString(datareader["State"]); GoodsManager.Instance.GetList().Add(pCGoodsData.Seq_, pCGoodsData); } datareader.Close(); datareader.Dispose(); datareader = null; } catch (System.Exception ex) { return false; } return true; }