/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void F4COMN_MouseDoubleClick(object sender, System.Windows.Forms.MouseEventArgs e) { //if (e.KeyCode == Keys.F4) //{ DataDicCommon.Gf_Master_DD(rControl, fControl, GetQuery(), "", 0, GetFilter(), 1); //} }
/// <summary> /// F4点击事件。按下“F4”时,显示数据字典。 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void F4EventProc(object sender, System.Windows.Forms.KeyEventArgs e) { if (e.KeyCode == Keys.F4) { DataDicCommon.Gf_Master_DD(rControl, fControl, GetQuery(), "", 0, GetFilter(), 1); } }
private void MouseDoublePorc(object sender, System.Windows.Forms.MouseEventArgs e) { while (rControl.Count > 0) { rControl.Remove(1); } while (fControl.Count > 0) { fControl.Remove(1); } foreach (BControlFiledSetting obj in CustomSetting) { rControl.Add(obj.TargetControl, null, null, null); fControl.Add(obj.ColumnID, null, null, null); } DataDicCommon.Gf_Master_DD(rControl, fControl, GetQuery(), "", 0, GetFilter(), 1); //if (e.KeyCode == Keys.F4) //{ // DataDicCommon.Gf_Master_DD(rControl, fControl, GetQuery(), "", 0, GetFilter(), 1); //} //else //{ // for (int i = 2; i <= rControl.Count; i++) // { // ((Control)rControl[i]).Text = ""; // } // string sSql = GetQuery().ToUpper(); // if (sSql.Contains("WHERE")) // sSql += " AND " + fControl[1] + " ='" + ((Control)rControl[1]).Text + "'"; // else // sSql += " where " + fControl[1] + "='" + ((Control)rControl[1]).Text + "'"; // ADODB.Recordset AdoRs = new ADODB.Recordset(); // if (GeneralCommon.M_CN1.State == 0) // if (GeneralCommon.GF_DbConnect() == false) return; // AdoRs.Open(sSql, GeneralCommon.M_CN1, ADODB.CursorTypeEnum.adOpenDynamic, ADODB.LockTypeEnum.adLockReadOnly, -1); // if (AdoRs.RecordCount == 1) // { // for (int i = 2; i <= rControl.Count; i++) // { // ((Control)rControl[i]).Text = AdoRs.Fields[i - 1].Value.ToString(); // } // } // AdoRs = null; // GeneralCommon.M_CN1.Close(); //} }
/// <summary> /// F4COMR控件KeyUp事件。 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void CD_KeyUp(object sender, System.Windows.Forms.KeyEventArgs e) { if (e.KeyCode == Keys.F4) { DataDicCommon.Gf_Master_DD(rControl, fControl, GetQuery(), "", 0, GetFilter(), 1); } else { //If Len(Trim(CD.Text)) = CInt(Me.sMax) Then // CD_NAME.Text = DataDicCommon.Gf_CommNameFind(GeneralCommon.M_CN1, Me.sKey, Trim(CD.Text).ToUpper, 2) //Else // CD_NAME.Text = "" //End If ChangeCDNameText(); } }
private void CD_MouseDoubleClick(object sender, MouseEventArgs e) { DataDicCommon.Gf_Master_DD(rControl, fControl, GetQuery(), "", 0, GetFilter(), 1); }
/// <summary> /// F4点击事件。按下“F4”时,显示数据字典。 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void KeyUpEventProc(object sender, System.Windows.Forms.KeyEventArgs e) { while (rControl.Count > 0) { rControl.Remove(1); } while (fControl.Count > 0) { fControl.Remove(1); } foreach (BControlFiledSetting obj in CustomSetting) { rControl.Add(obj.TargetControl, null, null, null); fControl.Add(obj.ColumnID, null, null, null); } if (e.KeyCode == Keys.F4) { DataDicCommon.Gf_Master_DD(rControl, fControl, GetQuery(), "", 0, GetFilter(), 1); } else { for (int i = 2; i <= rControl.Count; i++) { ((Control)rControl[i]).Text = ""; } string sSql = GetQuery().ToUpper(); //if (sSql.Contains("WHERE")) // sSql += " AND " + fControl[1] + " ='" + ((Control)rControl[1]).Text + "'"; //if (sSql.Contains("WHERE")) //{ // if (sSql.Contains("ORDER")) // { // int pointBegin = sSql.IndexOf("ORDER"); // int sqlCount = sSql.Length; // string sqlBegin = sSql.Substring(0, pointBegin); // string sqlEnd = sSql.Substring(pointBegin, sqlCount - pointBegin); // string sqlAdd = " AND " + fControl[1] + " ='" + ((Control)rControl[1]).Text + "'"; // sSql = sqlBegin + " " + sqlAdd + " " + sqlEnd; // } // else // { // sSql += " AND " + fControl[1] + " ='" + ((Control)rControl[1]).Text + "'"; // } //} /////20130108 int lengthss = ((Control)rControl[1]).Text.Trim().Length; if (this.MaxLength != 32767) { if (lengthss != this.MaxLength) { return; } } //// /////20130108 if (sSql.Contains("WHERE")) { int pointBegin = sSql.IndexOf("WHERE"); int sqlCount = sSql.Length; string sqlBegin = sSql.Substring(0, pointBegin + 5); string sqlEnd = " AND " + sSql.Substring(pointBegin + 5, sqlCount - pointBegin - 5); string sqlAdd = " " + fControl[1] + " ='" + ((Control)rControl[1]).Text + "'"; sSql = sqlBegin + " " + sqlAdd + " " + sqlEnd; } else { sSql += " where " + fControl[1] + "='" + ((Control)rControl[1]).Text + "'"; } ADODB.Recordset AdoRs = new ADODB.Recordset(); if (GeneralCommon.M_CN1.State == 0) { if (GeneralCommon.GF_DbConnect() == false) { return; } } AdoRs.Open(sSql, GeneralCommon.M_CN1, ADODB.CursorTypeEnum.adOpenDynamic, ADODB.LockTypeEnum.adLockReadOnly, -1); if (AdoRs.RecordCount == 1) { for (int i = 2; i <= rControl.Count; i++) { ((Control)rControl[i]).Text = AdoRs.Fields[i - 1].Value.ToString(); } } AdoRs = null; GeneralCommon.M_CN1.Close(); } }