private void ShowInfo(string Exp_No) { Maticsoft.BLL.ps_pumpstation bll = new Maticsoft.BLL.ps_pumpstation(); Maticsoft.Model.ps_pumpstation model = bll.GetModel(Exp_No); this.lblPrj_No.Text = model.Prj_No; this.lblPrj_Name.Text = model.Prj_Name; this.lblExp_No.Text = model.Exp_No; this.lblMapCode.Text = model.MapCode; this.lblName.Text = model.Name; this.lblArea.Text = model.Area.ToString(); this.lblService_Dis.Text = model.Service_Dis; this.lblService_Area.Text = model.Service_Area.ToString(); this.lblSewageSystem_ID.Text = model.SewageSystem_ID; this.lblStormSystem_ID.Text = model.StormSystem_ID; this.lblType.Text = model.Type; this.lblX.Text = model.X.ToString(); this.lblY.Text = model.Y.ToString(); this.lblHigh.Text = model.High.ToString(); this.lblPS_Category2.Text = model.PS_Category2; this.lblPs_Num.Text = model.Ps_Num; this.lblDesign_Storm.Text = model.Design_Storm.ToString(); this.lblDesign_Sewer.Text = model.Design_Sewer.ToString(); this.lblCur_Strom.Text = model.Cur_Strom.ToString(); this.lblCur_Sew.Text = model.Cur_Sew.ToString(); this.lblMin_Level.Text = model.Min_Level.ToString(); this.lblControl_Level.Text = model.Control_Level.ToString(); this.lblWarnning_Level.Text = model.Warnning_Level.ToString(); this.lblS_Invert.Text = model.S_Invert.ToString(); this.lblPSize.Text = model.PSize; this.lblOverOutfallID.Text = model.OverOutfallID; this.lblTel.Text = model.Tel; this.lblForebayLen.Text = model.ForebayLen.ToString(); this.lblForebayWid.Text = model.ForebayWid.ToString(); this.lblForebayDep.Text = model.ForebayDep.ToString(); this.lblCode.Text = model.Code; this.lblAddress.Text = model.Address; this.lblDataSource.Text = model.DataSource; this.lblSunit.Text = model.Sunit; this.lblSdate.Text = model.Sdate; this.lblUpdateTime.Text = model.UpdateTime; this.lblMdate.Text = model.Mdate; this.lblDataListID.Text = model.DataListID; this.lblStatus.Text = model.Status; this.lblEname.Text = model.Ename; this.lblDesign_Dept.Text = model.Design_Dept; this.lblConster_Dept.Text = model.Conster_Dept; this.lblBelong.Text = model.Belong; this.lblOperator.Text = model.Operator; this.lblNote.Text = model.Note; this.lblExp_NoOri.Text = model.Exp_NoOri; this.lblfilename.Text = model.filename; this.lblupdate.Text = model.update; }
/// <summary> /// 得到一个对象实体 /// </summary> public Maticsoft.Model.ps_pumpstation GetModel(string Exp_No) { StringBuilder strSql = new StringBuilder(); strSql.Append("select Prj_No,Prj_Name,Exp_No,MapCode,Name,Area,Service_Dis,Service_Area,SewageSystem_ID,StormSystem_ID,Type,X,Y,High,PS_Category2,Ps_Num,Design_Storm,Design_Sewer,Cur_Strom,Cur_Sew,Min_Level,Control_Level,Warnning_Level,S_Invert,PSize,OverOutfallID,Tel,ForebayLen,ForebayWid,ForebayDep,Code,Address,DataSource,Sunit,Sdate,UpdateTime,Mdate,DataListID,Status,Ename,Design_Dept,Conster_Dept,Belong,Operator,Note,Exp_NoOri,FileName,Uploadtime from ps_pumpstation "); strSql.Append(" where Exp_No=@Exp_No "); MySqlParameter[] parameters = { new MySqlParameter("@Exp_No", MySqlDbType.VarChar, 100) }; parameters[0].Value = Exp_No; Maticsoft.Model.ps_pumpstation model = new Maticsoft.Model.ps_pumpstation(); DataSet ds = DbHelperMySQL.Query(strSql.ToString(), parameters); if (ds.Tables[0].Rows.Count > 0) { return(DataRowToModel(ds.Tables[0].Rows[0])); } else { return(null); } }
protected void btnSave_Click(object sender, EventArgs e) { string strErr = ""; if (this.txtPrj_No.Text.Trim().Length == 0) { strErr += "Prj_No不能为空!\\n"; } if (this.txtPrj_Name.Text.Trim().Length == 0) { strErr += "Prj_Name不能为空!\\n"; } if (this.txtExp_No.Text.Trim().Length == 0) { strErr += "Exp_No不能为空!\\n"; } if (this.txtMapCode.Text.Trim().Length == 0) { strErr += "MapCode不能为空!\\n"; } if (this.txtName.Text.Trim().Length == 0) { strErr += "Name不能为空!\\n"; } if (!PageValidate.IsDecimal(txtArea.Text)) { strErr += "Area格式错误!\\n"; } if (this.txtService_Dis.Text.Trim().Length == 0) { strErr += "Service_Dis不能为空!\\n"; } if (!PageValidate.IsDecimal(txtService_Area.Text)) { strErr += "Service_Area格式错误!\\n"; } if (this.txtSewageSystem_ID.Text.Trim().Length == 0) { strErr += "SewageSystem_ID不能为空!\\n"; } if (this.txtStormSystem_ID.Text.Trim().Length == 0) { strErr += "StormSystem_ID不能为空!\\n"; } if (this.txtType.Text.Trim().Length == 0) { strErr += "Type不能为空!\\n"; } if (!PageValidate.IsDecimal(txtX.Text)) { strErr += "X格式错误!\\n"; } if (!PageValidate.IsDecimal(txtY.Text)) { strErr += "Y格式错误!\\n"; } if (!PageValidate.IsDecimal(txtHigh.Text)) { strErr += "High格式错误!\\n"; } if (this.txtPS_Category2.Text.Trim().Length == 0) { strErr += "PS_Category2不能为空!\\n"; } if (this.txtPs_Num.Text.Trim().Length == 0) { strErr += "Ps_Num不能为空!\\n"; } if (!PageValidate.IsDecimal(txtDesign_Storm.Text)) { strErr += "Design_Storm格式错误!\\n"; } if (!PageValidate.IsDecimal(txtDesign_Sewer.Text)) { strErr += "Design_Sewer格式错误!\\n"; } if (!PageValidate.IsDecimal(txtCur_Strom.Text)) { strErr += "Cur_Strom格式错误!\\n"; } if (!PageValidate.IsDecimal(txtCur_Sew.Text)) { strErr += "Cur_Sew格式错误!\\n"; } if (!PageValidate.IsDecimal(txtMin_Level.Text)) { strErr += "Min_Level格式错误!\\n"; } if (!PageValidate.IsDecimal(txtControl_Level.Text)) { strErr += "Control_Level格式错误!\\n"; } if (!PageValidate.IsDecimal(txtWarnning_Level.Text)) { strErr += "Warnning_Level格式错误!\\n"; } if (!PageValidate.IsDecimal(txtS_Invert.Text)) { strErr += "S_Invert格式错误!\\n"; } if (this.txtPSize.Text.Trim().Length == 0) { strErr += "PSize不能为空!\\n"; } if (this.txtOverOutfallID.Text.Trim().Length == 0) { strErr += "OverOutfallID不能为空!\\n"; } if (this.txtTel.Text.Trim().Length == 0) { strErr += "Tel不能为空!\\n"; } if (!PageValidate.IsDecimal(txtForebayLen.Text)) { strErr += "ForebayLen格式错误!\\n"; } if (!PageValidate.IsDecimal(txtForebayWid.Text)) { strErr += "ForebayWid格式错误!\\n"; } if (!PageValidate.IsDecimal(txtForebayDep.Text)) { strErr += "ForebayDep格式错误!\\n"; } if (this.txtCode.Text.Trim().Length == 0) { strErr += "Code不能为空!\\n"; } if (this.txtAddress.Text.Trim().Length == 0) { strErr += "Address不能为空!\\n"; } if (this.txtDataSource.Text.Trim().Length == 0) { strErr += "DataSource不能为空!\\n"; } if (this.txtSunit.Text.Trim().Length == 0) { strErr += "Sunit不能为空!\\n"; } if (this.txtSdate.Text.Trim().Length == 0) { strErr += "Sdate不能为空!\\n"; } if (this.txtUpdateTime.Text.Trim().Length == 0) { strErr += "UpdateTime不能为空!\\n"; } if (this.txtMdate.Text.Trim().Length == 0) { strErr += "Mdate不能为空!\\n"; } if (this.txtDataListID.Text.Trim().Length == 0) { strErr += "DataListID不能为空!\\n"; } if (this.txtStatus.Text.Trim().Length == 0) { strErr += "Status不能为空!\\n"; } if (this.txtEname.Text.Trim().Length == 0) { strErr += "Ename不能为空!\\n"; } if (this.txtDesign_Dept.Text.Trim().Length == 0) { strErr += "Design_Dept不能为空!\\n"; } if (this.txtConster_Dept.Text.Trim().Length == 0) { strErr += "Conster_Dept不能为空!\\n"; } if (this.txtBelong.Text.Trim().Length == 0) { strErr += "Belong不能为空!\\n"; } if (this.txtOperator.Text.Trim().Length == 0) { strErr += "Operator不能为空!\\n"; } if (this.txtNote.Text.Trim().Length == 0) { strErr += "Note不能为空!\\n"; } if (this.txtExp_NoOri.Text.Trim().Length == 0) { strErr += "Exp_NoOri不能为空!\\n"; } if (this.txtfilename.Text.Trim().Length == 0) { strErr += "filename不能为空!\\n"; } if (this.txtupdate.Text.Trim().Length == 0) { strErr += "update不能为空!\\n"; } if (strErr != "") { MessageBox.Show(this, strErr); return; } string Prj_No = this.txtPrj_No.Text; string Prj_Name = this.txtPrj_Name.Text; string Exp_No = this.txtExp_No.Text; string MapCode = this.txtMapCode.Text; string Name = this.txtName.Text; decimal Area = decimal.Parse(this.txtArea.Text); string Service_Dis = this.txtService_Dis.Text; decimal Service_Area = decimal.Parse(this.txtService_Area.Text); string SewageSystem_ID = this.txtSewageSystem_ID.Text; string StormSystem_ID = this.txtStormSystem_ID.Text; string Type = this.txtType.Text; decimal X = decimal.Parse(this.txtX.Text); decimal Y = decimal.Parse(this.txtY.Text); decimal High = decimal.Parse(this.txtHigh.Text); string PS_Category2 = this.txtPS_Category2.Text; string Ps_Num = this.txtPs_Num.Text; decimal Design_Storm = decimal.Parse(this.txtDesign_Storm.Text); decimal Design_Sewer = decimal.Parse(this.txtDesign_Sewer.Text); decimal Cur_Strom = decimal.Parse(this.txtCur_Strom.Text); decimal Cur_Sew = decimal.Parse(this.txtCur_Sew.Text); decimal Min_Level = decimal.Parse(this.txtMin_Level.Text); decimal Control_Level = decimal.Parse(this.txtControl_Level.Text); decimal Warnning_Level = decimal.Parse(this.txtWarnning_Level.Text); decimal S_Invert = decimal.Parse(this.txtS_Invert.Text); string PSize = this.txtPSize.Text; string OverOutfallID = this.txtOverOutfallID.Text; string Tel = this.txtTel.Text; decimal ForebayLen = decimal.Parse(this.txtForebayLen.Text); decimal ForebayWid = decimal.Parse(this.txtForebayWid.Text); decimal ForebayDep = decimal.Parse(this.txtForebayDep.Text); string Code = this.txtCode.Text; string Address = this.txtAddress.Text; string DataSource = this.txtDataSource.Text; string Sunit = this.txtSunit.Text; string Sdate = this.txtSdate.Text; string UpdateTime = this.txtUpdateTime.Text; string Mdate = this.txtMdate.Text; string DataListID = this.txtDataListID.Text; string Status = this.txtStatus.Text; string Ename = this.txtEname.Text; string Design_Dept = this.txtDesign_Dept.Text; string Conster_Dept = this.txtConster_Dept.Text; string Belong = this.txtBelong.Text; string Operator = this.txtOperator.Text; string Note = this.txtNote.Text; string Exp_NoOri = this.txtExp_NoOri.Text; string filename = this.txtfilename.Text; string update = this.txtupdate.Text; Maticsoft.Model.ps_pumpstation model = new Maticsoft.Model.ps_pumpstation(); model.Prj_No = Prj_No; model.Prj_Name = Prj_Name; model.Exp_No = Exp_No; model.MapCode = MapCode; model.Name = Name; model.Area = Area; model.Service_Dis = Service_Dis; model.Service_Area = Service_Area; model.SewageSystem_ID = SewageSystem_ID; model.StormSystem_ID = StormSystem_ID; model.Type = Type; model.X = X; model.Y = Y; model.High = High; model.PS_Category2 = PS_Category2; model.Ps_Num = Ps_Num; model.Design_Storm = Design_Storm; model.Design_Sewer = Design_Sewer; model.Cur_Strom = Cur_Strom; model.Cur_Sew = Cur_Sew; model.Min_Level = Min_Level; model.Control_Level = Control_Level; model.Warnning_Level = Warnning_Level; model.S_Invert = S_Invert; model.PSize = PSize; model.OverOutfallID = OverOutfallID; model.Tel = Tel; model.ForebayLen = ForebayLen; model.ForebayWid = ForebayWid; model.ForebayDep = ForebayDep; model.Code = Code; model.Address = Address; model.DataSource = DataSource; model.Sunit = Sunit; model.Sdate = Sdate; model.UpdateTime = UpdateTime; model.Mdate = Mdate; model.DataListID = DataListID; model.Status = Status; model.Ename = Ename; model.Design_Dept = Design_Dept; model.Conster_Dept = Conster_Dept; model.Belong = Belong; model.Operator = Operator; model.Note = Note; model.Exp_NoOri = Exp_NoOri; model.filename = filename; model.update = update; Maticsoft.BLL.ps_pumpstation bll = new Maticsoft.BLL.ps_pumpstation(); bll.Add(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "add.aspx"); }
/// <summary> /// 得到一个对象实体 /// </summary> public Maticsoft.Model.ps_pumpstation DataRowToModel(DataRow row) { Maticsoft.Model.ps_pumpstation model = new Maticsoft.Model.ps_pumpstation(); if (row != null) { if (row["Prj_No"] != null) { model.Prj_No = row["Prj_No"].ToString(); } if (row["Prj_Name"] != null) { model.Prj_Name = row["Prj_Name"].ToString(); } if (row["Exp_No"] != null) { model.Exp_No = row["Exp_No"].ToString(); } if (row["MapCode"] != null) { model.MapCode = row["MapCode"].ToString(); } if (row["Name"] != null) { model.Name = row["Name"].ToString(); } if (row["Area"] != null && row["Area"].ToString() != "") { model.Area = decimal.Parse(row["Area"].ToString()); } if (row["Service_Dis"] != null) { model.Service_Dis = row["Service_Dis"].ToString(); } if (row["Service_Area"] != null && row["Service_Area"].ToString() != "") { model.Service_Area = decimal.Parse(row["Service_Area"].ToString()); } if (row["SewageSystem_ID"] != null) { model.SewageSystem_ID = row["SewageSystem_ID"].ToString(); } if (row["StormSystem_ID"] != null) { model.StormSystem_ID = row["StormSystem_ID"].ToString(); } if (row["Type"] != null) { model.Type = row["Type"].ToString(); } if (row["X"] != null && row["X"].ToString() != "") { model.X = decimal.Parse(row["X"].ToString()); } if (row["Y"] != null && row["Y"].ToString() != "") { model.Y = decimal.Parse(row["Y"].ToString()); } if (row["High"] != null && row["High"].ToString() != "") { model.High = decimal.Parse(row["High"].ToString()); } if (row["PS_Category2"] != null) { model.PS_Category2 = row["PS_Category2"].ToString(); } if (row["Ps_Num"] != null) { model.Ps_Num = row["Ps_Num"].ToString(); } if (row["Design_Storm"] != null && row["Design_Storm"].ToString() != "") { model.Design_Storm = decimal.Parse(row["Design_Storm"].ToString()); } if (row["Design_Sewer"] != null && row["Design_Sewer"].ToString() != "") { model.Design_Sewer = decimal.Parse(row["Design_Sewer"].ToString()); } if (row["Cur_Strom"] != null && row["Cur_Strom"].ToString() != "") { model.Cur_Strom = decimal.Parse(row["Cur_Strom"].ToString()); } if (row["Cur_Sew"] != null && row["Cur_Sew"].ToString() != "") { model.Cur_Sew = decimal.Parse(row["Cur_Sew"].ToString()); } if (row["Min_Level"] != null && row["Min_Level"].ToString() != "") { model.Min_Level = decimal.Parse(row["Min_Level"].ToString()); } if (row["Control_Level"] != null && row["Control_Level"].ToString() != "") { model.Control_Level = decimal.Parse(row["Control_Level"].ToString()); } if (row["Warnning_Level"] != null && row["Warnning_Level"].ToString() != "") { model.Warnning_Level = decimal.Parse(row["Warnning_Level"].ToString()); } if (row["S_Invert"] != null && row["S_Invert"].ToString() != "") { model.S_Invert = decimal.Parse(row["S_Invert"].ToString()); } if (row["PSize"] != null) { model.PSize = row["PSize"].ToString(); } if (row["OverOutfallID"] != null) { model.OverOutfallID = row["OverOutfallID"].ToString(); } if (row["Tel"] != null) { model.Tel = row["Tel"].ToString(); } if (row["ForebayLen"] != null && row["ForebayLen"].ToString() != "") { model.ForebayLen = decimal.Parse(row["ForebayLen"].ToString()); } if (row["ForebayWid"] != null && row["ForebayWid"].ToString() != "") { model.ForebayWid = decimal.Parse(row["ForebayWid"].ToString()); } if (row["ForebayDep"] != null && row["ForebayDep"].ToString() != "") { model.ForebayDep = decimal.Parse(row["ForebayDep"].ToString()); } if (row["Code"] != null) { model.Code = row["Code"].ToString(); } if (row["Address"] != null) { model.Address = row["Address"].ToString(); } if (row["DataSource"] != null) { model.DataSource = row["DataSource"].ToString(); } if (row["Sunit"] != null) { model.Sunit = row["Sunit"].ToString(); } if (row["Sdate"] != null) { model.Sdate = row["Sdate"].ToString(); } if (row["UpdateTime"] != null) { model.UpdateTime = row["UpdateTime"].ToString(); } if (row["Mdate"] != null) { model.Mdate = row["Mdate"].ToString(); } if (row["DataListID"] != null) { model.DataListID = row["DataListID"].ToString(); } if (row["Status"] != null) { model.Status = row["Status"].ToString(); } if (row["Ename"] != null) { model.Ename = row["Ename"].ToString(); } if (row["Design_Dept"] != null) { model.Design_Dept = row["Design_Dept"].ToString(); } if (row["Conster_Dept"] != null) { model.Conster_Dept = row["Conster_Dept"].ToString(); } if (row["Belong"] != null) { model.Belong = row["Belong"].ToString(); } if (row["Operator"] != null) { model.Operator = row["Operator"].ToString(); } if (row["Note"] != null) { model.Note = row["Note"].ToString(); } if (row["Exp_NoOri"] != null) { model.Exp_NoOri = row["Exp_NoOri"].ToString(); } if (row["FileName"] != null) { model.FileName = row["FileName"].ToString(); } if (row["Uploadtime"] != null) { model.Uploadtime = row["Uploadtime"].ToString(); } } return(model); }
/// <summary> /// 增加一条数据 /// </summary> public bool Add(Maticsoft.Model.ps_pumpstation model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into ps_pumpstation("); strSql.Append("Prj_No,Prj_Name,Exp_No,MapCode,Name,Area,Service_Dis,Service_Area,SewageSystem_ID,StormSystem_ID,Type,X,Y,High,PS_Category2,Ps_Num,Design_Storm,Design_Sewer,Cur_Strom,Cur_Sew,Min_Level,Control_Level,Warnning_Level,S_Invert,PSize,OverOutfallID,Tel,ForebayLen,ForebayWid,ForebayDep,Code,Address,DataSource,Sunit,Sdate,UpdateTime,Mdate,DataListID,Status,Ename,Design_Dept,Conster_Dept,Belong,Operator,Note,Exp_NoOri,FileName,Uploadtime)"); strSql.Append(" values ("); strSql.Append("@Prj_No,@Prj_Name,@Exp_No,@MapCode,@Name,@Area,@Service_Dis,@Service_Area,@SewageSystem_ID,@StormSystem_ID,@Type,@X,@Y,@High,@PS_Category2,@Ps_Num,@Design_Storm,@Design_Sewer,@Cur_Strom,@Cur_Sew,@Min_Level,@Control_Level,@Warnning_Level,@S_Invert,@PSize,@OverOutfallID,@Tel,@ForebayLen,@ForebayWid,@ForebayDep,@Code,@Address,@DataSource,@Sunit,@Sdate,@UpdateTime,@Mdate,@DataListID,@Status,@Ename,@Design_Dept,@Conster_Dept,@Belong,@Operator,@Note,@Exp_NoOri,@FileName,@Uploadtime)"); MySqlParameter[] parameters = { new MySqlParameter("@Prj_No", MySqlDbType.VarChar, 10), new MySqlParameter("@Prj_Name", MySqlDbType.VarChar, 100), new MySqlParameter("@Exp_No", MySqlDbType.VarChar, 100), new MySqlParameter("@MapCode", MySqlDbType.VarChar, 10), new MySqlParameter("@Name", MySqlDbType.VarChar, 100), new MySqlParameter("@Area", MySqlDbType.Decimal, 10), new MySqlParameter("@Service_Dis", MySqlDbType.VarChar, 255), new MySqlParameter("@Service_Area", MySqlDbType.Decimal, 10), new MySqlParameter("@SewageSystem_ID", MySqlDbType.VarChar, 50), new MySqlParameter("@StormSystem_ID", MySqlDbType.VarChar, 50), new MySqlParameter("@Type", MySqlDbType.VarChar, 4), new MySqlParameter("@X", MySqlDbType.Decimal, 10), new MySqlParameter("@Y", MySqlDbType.Decimal, 10), new MySqlParameter("@High", MySqlDbType.Decimal, 10), new MySqlParameter("@PS_Category2", MySqlDbType.VarChar, 4), new MySqlParameter("@Ps_Num", MySqlDbType.VarChar, 4), new MySqlParameter("@Design_Storm", MySqlDbType.Decimal, 10), new MySqlParameter("@Design_Sewer", MySqlDbType.Decimal, 10), new MySqlParameter("@Cur_Strom", MySqlDbType.Decimal, 10), new MySqlParameter("@Cur_Sew", MySqlDbType.Decimal, 10), new MySqlParameter("@Min_Level", MySqlDbType.Decimal, 10), new MySqlParameter("@Control_Level", MySqlDbType.Decimal, 10), new MySqlParameter("@Warnning_Level", MySqlDbType.Decimal, 10), new MySqlParameter("@S_Invert", MySqlDbType.Decimal, 10), new MySqlParameter("@PSize", MySqlDbType.VarChar, 50), new MySqlParameter("@OverOutfallID", MySqlDbType.VarChar, 50), new MySqlParameter("@Tel", MySqlDbType.VarChar, 15), new MySqlParameter("@ForebayLen", MySqlDbType.Decimal, 10), new MySqlParameter("@ForebayWid", MySqlDbType.Decimal, 10), new MySqlParameter("@ForebayDep", MySqlDbType.Decimal, 10), new MySqlParameter("@Code", MySqlDbType.VarChar, 10), new MySqlParameter("@Address", MySqlDbType.VarChar, 100), new MySqlParameter("@DataSource", MySqlDbType.VarChar, 10), new MySqlParameter("@Sunit", MySqlDbType.VarChar, 255), new MySqlParameter("@Sdate", MySqlDbType.VarChar, 255), new MySqlParameter("@UpdateTime", MySqlDbType.VarChar, 255), new MySqlParameter("@Mdate", MySqlDbType.VarChar, 255), new MySqlParameter("@DataListID", MySqlDbType.VarChar, 50), new MySqlParameter("@Status", MySqlDbType.VarChar, 10), new MySqlParameter("@Ename", MySqlDbType.VarChar, 100), new MySqlParameter("@Design_Dept", MySqlDbType.VarChar, 255), new MySqlParameter("@Conster_Dept", MySqlDbType.VarChar, 255), new MySqlParameter("@Belong", MySqlDbType.VarChar, 255), new MySqlParameter("@Operator", MySqlDbType.VarChar, 255), new MySqlParameter("@Note", MySqlDbType.VarChar, 255), new MySqlParameter("@Exp_NoOri", MySqlDbType.VarChar, 255), new MySqlParameter("@FileName", MySqlDbType.VarChar, 255), new MySqlParameter("@Uploadtime", MySqlDbType.VarChar, 255) }; parameters[0].Value = model.Prj_No; parameters[1].Value = model.Prj_Name; parameters[2].Value = model.Exp_No; parameters[3].Value = model.MapCode; parameters[4].Value = model.Name; parameters[5].Value = model.Area; parameters[6].Value = model.Service_Dis; parameters[7].Value = model.Service_Area; parameters[8].Value = model.SewageSystem_ID; parameters[9].Value = model.StormSystem_ID; parameters[10].Value = model.Type; parameters[11].Value = model.X; parameters[12].Value = model.Y; parameters[13].Value = model.High; parameters[14].Value = model.PS_Category2; parameters[15].Value = model.Ps_Num; parameters[16].Value = model.Design_Storm; parameters[17].Value = model.Design_Sewer; parameters[18].Value = model.Cur_Strom; parameters[19].Value = model.Cur_Sew; parameters[20].Value = model.Min_Level; parameters[21].Value = model.Control_Level; parameters[22].Value = model.Warnning_Level; parameters[23].Value = model.S_Invert; parameters[24].Value = model.PSize; parameters[25].Value = model.OverOutfallID; parameters[26].Value = model.Tel; parameters[27].Value = model.ForebayLen; parameters[28].Value = model.ForebayWid; parameters[29].Value = model.ForebayDep; parameters[30].Value = model.Code; parameters[31].Value = model.Address; parameters[32].Value = model.DataSource; parameters[33].Value = model.Sunit; parameters[34].Value = model.Sdate; parameters[35].Value = model.UpdateTime; parameters[36].Value = model.Mdate; parameters[37].Value = model.DataListID; parameters[38].Value = model.Status; parameters[39].Value = model.Ename; parameters[40].Value = model.Design_Dept; parameters[41].Value = model.Conster_Dept; parameters[42].Value = model.Belong; parameters[43].Value = model.Operator; parameters[44].Value = model.Note; parameters[45].Value = model.Exp_NoOri; parameters[46].Value = model.FileName; parameters[47].Value = model.Uploadtime; int rows = DbHelperMySQL.ExecuteSql(strSql.ToString(), parameters); if (rows > 0) { return(true); } else { return(false); } }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(Maticsoft.Model.ps_pumpstation model) { StringBuilder strSql = new StringBuilder(); strSql.Append("update ps_pumpstation set "); strSql.Append("Prj_No=@Prj_No,"); strSql.Append("Prj_Name=@Prj_Name,"); strSql.Append("MapCode=@MapCode,"); strSql.Append("Name=@Name,"); strSql.Append("Area=@Area,"); strSql.Append("Service_Dis=@Service_Dis,"); strSql.Append("Service_Area=@Service_Area,"); strSql.Append("SewageSystem_ID=@SewageSystem_ID,"); strSql.Append("StormSystem_ID=@StormSystem_ID,"); strSql.Append("Type=@Type,"); strSql.Append("X=@X,"); strSql.Append("Y=@Y,"); strSql.Append("High=@High,"); strSql.Append("PS_Category2=@PS_Category2,"); strSql.Append("Ps_Num=@Ps_Num,"); strSql.Append("Design_Storm=@Design_Storm,"); strSql.Append("Design_Sewer=@Design_Sewer,"); strSql.Append("Cur_Strom=@Cur_Strom,"); strSql.Append("Cur_Sew=@Cur_Sew,"); strSql.Append("Min_Level=@Min_Level,"); strSql.Append("Control_Level=@Control_Level,"); strSql.Append("Warnning_Level=@Warnning_Level,"); strSql.Append("S_Invert=@S_Invert,"); strSql.Append("PSize=@PSize,"); strSql.Append("OverOutfallID=@OverOutfallID,"); strSql.Append("Tel=@Tel,"); strSql.Append("ForebayLen=@ForebayLen,"); strSql.Append("ForebayWid=@ForebayWid,"); strSql.Append("ForebayDep=@ForebayDep,"); strSql.Append("Code=@Code,"); strSql.Append("Address=@Address,"); strSql.Append("DataSource=@DataSource,"); strSql.Append("Sunit=@Sunit,"); strSql.Append("Sdate=@Sdate,"); strSql.Append("UpdateTime=@UpdateTime,"); strSql.Append("Mdate=@Mdate,"); strSql.Append("DataListID=@DataListID,"); strSql.Append("Status=@Status,"); strSql.Append("Ename=@Ename,"); strSql.Append("Design_Dept=@Design_Dept,"); strSql.Append("Conster_Dept=@Conster_Dept,"); strSql.Append("Belong=@Belong,"); strSql.Append("Operator=@Operator,"); strSql.Append("Note=@Note,"); strSql.Append("Exp_NoOri=@Exp_NoOri,"); strSql.Append("FileName=@FileName,"); strSql.Append("Uploadtime=@Uploadtime"); strSql.Append(" where Exp_No=@Exp_No "); MySqlParameter[] parameters = { new MySqlParameter("@Prj_No", MySqlDbType.VarChar, 10), new MySqlParameter("@Prj_Name", MySqlDbType.VarChar, 100), new MySqlParameter("@MapCode", MySqlDbType.VarChar, 10), new MySqlParameter("@Name", MySqlDbType.VarChar, 100), new MySqlParameter("@Area", MySqlDbType.Decimal, 10), new MySqlParameter("@Service_Dis", MySqlDbType.VarChar, 255), new MySqlParameter("@Service_Area", MySqlDbType.Decimal, 10), new MySqlParameter("@SewageSystem_ID", MySqlDbType.VarChar, 50), new MySqlParameter("@StormSystem_ID", MySqlDbType.VarChar, 50), new MySqlParameter("@Type", MySqlDbType.VarChar, 4), new MySqlParameter("@X", MySqlDbType.Decimal, 10), new MySqlParameter("@Y", MySqlDbType.Decimal, 10), new MySqlParameter("@High", MySqlDbType.Decimal, 10), new MySqlParameter("@PS_Category2", MySqlDbType.VarChar, 4), new MySqlParameter("@Ps_Num", MySqlDbType.VarChar, 4), new MySqlParameter("@Design_Storm", MySqlDbType.Decimal, 10), new MySqlParameter("@Design_Sewer", MySqlDbType.Decimal, 10), new MySqlParameter("@Cur_Strom", MySqlDbType.Decimal, 10), new MySqlParameter("@Cur_Sew", MySqlDbType.Decimal, 10), new MySqlParameter("@Min_Level", MySqlDbType.Decimal, 10), new MySqlParameter("@Control_Level", MySqlDbType.Decimal, 10), new MySqlParameter("@Warnning_Level", MySqlDbType.Decimal, 10), new MySqlParameter("@S_Invert", MySqlDbType.Decimal, 10), new MySqlParameter("@PSize", MySqlDbType.VarChar, 50), new MySqlParameter("@OverOutfallID", MySqlDbType.VarChar, 50), new MySqlParameter("@Tel", MySqlDbType.VarChar, 15), new MySqlParameter("@ForebayLen", MySqlDbType.Decimal, 10), new MySqlParameter("@ForebayWid", MySqlDbType.Decimal, 10), new MySqlParameter("@ForebayDep", MySqlDbType.Decimal, 10), new MySqlParameter("@Code", MySqlDbType.VarChar, 10), new MySqlParameter("@Address", MySqlDbType.VarChar, 100), new MySqlParameter("@DataSource", MySqlDbType.VarChar, 10), new MySqlParameter("@Sunit", MySqlDbType.VarChar, 255), new MySqlParameter("@Sdate", MySqlDbType.VarChar, 255), new MySqlParameter("@UpdateTime", MySqlDbType.VarChar, 255), new MySqlParameter("@Mdate", MySqlDbType.VarChar, 255), new MySqlParameter("@DataListID", MySqlDbType.VarChar, 50), new MySqlParameter("@Status", MySqlDbType.VarChar, 10), new MySqlParameter("@Ename", MySqlDbType.VarChar, 100), new MySqlParameter("@Design_Dept", MySqlDbType.VarChar, 255), new MySqlParameter("@Conster_Dept", MySqlDbType.VarChar, 255), new MySqlParameter("@Belong", MySqlDbType.VarChar, 255), new MySqlParameter("@Operator", MySqlDbType.VarChar, 255), new MySqlParameter("@Note", MySqlDbType.VarChar, 255), new MySqlParameter("@Exp_NoOri", MySqlDbType.VarChar, 255), new MySqlParameter("@FileName", MySqlDbType.VarChar, 255), new MySqlParameter("@Uploadtime", MySqlDbType.VarChar, 255), new MySqlParameter("@Exp_No", MySqlDbType.VarChar, 100) }; parameters[0].Value = model.Prj_No; parameters[1].Value = model.Prj_Name; parameters[2].Value = model.MapCode; parameters[3].Value = model.Name; parameters[4].Value = model.Area; parameters[5].Value = model.Service_Dis; parameters[6].Value = model.Service_Area; parameters[7].Value = model.SewageSystem_ID; parameters[8].Value = model.StormSystem_ID; parameters[9].Value = model.Type; parameters[10].Value = model.X; parameters[11].Value = model.Y; parameters[12].Value = model.High; parameters[13].Value = model.PS_Category2; parameters[14].Value = model.Ps_Num; parameters[15].Value = model.Design_Storm; parameters[16].Value = model.Design_Sewer; parameters[17].Value = model.Cur_Strom; parameters[18].Value = model.Cur_Sew; parameters[19].Value = model.Min_Level; parameters[20].Value = model.Control_Level; parameters[21].Value = model.Warnning_Level; parameters[22].Value = model.S_Invert; parameters[23].Value = model.PSize; parameters[24].Value = model.OverOutfallID; parameters[25].Value = model.Tel; parameters[26].Value = model.ForebayLen; parameters[27].Value = model.ForebayWid; parameters[28].Value = model.ForebayDep; parameters[29].Value = model.Code; parameters[30].Value = model.Address; parameters[31].Value = model.DataSource; parameters[32].Value = model.Sunit; parameters[33].Value = model.Sdate; parameters[34].Value = model.UpdateTime; parameters[35].Value = model.Mdate; parameters[36].Value = model.DataListID; parameters[37].Value = model.Status; parameters[38].Value = model.Ename; parameters[39].Value = model.Design_Dept; parameters[40].Value = model.Conster_Dept; parameters[41].Value = model.Belong; parameters[42].Value = model.Operator; parameters[43].Value = model.Note; parameters[44].Value = model.Exp_NoOri; parameters[45].Value = model.FileName; parameters[46].Value = model.Uploadtime; parameters[47].Value = model.Exp_No; int rows = DbHelperMySQL.ExecuteSql(strSql.ToString(), parameters); if (rows > 0) { return(true); } else { return(false); } }