private void btnOK_Click(object sender, EventArgs e) { if (this.Text == "添加项目") { string strCol = "projectname,province,remarks"; string strRow = "'" + txtProName.Text.Trim() + "'," + "'" + txtProvince.Text.Trim() + "'," + "'" + txtRemarks.Text.Trim() + "'"; dataDisposes.Insertfull("projectinfo", strCol, strRow); } if (this.Text == "修改项目") { string strCol = "projectname" + "='" + txtProName.Text.Trim() + "'," + "province" + "='" + txtProvince.Text.Trim() + "'," + "remarks" + "='" + txtRemarks.Text.Trim() + "'"; dataDisposes.Update("projectinfo", strCol, "where projectid=" + txtProID.Text); } State = true; this.Close(); this.Dispose(); }
private void btnOK_Click(object sender, EventArgs e) { if (this.Text == "添加类型") { string strCol = "typename,category,remarks"; string strRow = "'" + txtTypeName.Text.Trim() + "'," + "'" + txtCategory.Text.Trim() + "'," + "'" + txtRemarks.Text.Trim() + "'"; dataDisposes.Insertfull("exceptionstype", strCol, strRow); } if (this.Text == "修改类型") { string strCol = "typename" + "='" + txtTypeName.Text.Trim() + "'," + "category" + "='" + txtCategory.Text.Trim() + "'," + "remarks" + "='" + txtRemarks.Text.Trim() + "'"; dataDisposes.Update("exceptionstype", strCol, "where typeid=" + txtTypeID.Text); } TypeName = txtTypeName.Text; ID = Convert.ToInt32(txtTypeID.Text); State = true; this.Close(); this.Dispose(); }