void TSMIwb_Click(object sender, EventArgs e) { this.TSMIcode.Checked = false; this.TSMIName.Checked = false; this.TSMIpy.Checked = false; this.TSMIwb.Checked = true; this.TSMIcode.CheckState = System.Windows.Forms.CheckState.Unchecked; this.TSMIName.CheckState = System.Windows.Forms.CheckState.Unchecked; this.TSMIpy.CheckState = System.Windows.Forms.CheckState.Unchecked; this.TSMIwb.CheckState = System.Windows.Forms.CheckState.Checked; this.PyOrWb = NameByType.wb; this.BackColor = Color.Yellow; }
private void SetPyWb(NameByType py) { switch (py) { case NameByType.code: { sqlp = new SqlParameter[] { new SqlParameter("@code", this.Text.ToUpper() + '%'), new SqlParameter("@name", '%'), new SqlParameter("@wb_code", '%'), new SqlParameter("@py_code", '%') }; break; } case NameByType.name: { sqlp = new SqlParameter[] { new SqlParameter("@code", '%'), new SqlParameter("@name", this.Text.ToUpper() + '%'), new SqlParameter("@wb_code", '%'), new SqlParameter("@py_code", '%') }; break; } case NameByType.py: { sqlp = new SqlParameter[] { new SqlParameter("@code", '%'), new SqlParameter("@name", '%'), new SqlParameter("@wb_code", '%'), new SqlParameter("@py_code", this.Text.ToUpper() + '%') }; break; } case NameByType.wb: { sqlp = new SqlParameter[] { new SqlParameter("@code", '%'), new SqlParameter("@name", '%'), new SqlParameter("@wb_code", this.Text.ToUpper() + '%'), new SqlParameter("@py_code", '%') }; break; } default: { sqlp = new SqlParameter[] { new SqlParameter("@code", '%'), new SqlParameter("@name", '%'), new SqlParameter("@wb_code", '%'), new SqlParameter("@py_code", this.Text.ToUpper() + '%') }; } break; } }
public UcAutoTextBox() { // dbProvider = DbFactoryProvider.GetProvider(DbLinks["ProductDBLink"].DbType, SecretHelper.AESDecrypt(DbLinks["ProductDBLink"].DbLink)); this.exShow = new ErrorProvider(); this.PyOrWb = NameByType.py; //this.SetPyWb(NameByType.py); //this.GetTagSql(this.tagsql); this.ReViewCount = RuseltAmount.R10; this.popupdgv = new DataGridView(); this.popupdgv.AutoGenerateColumns = false; this.Width = 100; this.popupdgv.ReadOnly = true; this.popupdgv.Visible = false; this.popupdgv.Margin = new Padding(0, 0, 0, 0); this.popupdgv.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; this.popupdgv.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; this.popupdgv.AllowUserToAddRows = false; this.popupdgv.AllowUserToResizeRows = false; this.popupdgv.RowHeadersVisible = false; this.popupdgv.Tag = "111"; this.popupdgv.Font = this.Font; this.popupdgv.SelectionMode = DataGridViewSelectionMode.FullRowSelect; this.popupdgv.AllowUserToResizeRows = false; this.popupdgv.MultiSelect = false; this.popupdgv.CellMouseClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(dgv_CellMouseClick); this.CMS = new ContextMenuStrip(); this.TSMIpy = new System.Windows.Forms.ToolStripMenuItem(); this.TSMIwb = new System.Windows.Forms.ToolStripMenuItem(); this.TSMIcode = new System.Windows.Forms.ToolStripMenuItem(); this.TSMIName = new System.Windows.Forms.ToolStripMenuItem(); this.TSMIsplit = new System.Windows.Forms.ToolStripSeparator(); this.TSMI10 = new System.Windows.Forms.ToolStripMenuItem(); this.TSMI20 = new System.Windows.Forms.ToolStripMenuItem(); this.TSMI50 = new System.Windows.Forms.ToolStripMenuItem(); this.TSMIAll = new System.Windows.Forms.ToolStripMenuItem(); this.TSMIsplit1 = new System.Windows.Forms.ToolStripSeparator(); this.TSMITAG = new System.Windows.Forms.ToolStripMenuItem(); this.CMS.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.TSMIpy, this.TSMIwb, this.TSMIcode, this.TSMIName, this.TSMIsplit, this.TSMI10, this.TSMI20, this.TSMI50, this.TSMIAll, this.TSMIsplit1, this.TSMITAG }); this.CMS.Name = "CMS"; this.CMS.Size = new System.Drawing.Size(153, 224); // // TSMIpy // this.TSMIpy.Checked = true; this.TSMIpy.CheckState = System.Windows.Forms.CheckState.Checked; this.TSMIpy.Name = "TSMIpy"; this.TSMIpy.Size = new System.Drawing.Size(152, 24); this.TSMIpy.Text = "拼音"; this.TSMIpy.Click += new EventHandler(TSMIpy_Click); // // TSMIwb // this.TSMIwb.Checked = false; this.TSMIwb.CheckState = System.Windows.Forms.CheckState.Unchecked; this.TSMIwb.Name = "TSMIwb"; this.TSMIwb.Size = new System.Drawing.Size(152, 24); this.TSMIwb.Text = "五笔"; this.TSMIwb.Click += new EventHandler(TSMIwb_Click); // // TSMIcode // this.TSMIcode.Checked = false; this.TSMIcode.CheckState = System.Windows.Forms.CheckState.Unchecked; this.TSMIcode.Name = "TSMIcode"; this.TSMIcode.Size = new System.Drawing.Size(152, 24); this.TSMIcode.Text = "代码"; this.TSMIcode.Click += new EventHandler(TSMIcode_Click); // // TSMIName // this.TSMIName.Checked = false; this.TSMIName.CheckState = System.Windows.Forms.CheckState.Unchecked; this.TSMIName.Name = "TSMIName"; this.TSMIName.Size = new System.Drawing.Size(152, 24); this.TSMIName.Text = "名称"; this.TSMIName.Click += new EventHandler(TSMIName_Click); // // // TSMIsplit // this.TSMIsplit.Name = "TSMIsplit"; this.TSMIsplit.Size = new System.Drawing.Size(149, 6); // // TSMI10 // this.TSMI10.Checked = true; this.TSMI10.CheckState = System.Windows.Forms.CheckState.Checked; this.TSMI10.Name = "TSMI10"; this.TSMI10.Size = new System.Drawing.Size(152, 24); this.TSMI10.Text = "10行"; this.TSMI10.Click += new EventHandler(TSMIR10_Click); // // TSMI20 // this.TSMI20.Checked = false; this.TSMI20.CheckState = System.Windows.Forms.CheckState.Unchecked; this.TSMI20.Name = "TSMI20"; this.TSMI20.Size = new System.Drawing.Size(152, 24); this.TSMI20.Text = "20行"; this.TSMI20.Click += new EventHandler(TSMIR20_Click); // // TSMI50 // this.TSMI50.Checked = false; this.TSMI50.CheckState = System.Windows.Forms.CheckState.Unchecked; this.TSMI50.Name = "TSMI50"; this.TSMI50.Size = new System.Drawing.Size(152, 24); this.TSMI50.Text = "50行"; this.TSMI50.Click += new EventHandler(TSMIR50_Click); // // TSMIAll // this.TSMIAll.Checked = false; this.TSMIAll.CheckState = System.Windows.Forms.CheckState.Unchecked; this.TSMIAll.Name = "TSMIAll"; this.TSMIAll.Size = new System.Drawing.Size(152, 24); this.TSMIAll.Text = "所有行"; this.TSMIAll.Click += new EventHandler(TSMIRAll_Click); // // // TSMIsplit // this.TSMIsplit1.Name = "TSMIsplit"; this.TSMIsplit1.Size = new System.Drawing.Size(149, 6); //this.TSMITAG.Checked = false; //this.TSMITAG.CheckState = System.Windows.Forms.CheckState.Unchecked; this.TSMITAG.Name = "TSMITAG"; this.TSMITAG.Size = new System.Drawing.Size(152, 24); this.TSMITAG.Text = "获取TagSql号"; this.TSMITAG.Click += new EventHandler(TSMITAG_Click); this.ContextMenuStrip = this.CMS; }