/// <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); } }
/// <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); //} }
/////////1023 public static void Gf_CommonCode_DD_SP(Control oSpread, int code_col, int name_col, string cd_mana_no, string sFilter, string sAuthority, Collection Sc) { Collection rControl = new Collection(); rControl.Add(code_col, null, null, null); Collection fControl = new Collection(); fControl.Add("CD", null, null, null); if (name_col > -1) { rControl.Add(name_col, null, null, null); fControl.Add("CD_NAME", null, null, null); } string sJoin = " CD_MANA_NO = \'" + cd_mana_no + "\' "; if ((sFilter != null) && sFilter.Trim().Length > 0) { sJoin += (string)(" AND " + sFilter); } DataDicCommon.Gf_Spread_DD(oSpread, rControl, fControl, DataDicCommon.Gf_CommonCodeSQL(), "", 0, sJoin, code_col, sAuthority, Sc); }
//'更改CD_Name的Text属性__Zhouchao //'20090428修改 private void ChangeCDNameText() { CD_NAME.Text = DataDicCommon.Gf_CommNameFind(GeneralCommon.M_CN1, this.sKey, (string)(CD.Text.Trim().ToUpper()), "2"); //if (CD.Text.Trim().Length == this.sMax) //{ // CD_NAME.Text = DataDicCommon.Gf_CommNameFind(GeneralCommon.M_CN1, this.sKey, (string) (CD.Text.Trim().ToUpper()), "2"); //} //else //{ // CD_NAME.Text = ""; //} }
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(); } }
//1023 public static void Gf_EtcCommon_DD_SP(Control oSpread, int code_col, int name_col, string code_field, string name_field, string sQuery, string sFilter) { Collection rControl = new Collection(); rControl.Add(code_col, null, null, null); if (name_col > -1) { rControl.Add(name_col, null, null, null); } Collection fControl = new Collection(); fControl.Add(code_field, null, null, null); fControl.Add(name_field, null, null, null); DataDicCommon.Gf_Spread_DD(oSpread, rControl, fControl, sQuery, "", 0, sFilter, 1); }
public virtual void CD_KeyUp(object sender, System.Windows.Forms.KeyEventArgs e) { BeforeSubEditorInvok(sender, e); if (Checked) { if (e.KeyCode == Keys.F4) { GeneralCommon.DD.sWitch = "MS"; GeneralCommon.DD.sKey = this.sKey; GeneralCommon.DD.nameType = "2"; GeneralCommon.rControl.Add(CD); GeneralCommon.rControl.Add(CD_NAME); GeneralCommon.DD.sJoin = sJoin.Trim(); GeneralCommon.DD.sCusCode = sCusCode.Trim(); GeneralCommon.DD.sPrcoCode = sPrcoCode.Trim(); GeneralCommon.DD.sParameters = sParameters; DataDicCommon.Gf_Common_DD(GeneralCommon.OleDbConn, e.KeyCode); } else { if (CD.Text.Trim().Length == Convert.ToInt32(this.sMax)) { CD_NAME.Text = DataDicCommon.Gf_CommNameFind(GeneralCommon.OleDbConn, this.sKey, CD.Text.Trim().ToUpper(), "2"); } else { CD_NAME.Text = ""; } } if (GeneralCommon.OleDbConn.State != 0) { GeneralCommon.OleDbConn.Close(); } } }
/// <summary> /// 调用Gf_CommonCodeSQL() 方法,利用BBB_CD表结构得到不带where条件的sql语句。 /// </summary> /// <returns></returns> private string GetQuery() { return(DataDicCommon.Gf_CommonCodeSQL()); }
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(); } }
//1023 public static void Gf_EtcCommon_DD_SP(Control oSpread, Collection rc, Collection fc, string sQuery, string sFilter, string sAuthority, Collection Sc) { string col = rc[1].ToString(); DataDicCommon.Gf_Spread_DD(oSpread, rc, fc, sQuery, "", 0, sFilter, int.Parse(col), sAuthority, Sc); }