75 lines
		
	
	
		
			2.7 KiB
		
	
	
	
		
			C#
		
	
	
	
	
	
			
		
		
	
	
			75 lines
		
	
	
		
			2.7 KiB
		
	
	
	
		
			C#
		
	
	
	
	
	
| using AIMSBLL;
 | |
| using DataDictionary;
 | |
| using System;
 | |
| using System.Collections.Generic;
 | |
| using System.ComponentModel;
 | |
| using System.Data;
 | |
| using System.Drawing;
 | |
| using System.Linq;
 | |
| using System.Text;
 | |
| using System.Windows.Forms;
 | |
| 
 | |
| namespace AIMS.PublicUI.UI
 | |
| {
 | |
|     public partial class frmOperationBodyPosition : Form
 | |
|     {
 | |
|         public List<int> SelectOperationBodyPositionData = new List<int>();
 | |
|         public frmOperationBodyPosition()
 | |
|         {
 | |
|             InitializeComponent();
 | |
|         }
 | |
| 
 | |
|         private void frmOperationBodyPosition_Load(object sender, EventArgs e)
 | |
|         {
 | |
|             ControlExtension.SetDgvAttribute(dgvOperationBodyPosition);
 | |
|             this.txtHelpCode.Text = "简拼/汉字/ICD码";
 | |
|             dgvOperationBodyPosition.DataSource = BOperationBodyPosition.GetDataTable("IsValid =1");
 | |
|             dgvOperationBodyPosition.Select();
 | |
| 
 | |
| 
 | |
|             if (SelectOperationBodyPositionData.Count > 0)
 | |
|             {
 | |
|                 for (int i = 0; i < dgvOperationBodyPosition.Rows.Count; i++)
 | |
|                 {
 | |
|                     if (SelectOperationBodyPositionData.Contains(int.Parse(dgvOperationBodyPosition.Rows[i].Cells["IdColumn"].Value.ToString())))
 | |
|                     {
 | |
|                         dgvOperationBodyPosition.Rows[i].Cells["CheckBoxColumn"].Value = true;
 | |
|                     }
 | |
|                 }
 | |
|             }
 | |
|             txtHelpCode.Focus();
 | |
|         }
 | |
| 
 | |
|         private void btnOk_Click(object sender, EventArgs e)
 | |
|         {
 | |
|             Close();
 | |
|         }
 | |
| 
 | |
|         private void dgvOperationBodyPosition_Click(object sender, EventArgs e)
 | |
|         {
 | |
|             if (Convert.ToBoolean(dgvOperationBodyPosition.CurrentRow.Cells["CheckBoxColumn"].EditedFormattedValue) == false)
 | |
|             {
 | |
|                 SelectOperationBodyPositionData.Add(int.Parse(dgvOperationBodyPosition.CurrentRow.Cells["IdColumn"].Value.ToString()));
 | |
|                 dgvOperationBodyPosition.CurrentRow.Cells["CheckBoxColumn"].Value = true;
 | |
|             }
 | |
|             else
 | |
|             {
 | |
|                 SelectOperationBodyPositionData.Remove(int.Parse(dgvOperationBodyPosition.CurrentRow.Cells["IdColumn"].Value.ToString()));
 | |
|                 dgvOperationBodyPosition.CurrentRow.Cells["CheckBoxColumn"].Value = false;
 | |
|             }
 | |
|         }
 | |
| 
 | |
|         private void txtHelpCode_TextChanged(object sender, EventArgs e)
 | |
|         {
 | |
|             dgvOperationBodyPosition.DataSource =
 | |
|             BOperationBodyPosition.GetDataTable("IsValid =1 AND (Name LIKE '%" + txtHelpCode.Text.Trim() + "%' or helpCode LIKE '%" + txtHelpCode.Text.Trim() + "%')");
 | |
|         }
 | |
| 
 | |
|         private void txtHelpCode_Click(object sender, EventArgs e)
 | |
|         {
 | |
|             this.txtHelpCode.Text = "";
 | |
|             this.txtHelpCode.ForeColor = Color.Black;
 | |
|         }
 | |
|     }
 | |
| }
 |