private void button1_Click(object sender, EventArgs e) { using (无票费用录入 mForm = new 无票费用录入()) { mForm.ShowDialog(); } }
private void dgvCustomerBills_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex >= 0) { if (dgvNoTicket.Rows[e.RowIndex].Cells["Status"].Value.ToString() == "未审批" || Common.AuthenticateRight.AuthOperation(111303) || CommonClass.SttUser.blSuperUser) { if (e.ColumnIndex == dgvNoTicket.Columns["ColModify"].Index)//修改 { 无票费用录入 mForm = new 无票费用录入(); mForm.mId = Convert.ToInt64(dgvNoTicket.Rows[e.RowIndex].Cells["idDataGridViewTextBoxColumn"].Value); mForm.ShowDialog(); refresh(); } if (e.ColumnIndex == dgvNoTicket.Columns["ColDel"].Index)//删除 { if (MessageBox.Show("确认要删除该条记录吗?", "警告", MessageBoxButtons.OKCancel) == DialogResult.OK) { if (dgvNoTicket.Rows[e.RowIndex].Cells["Status"].Value.ToString() == "未审批" || Common.AuthenticateRight.AuthOperation(111304) || CommonClass.SttUser.blSuperUser) { string mSql = string.Format("UPDATE T_NoTicket SET P1 = '{0}' WHERE Id = {1}", "删除", Convert.ToInt64(dgvNoTicket.Rows[e.RowIndex].Cells["idDataGridViewTextBoxColumn"].Value)); int ret = SqlHelper.ExecuteNonQuery(mSql); if (ret > 0) { MessageBox.Show("删除成功!"); } else { MessageBox.Show("删除失败!"); } refresh(); } } } } } }