private void Insert_功率效率点ToDB() { string strSql = "Delete from dbo.电机型号功率效率点 where id=" + ID号; _form.ExcuteSql(strSql); foreach (功率效率点 _功率效率点 in 功率效率点集合) { strSql = "Insert into dbo.电机型号功率效率点 (id,输出功率P2,效率η) values (" + ID号 + "," + _功率效率点.输出功率P2 + "," + _功率效率点.效率η + ")"; _form.ExcuteSql(strSql); } }
private bool insert水泵环境参数配置(int ID) { string strSql = "insert into dbo.水泵环境参数 (ID,出厂编号,流量通道,流量最大量程,进口压力通道,进口压力量程," + "出口压力通道,出口压力量程,变比,偏移量,常量) values (" + ID + ","; strSql += "'"; strSql += m_str出厂编号; strSql += "','"; strSql += c流量.SelectedItem; strSql += "',"; strSql += Convert.ToSingle(c流量最大量程.Text); strSql += ",'"; strSql += c进口压力.SelectedItem; strSql += "',"; strSql += System.Convert.ToSingle(t进口压力.Text); strSql += ",'"; strSql += c出口压力.SelectedItem; strSql += "',"; strSql += System.Convert.ToSingle(t出口压力.Text); strSql += ","; strSql += System.Convert.ToSingle(a.Text); strSql += ","; strSql += System.Convert.ToSingle(b.Text); strSql += ","; strSql += System.Convert.ToSingle(c.Text); strSql += ")"; try { if (_form == null) { _form = new FormElement(); } _form.ExcuteSql(strSql); } catch (System.Exception ex) { return(false); } return(true); }