private void 修改ToolStripMenuItem1_Click(object sender, EventArgs e) { if (!PowerCheckCsClass.IfHasPower(LoginClass.LogID, CommFunction.GSYSNAME, sender, CommFunction.ConnectString)) { return; } if (dataGridView1.Rows.Count <= 0) { return; } FrmEditIceMaster.falg = "Edit"; FrmEditIceMaster.pSpdm = dataGridView1.Rows[dataGridView1.CurrentCell.RowIndex].Cells["商品代码"].Value.ToString(); FrmEditIceMaster.pPm = dataGridView1.Rows[dataGridView1.CurrentCell.RowIndex].Cells["品名"].Value.ToString(); FrmEditIceMaster.pGg = dataGridView1.Rows[dataGridView1.CurrentCell.RowIndex].Cells["规格"].Value.ToString(); FrmEditIceMaster.pLx = dataGridView1.Rows[dataGridView1.CurrentCell.RowIndex].Cells["类型"].Value.ToString(); FrmEditIceMaster.pDw = dataGridView1.Rows[dataGridView1.CurrentCell.RowIndex].Cells["单位"].Value.ToString(); FrmEditIceMaster.pSxsj = dataGridView1.Rows[dataGridView1.CurrentCell.RowIndex].Cells["失效时间"].Value.ToString(); FrmEditIceMaster.pSexsj = dataGridView1.Rows[dataGridView1.CurrentCell.RowIndex].Cells["生效时间"].Value.ToString(); FrmEditIceMaster.pCctj = dataGridView1.Rows[dataGridView1.CurrentCell.RowIndex].Cells["存储条件"].Value.ToString(); FrmEditIceMaster.pSsgs = dataGridView1.Rows[dataGridView1.CurrentCell.RowIndex].Cells["所属公司"].Value.ToString(); FrmEditIceMaster.ShowUniqueForm(true); if (FrmEditIceMaster.ifSave) { OleDbDataAdapter sda = new OleDbDataAdapter(ResultSelect, CommFunction.ConnectString); DataSet ds = new DataSet(); sda.Fill(ds, "chk_con2"); dataGridView1.DataSource = ds.Tables["chk_con2"]; dataGridView1.AutoResizeColumns(); } }
private void 新增ToolStripMenuItem1_Click(object sender, EventArgs e) { if (!PowerCheckCsClass.IfHasPower(LoginClass.LogID, CommFunction.GSYSNAME, sender, CommFunction.ConnectString)) { return; } FrmEditIceMaster.falg = "Add"; FrmEditIceMaster.ShowUniqueForm(true); if (FrmEditIceMaster.ifSave) { string sql = "select size_desc 商品代码,sku_desc 品名,sku_format 规格,sku_type 类型, season 所属公司,invalid_time 失效时间,valid_time 生效时间,store_condition 存储条件,sku_unit 单位" + " from ice_master where size_desc in (" + FrmEditIceMaster.ResultSpdm + "') order by size_desc"; OleDbDataAdapter sda = new OleDbDataAdapter(sql, CommFunction.ConnectString); DataSet ds = new DataSet(); sda.Fill(ds, "chk_con2"); dataGridView1.DataSource = ds.Tables["chk_con2"]; dataGridView1.AutoResizeColumns(); } }
private void FrmEditIceMaster_FormClosed(object sender, FormClosedEventArgs e) { pUniqueForm = null;//窗体唯一打开代码 }
public FrmEditIceMaster() { pUniqueForm = this;//窗体唯一打开代码 InitializeComponent(); }
private static FrmEditIceMaster pUniqueForm = null; //窗体唯一打开代码 #endregion Fields #region Constructors public FrmEditIceMaster() { pUniqueForm = this;//窗体唯一打开代码 InitializeComponent(); }