private void popControl1_onCurrentChanged(popControl Sender, DataRowView CurrRowView) { DataRowView currRow = this.bindingSource1.Current as DataRowView; if (currRow == null) { return; } this.bindPopReturn(Sender, CurrRowView); this.gridView1.HideEditor(); decimal ycbc = 0; decimal lycbc = 0; switch (this.gridView1.FocusedColumn.FieldName) { case "YCBC": case "LYCBC": ycbc = ToolKit.ParseDecimal(currRow["YCBC"]); //一侧边长 lycbc = ToolKit.ParseDecimal(currRow["LYCBC"]); //另一侧边长 if (0 != ycbc && 0 != lycbc) { decimal zc = 2 * (ycbc + lycbc); if (zc > 1800) { currRow["ZJHZC"] = ">1800"; } else { currRow["ZJHZC"] = "<=1800"; } } break; } }
private void popControl1_onCurrentChanged(popControl Sender, DataRowView CurrRowView) { this.bindPopReturn(Sender, CurrRowView); this.gridView1.HideEditor(); DataRowView drCurrent = bindingSource1.Current as DataRowView; //当可以确定唯一 粘接层厚度、材料种类 时 自动显示 this.QDDEBindingSource.Filter = string.Format(" MCPZ = '{0}' and (KLGG is null or KLGG ='{1}' ) and QTCL='{2}' and JC ='{3}' and (FS is null or FS='{4}') and CLZL is not null" , toString(drCurrent["MCCLPZ"]), toString(drCurrent["KLMCGG"]), toString(drCurrent["QTCL"]), toString(drCurrent["YWJC"]), toString(drCurrent["GNTFS"])); if (QDDEBindingSource.Count == 1) { drCurrent.Row["TJCHDCLZL"] = (QDDEBindingSource.Current as DataRowView).Row["CLZL"]; } //当可以确定唯一清单时 修正当前行单位 string strQDWhere = string.Format("QZMLB = '块料面层' and FL like '%,{0},%' and CL like '%,{1},%'", toString(drCurrent["MCCLPZ"]), toString(drCurrent["QTCL"])); this.QDQDBindingSource.Filter = strQDWhere; if (0 < QDQDBindingSource.Count) { DataRowView view = this.QDQDBindingSource[0] as DataRowView; drCurrent["DW"] = view["QDDW"]; } }
private void popControl1_onCurrentChanged(popControl Sender, DataRowView CurrRowView) { if (this.CurrRow == null) { return; } this.bindPopReturn(Sender, CurrRowView); this.gridView1.HideEditor(); string strMC = this.LB; if (this.KeyID == 34 || this.KeyID == 35) { strMC = toString(CurrRow["FL"]); } string strQDWhere = string.Format("ZY='电气' and MC like '%," + strMC + ",%'"); this.DQQDQDbindingSource.Filter = strQDWhere; DataRowView currRow = this.DQQDQDbindingSource.Current as DataRowView; if (currRow != null) { CurrRow["DW"] = currRow["QDDW"]; } this.ZMQJbindingSource.Filter = string.Format("LB='{0}' and FL='{1}' and (GGXH IS NULL OR GGXH='{2}') and (ZJ IS NULL OR ZJ='{3}')" , this.LB, CurrRow["FL"], CurrRow["GGXH"], CurrRow["ZJ"]); currRow = this.ZMQJbindingSource.Current as DataRowView; if (currRow != null) { CurrRow["SYTH"] = currRow["SYTH"]; } }
private void popControl1_onCurrentChanged(popControl Sender, DataRowView CurrRowView) { this.bindPopReturn(Sender, CurrRowView); this.gridView1.HideEditor(); DataRowView drCurrent = bindingSource1.Current as DataRowView; //分类二为 下列四个选择的时候 允许输入洞宽洞高 否则 禁止输入 if (drCurrent["FL2"] != null && ( "钢门".Equals(toString(drCurrent["FL2"])) || "钢窗".Equals(toString(drCurrent["FL2"])) || "木门".Equals(toString(drCurrent["FL2"])) || "木窗".Equals(toString(drCurrent["FL2"])) )) { this.gridView1.Columns["DK"].OptionsColumn.AllowEdit = true; this.gridView1.Columns["DG"].OptionsColumn.AllowEdit = true; } else { this.gridView1.Columns["DK"].OptionsColumn.AllowEdit = false; this.gridView1.Columns["DG"].OptionsColumn.AllowEdit = false; } //当可以确定唯一清单时 修正当前行单位 string strQDWhere = string.Format("FL1 = '{0}'and FL2 like '%,{1},%' and (MC is null or MC like '%,{2},%')" , toString(drCurrent["FL1"]), toString(drCurrent["FL2"]), toString(drCurrent["MC"])); this.QDQDBindingSource.Filter = strQDWhere; if (0 < QDQDBindingSource.Count) { DataRowView view = this.QDQDBindingSource[0] as DataRowView; drCurrent["DW"] = view["QDDW"]; } }
private void popControl1_onCurrentChanged(popControl Sender, DataRowView CurrRowView) { this.bindPopReturn(Sender, CurrRowView); this.gridView1.HideEditor(); DataRowView drCurrent = this.bindingSource1.Current as DataRowView; if (!toString(drCurrent["CZ"]).Equals("焊接钢管") && !toString(drCurrent["CZ"]).Equals("无缝钢管") ) { drCurrent["CX"] = ""; drCurrent["BWQFFSYYQ"] = ""; drCurrent["BWHFFSYYQ"] = ""; this.gridView1.Columns["CX"].OptionsColumn.AllowEdit = false; this.gridView1.Columns["BWQFFSYYQ"].OptionsColumn.AllowEdit = false; this.gridView1.Columns["BWHFFSYYQ"].OptionsColumn.AllowEdit = false; } else { this.gridView1.Columns["CX"].OptionsColumn.AllowEdit = true; this.gridView1.Columns["BWQFFSYYQ"].OptionsColumn.AllowEdit = true; this.gridView1.Columns["BWHFFSYYQ"].OptionsColumn.AllowEdit = true; } //当可以确定唯一清单时 修正当前行单位 string strQDWhere = string.Format("CZ like '%,{0},%'", toString(drCurrent["CZ"])); this.GPSQDQDBindingSource.Filter = strQDWhere; if (0 < GPSQDQDBindingSource.Count) { DataRowView view = this.GPSQDQDBindingSource[0] as DataRowView; drCurrent["DW"] = view["QDDW"]; } }
private void popControl1_onCurrentChanged(popControl Sender, DataRowView CurrRowView) { if (this.CurrRow == null) return; this.bindPopReturn(Sender, CurrRowView); this.gridView1.HideEditor(); this.DQQDQDbindingSource.Filter = string.Format("ZY='电气' and MC like '%,接线盒,%'"); DataRowView currRow = this.DQQDQDbindingSource.Current as DataRowView; if (currRow != null) CurrRow["DW"] = currRow["QDDW"]; }
private void popControl1_onCurrentChanged(popControl Sender, DataRowView CurrRowView) { this.bindPopReturn(Sender, CurrRowView); this.gridView1.HideEditor(); //当可以确定唯一清单时 修正当前行单位 DataRowView drCurrent = bindingSource1.Current as DataRowView; this.QDQDBindingSource.Filter = string.Format("GCFL = '{0}' and (GCCL is null or GCCL like '%,{1},%')", toString(drCurrent["FL"]), toString(drCurrent["CLMCZL"])); if (0 < QDQDBindingSource.Count) { DataRowView view = this.QDQDBindingSource[0] as DataRowView; drCurrent["DW"] = view["QDDW"]; } }
private void popControl1_onCurrentChanged(popControl Sender, DataRowView CurrRowView) { this.bindPopReturn(Sender, CurrRowView); this.gridView1.HideEditor(); DataRowView currRow = this.bindingSource1.Current as DataRowView; this.QDDEBindingSource.Filter = string.Format("SJLX = '{0}' and ( JC is null or JC = '{1}') and SJ is not null" , toString(currRow["SJLX"]), toString(currRow["JC"])); //当可以确定唯一配合比、砂浆种类时 自动显示 if (QDDEBindingSource.Count == 1) { currRow.Row["PHBSJZL"] = (QDDEBindingSource.Current as DataRowView).Row["SJ"]; } }
private void popControl1_onCurrentChanged(popControl Sender, DataRowView CurrRowView) { this.bindPopReturn(Sender, CurrRowView); this.gridView1.HideEditor(); //当可以确定唯一清单时 修正当前行单位 DataRowView drCurrent = bindingSource1.Current as DataRowView; string strQDWhere = string.Format("FL like '%,{0},%'", toString(drCurrent["MC"])); QTJZFLBindingSource.Filter = strQDWhere; if (0 < QTJZFLBindingSource.Count) { DataRowView view = this.QTJZFLBindingSource[0] as DataRowView; drCurrent["DW"] = view["QDDW"]; } }
private void popControl1_onCurrentChanged(popControl Sender, DataRowView CurrRowView) { this.bindPopReturn(Sender, CurrRowView); this.gridView1.HideEditor(); //当可以确定唯一清单时 修正当前行单位 DataRowView drCurrent = bindingSource1.Current as DataRowView; this.QDQDindingSource.Filter = string.Format("LXFL = '{0}'", drCurrent["FL"]); if (0 < QDQDindingSource.Count) { DataRowView view = this.QDQDindingSource[0] as DataRowView; drCurrent["DW"] = view["QDDW"]; } }
private void popControl1_onCurrentChanged(popControl Sender, DataRowView CurrRowView) { this.bindPopReturn(Sender, CurrRowView); this.gridView1.HideEditor(); //当可以确定唯一清单时 修正当前行单位 DataRowView drCurrent = bindingSource1.Current as DataRowView; this.MCQDQDbindingSource.Filter = string.Format("MCLB = '电动门' and (MCFL is null or MCFL like '%,{0},%')", toString(drCurrent["DDMFL"])); if (0 < MCQDQDbindingSource.Count) { DataRowView view = this.MCQDQDbindingSource[0] as DataRowView; drCurrent["DW"] = view["QDDW"]; } }
private void popControl1_onCurrentChanged(popControl Sender, DataRowView CurrRowView) { this.bindPopReturn(Sender, CurrRowView); this.gridView1.HideEditor(); DataRowView drCurrent = this.bindingSource1.Current as DataRowView; //当可以确定唯一清单时 修正当前行单位 string strQDWhere = string.Format("MC like '%{0}%'", drCurrent["TJFMC"]); this.AZQDQDBindingSource.Filter = strQDWhere; if (0 < AZQDQDBindingSource.Count) { DataRowView view = this.AZQDQDBindingSource[0] as DataRowView; drCurrent["DW"] = view["QDDW"]; } }
private void popControl1_onCurrentChanged(popControl Sender, DataRowView CurrRowView) { this.bindPopReturn(Sender, CurrRowView); this.gridView1.HideEditor(); checkArr(); //当可以确定唯一清单时 修正当前行单位 DataRowView drCurrent = bindingSource1.Current as DataRowView; this.QDQDBindingSource.Filter = "WMMC ='瓦屋面'"; if (0 < QDQDBindingSource.Count) { DataRowView view = this.QDQDBindingSource[0] as DataRowView; drCurrent["DW"] = view["QDDW"]; } }
private void popControl1_onCurrentChanged(popControl Sender, DataRowView CurrRowView) { this.bindPopReturn(Sender, CurrRowView); this.gridView1.HideEditor(); DataRowView drCurrent = this.bindingSource1.Current as DataRowView; string strQDWhere = string.Format("QTLXMC like '%,{0},%' and (ZMC is null or ZMC like '%,{1},%')", drCurrent["QTLX"], drCurrent["ZPZ"]); this.SJQDQDbindingSource.Filter = strQDWhere; if (0 < this.SJQDQDbindingSource.Count) { DataRowView view = this.SJQDQDbindingSource[0] as DataRowView; drCurrent["DW"] = view["QDDW"]; } }
private void popControl1_onCurrentChanged(popControl Sender, DataRowView CurrRowView) { this.bindPopReturn(Sender, CurrRowView); this.gridView1.HideEditor(); DataRowView drCurrent = this.bindingSource1.Current as DataRowView; //当可以确定唯一清单时 修正当前行单位 StringBuilder strString = new StringBuilder(" ZY='电气'"); strString.Append(string.IsNullOrEmpty(toString(drCurrent["FL"])) ? " and MC is null" : string.Format(" and MC like '%,{0},%'", drCurrent["FL"])); this.AZQDQDBindingSource.Filter = strString.ToString(); if (0 < AZQDQDBindingSource.Count) { DataRowView view = this.AZQDQDBindingSource[0] as DataRowView; drCurrent["DW"] = view["QDDW"]; } }
private void popControl1_onCurrentChanged(popControl Sender, DataRowView CurrRowView) { this.bindPopReturn(Sender, CurrRowView); this.gridView1.HideEditor(); DataRowView currRow = this.bindingSource1.Current as DataRowView; if (currRow == null) { return; } switch (this.gridView1.FocusedColumn.FieldName) { case "MHFL": ///单位修改 this.QZMQDQDbindingSource.Filter = " QZMLB = '抹灰' and FL like '%," + currRow["MHFL"] + ",%'"; if (QZMQDQDbindingSource.Count == 1) { currRow["DW"] = (this.QZMQDQDbindingSource.Current as DataRowView)["QDDW"]; } break; case "QTLX": case "SJZL": ///抹灰厚度 默认值 this.MHQDDEbindingSource.Filter = "MHFL='" + currRow["MHFL"] + "' and SJZL='" + currRow["SJZL"] + "' and (QTLX is null or QTLX='" + currRow["QTLX"] + "') and HD is not null"; foreach (DataRowView item in this.MHQDDEbindingSource) { currRow["SJHD"] = item["HD"]; } ///自动填充 砂浆配合比 this.MHQDDEbindingSource.Filter = "MHFL='" + currRow["MHFL"] + "' and SJZL='" + currRow["SJZL"] + "' and (QTLX is null or QTLX='" + currRow["QTLX"] + "')"; if (MHQDDEbindingSource.Count == 1) { currRow["SJPHB"] = (this.MHQDDEbindingSource.Current as DataRowView)["SJPHB"]; } if (toString(currRow["SJZL"]) == "09j新标准") { this.gridView1.Columns.ColumnByFieldName("SJHD").OptionsColumn.AllowEdit = false; } else { this.gridView1.Columns.ColumnByFieldName("SJHD").OptionsColumn.AllowEdit = true; } break; } }
private void popControl1_onCurrentChanged(popControl Sender, DataRowView CurrRowView) { this.bindPopReturn(Sender, CurrRowView); this.gridView1.HideEditor(); //当可以确定唯一清单时 修正当前行单位 DataRowView drCurrent = bindingSource1.Current as DataRowView; string strQDWhere = string.Format("FL = '{0}' and (CZ is null or CZ = '{1}') and (GGXH is null or GGXH='{2}')" , toString(drCurrent["FL"]), toString(drCurrent["CZ"]), toString(drCurrent["GGXH"])); this.LGLBFSBindingSource.Filter = strQDWhere; if (0 < LGLBFSBindingSource.Count) { DataRowView view = this.LGLBFSBindingSource[0] as DataRowView; drCurrent["DW"] = view["QDDW"]; } }
private void popControl1_onCurrentChanged(popControl Sender, DataRowView CurrRowView) { this.bindPopReturn(Sender, CurrRowView); this.gridView1.HideEditor(); DataRowView currRow = this.bindingSource1.Current as DataRowView; if (currRow == null) { return; } if (this.gridView1.FocusedColumn.FieldName == "MCCLZL") { DataTable dtTemp = ReturnDtJCCL(currRow); if (dtTemp.Rows.Count == 1) { currRow["JCCL"] = dtTemp.Rows[0]["JCCL"]; } } }
private void popControl1_onCurrentChanged(popControl Sender, DataRowView CurrRowView) { DataRowView drCurrent = this.bindingSource1.Current as DataRowView; if (drCurrent == null) { return; } this.bindPopReturn(Sender, CurrRowView); this.gridView1.HideEditor(); if (this.gridView1.FocusedColumn.FieldName == "FSBW") { string strQDWhere = string.Format(" FSBW like'%,{0},%' and FSCLFL = '{1}'", drCurrent["FSBW"], drCurrent["FSCLFL"]); this.FSQDQDbindingSource.Filter = strQDWhere; foreach (DataRowView item in FSQDQDbindingSource) { drCurrent["DW"] = item["QDDW"]; } } }
/// <summary> /// 绑定下拉框 返回的值 /// </summary> /// <param name="Sender"></param> /// <param name="CurrRowView"></param> protected void bindPopReturn(popControl Sender, DataRowView CurrRowView) { DataRowView currRow = this.bindingSource1.Current as DataRowView; if (null == currRow) { return; } ///绑定返回值 if (null != Sender.ColName) { foreach (string item in Sender.ColName) { string[] strField = item.Split('|'); if (strField.Length == 3) { try { if (currRow[strField[2].Trim()] == CurrRowView[strField[1].Trim()]) { continue; } currRow[strField[2].Trim()] = CurrRowView[strField[1].Trim()]; /// 清空关联项 if (null != Sender.RemoveDefaultColName) { foreach (string itemClear in Sender.RemoveDefaultColName) { currRow[itemClear.Trim()] = DBNull.Value; } } } catch (Exception ex) { //DebugErr(ex.Message); } } } } this.bindingSource1.ResetBindings(false); }
private void popControl1_onCurrentChanged(popControl Sender, DataRowView CurrRowView) { DataRowView CurrRow = this.bindingSource1.Current as DataRowView; if (CurrRow == null) { return; } this.bindPopReturn(Sender, CurrRowView); this.gridView1.HideEditor(); if (this.gridView1.FocusedColumn.FieldName == "LB") { string strQDWhere = " JGFL='结构其他构件' and JGLBMC like '%," + CurrRow["LB"] + ",%'"; this.QDbindingSource.Filter = strQDWhere; foreach (DataRowView item in QDbindingSource) { CurrRow["DW"] = item["DW"]; } } }
private void popControl1_onCurrentChanged(popControl Sender, DataRowView CurrRowView) { DataRowView currRow = this.bindingSource1.Current as DataRowView; if (currRow == null) { return; } this.bindPopReturn(Sender, CurrRowView); this.gridView1.HideEditor(); //if (this.gridView1.FocusedColumn.FieldName == "JTXS") //{ // if (toString(currRow["JTXS"]) == "内植钢筋") // { // currRow["DW"] = "根"; // } // else // { // currRow["DW"] = "T"; // } //} }
private void popControl1_onCurrentChanged(popControl Sender, DataRowView CurrRowView) { this.bindPopReturn(Sender, CurrRowView); this.gridView1.HideEditor(); }