private void btnAll_Pro_Click(object sender, EventArgs e) { frmItem myfrmItem = new frmItem(); if (myfrmItem.ShowDialog() == DialogResult.Yes) { if (myfrmItem.paramProductID.Length > 0) { this.paramProductID = myfrmItem.paramProductID; this.txtProductName.Text = myfrmItem.paramProductName; } } }
private void CheckCell() { if (Game.Map.LocationOfAdventurer.HasItem) { frmItem foundItem = new frmItem(); foundItem.ShowDialog(); UpdateLabels(); } if (Game.Map.LocationOfAdventurer.HasMonster == true && Game.Map.LocationOfAdventurer.Monster.isAlive()) { frmMonster foundMonster = new frmMonster(); foundMonster.ShowDialog(); UpdateLabels(); } if (Game.Map.LocationOfAdventurer.HasBeenSeen == false) { Game.Map.LocationOfAdventurer.HasBeenSeen = true; } showGameOver(); }
//取项目列表 public int m_GetItem() { DataTable dt = new DataTable(); //frmItem objItem = new frmItem(); string strItem = m_objViewerCollect.txt_Item.Text.ToUpper().Trim(); this.m_objMain.m_GetItem(strItem, out dt); if (dt.Rows.Count <= 0) { MessageBox.Show("抱歉,没有找到对应的项目记录!", "提示 ", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return(-1); } if (dt.Rows.Count == 1) { //change 2007.5.8 zhu.w.t //m_objViewerCollect.txt_Item.Text = dt.Rows[0]["ITEMID_CHR"].ToString().Trim(); //==================================================================>> m_objViewerCollect.txt_Item.Text = dt.Rows[0]["ITEMCODE_VCHR"].ToString().Trim(); m_objViewerCollect.txt_Item.Tag = dt.Rows[0]["ITEMID_CHR"].ToString().Trim(); m_strItemCode = dt.Rows[0]["ITEMCODE_VCHR"].ToString().Trim(); //<<================================================================= m_objViewerCollect.labItemName.Text = dt.Rows[0]["ITEMNAME_VCHR"].ToString().Trim(); return(1); } else { frmItem frmItem_view = new frmItem(); for (int i = 0; i < dt.Rows.Count; i++) { DataRow dr = dt.Rows[i]; ListViewItem li = new ListViewItem(); li.SubItems.Clear(); //change 2007.5.8 zhu.w.t //li.SubItems[0].Text = dr["ITEMID_CHR"].ToString(); //================================================>> li.SubItems[0].Text = dr["ITEMCODE_VCHR"].ToString(); //<<================================================ li.SubItems.Add(dr["ITEMNAME_VCHR"].ToString()); li.Tag = dr; frmItem_view.m_lsvList.Items.Add(li); } if (frmItem_view.ShowDialog() == DialogResult.OK) { //change 2007.5.8 zhu.w.t //string itemcode = frmItem_view.ItemCode; //=================>> string itemcode = frmItem_view.ItemCode_Vchr; m_objViewerCollect.txt_Item.Tag = frmItem_view.ItemCode; //<<===================== string itemname = frmItem_view.ItemName; m_objViewerCollect.txt_Item.Text = itemcode; m_objViewerCollect.labItemName.Text = itemname; // MessageBox.Show(itemcode + " " + itemname); } else { m_objViewerCollect.txt_Item.Text = string.Empty; m_objViewerCollect.labItemName.Text = string.Empty; } frmItem_view.Dispose(); } return(1); }