日期:2014-05-18 浏览次数:21064 次
public void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) { string str_class; str_class = dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString(); count++; this.cdTableAdapter.Adapter.SelectCommand.CommandText = "select name from cd where type=\"" + str_type + "\" and class=\"" + str_class + "\" order by code desc"; this.cdTableAdapter.Fill(this.memuDataSet.cd); if (Rowcnt == 0) { this.cdTableAdapter.Adapter.SelectCommand.CommandText = "select name from cd where type=\"" + str_type + "\" and s_men=\"" + str_class + "\" or class=\"" + str_class + "\" order by code desc"; this.cdTableAdapter.Fill(this.memuDataSet.cd); } }
private void 删除ToolStripMenuItem_Click(object sender, EventArgs e) { this.cdTableAdapter.Adapter.UpdateCommand.CommandText = "update cd set type=\"DEL\" where name=\"" + str_class + "\""; }
public int Rowcnt { get { return dataGridView1.RowCount; } } public int count=0; private string n { get { if (TB=="XF") switch (count) { case 1: return "B"; case 2: return "C"; case 3: return "D"; case 4: return "E"; case 5: return "F"; case 6: return "G"; default: return "A"; } else switch (count) { case 1: return "A"; case 2: return "B"; case 3: return "C"; case 4: return "D"; case 5: return "E"; case 6: return "F"; default: return ""; } } } public string str_type { get { if (Rowcnt == 0) return "节目"; else if (TB == "ST") if (count == 0) return "SYS"; return "菜单" + n; } }
public class FrmMain { // private string _str_class=string.Empty; public string StrClass { set{_str_class=value;} get{return _str_class;} } public void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) { string str_class; str_class = dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString(); count++; this.cdTableAdapter.Adapter.SelectCommand.CommandText = "select name from cd where type=\"&qu