private void ShowInfo(string Exp_No) { Maticsoft.BLL.ps_gate bll = new Maticsoft.BLL.ps_gate(); Maticsoft.Model.ps_gate model = bll.GetModel(Exp_No); this.txtPrj_No.Text = model.Prj_No; this.txtPrj_Name.Text = model.Prj_Name; this.lblExp_No.Text = model.Exp_No; this.txtMapCode.Text = model.MapCode; this.txtName.Text = model.Name; this.txtSewageSystem_ID.Text = model.SewageSystem_ID; this.txtStormSystem_ID.Text = model.StormSystem_ID; this.txtType.Text = model.Type; this.txtX.Text = model.X.ToString(); this.txtY.Text = model.Y.ToString(); this.txtHigh.Text = model.High.ToString(); this.txtTop_Ele.Text = model.Top_Ele.ToString(); this.txtBot_Ele.Text = model.Bot_Ele.ToString(); this.txtWidth.Text = model.Width.ToString(); this.txtManufacturer.Text = model.Manufacturer; this.txtGateModel.Text = model.GateModel; this.txtNum.Text = model.Num; this.txtControl_Type.Text = model.Control_Type; this.txtSwitch_Style.Text = model.Switch_Style; this.txtPressure_Type.Text = model.Pressure_Type; this.txtCode.Text = model.Code; this.txtModel.Text = model.Model; this.txtAddress.Text = model.Address; this.txtPointPosition.Text = model.PointPosition.ToString(); this.txtDataSource.Text = model.DataSource; this.txtVisibility.Text = model.Visibility; this.txtSunit.Text = model.Sunit; this.txtSdate.Text = model.Sdate; this.txtUpdateTime.Text = model.UpdateTime; this.txtMdate.Text = model.Mdate; this.txtDataListID.Text = model.DataListID; this.txtStatus.Text = model.Status; this.txtEname.Text = model.Ename; this.txtDesign_Dept.Text = model.Design_Dept; this.txtConster_Dept.Text = model.Conster_Dept; this.txtBelong.Text = model.Belong; this.txtOperator.Text = model.Operator; this.txtNote.Text = model.Note; this.txtExp_NoOri.Text = model.Exp_NoOri; this.txtfilename.Text = model.filename; this.txtupdate.Text = model.update; }
private void ShowInfo(string Exp_No) { Maticsoft.BLL.ps_gate bll = new Maticsoft.BLL.ps_gate(); Maticsoft.Model.ps_gate 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.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.lblTop_Ele.Text = model.Top_Ele.ToString(); this.lblBot_Ele.Text = model.Bot_Ele.ToString(); this.lblWidth.Text = model.Width.ToString(); this.lblManufacturer.Text = model.Manufacturer; this.lblGateModel.Text = model.GateModel; this.lblNum.Text = model.Num; this.lblControl_Type.Text = model.Control_Type; this.lblSwitch_Style.Text = model.Switch_Style; this.lblPressure_Type.Text = model.Pressure_Type; this.lblCode.Text = model.Code; this.lblModel.Text = model.Model; this.lblAddress.Text = model.Address; this.lblPointPosition.Text = model.PointPosition.ToString(); this.lblDataSource.Text = model.DataSource; this.lblVisibility.Text = model.Visibility; 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_gate GetModel(string Exp_No) { StringBuilder strSql = new StringBuilder(); strSql.Append("select Prj_No,Prj_Name,Exp_No,MapCode,Name,SewageSystem_ID,StormSystem_ID,Type,X,Y,High,Top_Ele,Bot_Ele,Width,Manufacturer,GateModel,Num,Control_Type,Switch_Style,Pressure_Type,Code,Model,Address,PointPosition,DataSource,Visibility,Sunit,Sdate,UpdateTime,Mdate,DataListID,Status,Ename,Design_Dept,Conster_Dept,Belong,Operator,Note,Exp_NoOri,FileName,Uploadtime from ps_gate "); strSql.Append(" where Exp_No=@Exp_No "); MySqlParameter[] parameters = { new MySqlParameter("@Exp_No", MySqlDbType.VarChar, 100) }; parameters[0].Value = Exp_No; Maticsoft.Model.ps_gate model = new Maticsoft.Model.ps_gate(); DataSet ds = DbHelperMySQL.Query(strSql.ToString(), parameters); if (ds.Tables[0].Rows.Count > 0) { return(DataRowToModel(ds.Tables[0].Rows[0])); } else { return(null); } }
public 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.txtMapCode.Text.Trim().Length == 0) { strErr += "MapCode不能为空!\\n"; } if (this.txtName.Text.Trim().Length == 0) { strErr += "Name不能为空!\\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 (!PageValidate.IsDecimal(txtTop_Ele.Text)) { strErr += "Top_Ele格式错误!\\n"; } if (!PageValidate.IsDecimal(txtBot_Ele.Text)) { strErr += "Bot_Ele格式错误!\\n"; } if (!PageValidate.IsDecimal(txtWidth.Text)) { strErr += "Width格式错误!\\n"; } if (this.txtManufacturer.Text.Trim().Length == 0) { strErr += "Manufacturer不能为空!\\n"; } if (this.txtGateModel.Text.Trim().Length == 0) { strErr += "GateModel不能为空!\\n"; } if (this.txtNum.Text.Trim().Length == 0) { strErr += "Num不能为空!\\n"; } if (this.txtControl_Type.Text.Trim().Length == 0) { strErr += "Control_Type不能为空!\\n"; } if (this.txtSwitch_Style.Text.Trim().Length == 0) { strErr += "Switch_Style不能为空!\\n"; } if (this.txtPressure_Type.Text.Trim().Length == 0) { strErr += "Pressure_Type不能为空!\\n"; } if (this.txtCode.Text.Trim().Length == 0) { strErr += "Code不能为空!\\n"; } if (this.txtModel.Text.Trim().Length == 0) { strErr += "Model不能为空!\\n"; } if (this.txtAddress.Text.Trim().Length == 0) { strErr += "Address不能为空!\\n"; } if (!PageValidate.IsNumber(txtPointPosition.Text)) { strErr += "PointPosition格式错误!\\n"; } if (this.txtDataSource.Text.Trim().Length == 0) { strErr += "DataSource不能为空!\\n"; } if (this.txtVisibility.Text.Trim().Length == 0) { strErr += "Visibility不能为空!\\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.lblExp_No.Text; string MapCode = this.txtMapCode.Text; string Name = this.txtName.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); decimal Top_Ele = decimal.Parse(this.txtTop_Ele.Text); decimal Bot_Ele = decimal.Parse(this.txtBot_Ele.Text); decimal Width = decimal.Parse(this.txtWidth.Text); string Manufacturer = this.txtManufacturer.Text; string GateModel = this.txtGateModel.Text; string Num = this.txtNum.Text; string Control_Type = this.txtControl_Type.Text; string Switch_Style = this.txtSwitch_Style.Text; string Pressure_Type = this.txtPressure_Type.Text; string Code = this.txtCode.Text; string Model = this.txtModel.Text; string Address = this.txtAddress.Text; int PointPosition = int.Parse(this.txtPointPosition.Text); string DataSource = this.txtDataSource.Text; string Visibility = this.txtVisibility.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_gate model = new Maticsoft.Model.ps_gate(); model.Prj_No = Prj_No; model.Prj_Name = Prj_Name; model.Exp_No = Exp_No; model.MapCode = MapCode; model.Name = Name; model.SewageSystem_ID = SewageSystem_ID; model.StormSystem_ID = StormSystem_ID; model.Type = Type; model.X = X; model.Y = Y; model.High = High; model.Top_Ele = Top_Ele; model.Bot_Ele = Bot_Ele; model.Width = Width; model.Manufacturer = Manufacturer; model.GateModel = GateModel; model.Num = Num; model.Control_Type = Control_Type; model.Switch_Style = Switch_Style; model.Pressure_Type = Pressure_Type; model.Code = Code; model.Model = Model; model.Address = Address; model.PointPosition = PointPosition; model.DataSource = DataSource; model.Visibility = Visibility; 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_gate bll = new Maticsoft.BLL.ps_gate(); bll.Update(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "list.aspx"); }
/// <summary> /// 增加一条数据 /// </summary> public bool Add(Maticsoft.Model.ps_gate model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into ps_gate("); strSql.Append("Prj_No,Prj_Name,Exp_No,MapCode,Name,SewageSystem_ID,StormSystem_ID,Type,X,Y,High,Top_Ele,Bot_Ele,Width,Manufacturer,GateModel,Num,Control_Type,Switch_Style,Pressure_Type,Code,Model,Address,PointPosition,DataSource,Visibility,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,@SewageSystem_ID,@StormSystem_ID,@Type,@X,@Y,@High,@Top_Ele,@Bot_Ele,@Width,@Manufacturer,@GateModel,@Num,@Control_Type,@Switch_Style,@Pressure_Type,@Code,@Model,@Address,@PointPosition,@DataSource,@Visibility,@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("@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("@Top_Ele", MySqlDbType.Decimal, 7), new MySqlParameter("@Bot_Ele", MySqlDbType.Decimal, 7), new MySqlParameter("@Width", MySqlDbType.Decimal, 7), new MySqlParameter("@Manufacturer", MySqlDbType.VarChar, 100), new MySqlParameter("@GateModel", MySqlDbType.VarChar, 100), new MySqlParameter("@Num", MySqlDbType.VarChar, 10), new MySqlParameter("@Control_Type", MySqlDbType.VarChar, 10), new MySqlParameter("@Switch_Style", MySqlDbType.VarChar, 10), new MySqlParameter("@Pressure_Type", MySqlDbType.VarChar, 10), new MySqlParameter("@Code", MySqlDbType.VarChar, 10), new MySqlParameter("@Model", MySqlDbType.VarChar, 50), new MySqlParameter("@Address", MySqlDbType.VarChar, 100), new MySqlParameter("@PointPosition", MySqlDbType.Int32, 10), new MySqlParameter("@DataSource", MySqlDbType.VarChar, 10), new MySqlParameter("@Visibility", MySqlDbType.VarChar, 4), 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.SewageSystem_ID; parameters[6].Value = model.StormSystem_ID; parameters[7].Value = model.Type; parameters[8].Value = model.X; parameters[9].Value = model.Y; parameters[10].Value = model.High; parameters[11].Value = model.Top_Ele; parameters[12].Value = model.Bot_Ele; parameters[13].Value = model.Width; parameters[14].Value = model.Manufacturer; parameters[15].Value = model.GateModel; parameters[16].Value = model.Num; parameters[17].Value = model.Control_Type; parameters[18].Value = model.Switch_Style; parameters[19].Value = model.Pressure_Type; parameters[20].Value = model.Code; parameters[21].Value = model.Model; parameters[22].Value = model.Address; parameters[23].Value = model.PointPosition; parameters[24].Value = model.DataSource; parameters[25].Value = model.Visibility; parameters[26].Value = model.Sunit; parameters[27].Value = model.Sdate; parameters[28].Value = model.UpdateTime; parameters[29].Value = model.Mdate; parameters[30].Value = model.DataListID; parameters[31].Value = model.Status; parameters[32].Value = model.Ename; parameters[33].Value = model.Design_Dept; parameters[34].Value = model.Conster_Dept; parameters[35].Value = model.Belong; parameters[36].Value = model.Operator; parameters[37].Value = model.Note; parameters[38].Value = model.Exp_NoOri; parameters[39].Value = model.FileName; parameters[40].Value = model.Uploadtime; int rows = DbHelperMySQL.ExecuteSql(strSql.ToString(), parameters); if (rows > 0) { return(true); } else { return(false); } }
/// <summary> /// 得到一个对象实体 /// </summary> public Maticsoft.Model.ps_gate DataRowToModel(DataRow row) { Maticsoft.Model.ps_gate model = new Maticsoft.Model.ps_gate(); 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["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["Top_Ele"] != null && row["Top_Ele"].ToString() != "") { model.Top_Ele = decimal.Parse(row["Top_Ele"].ToString()); } if (row["Bot_Ele"] != null && row["Bot_Ele"].ToString() != "") { model.Bot_Ele = decimal.Parse(row["Bot_Ele"].ToString()); } if (row["Width"] != null && row["Width"].ToString() != "") { model.Width = decimal.Parse(row["Width"].ToString()); } if (row["Manufacturer"] != null) { model.Manufacturer = row["Manufacturer"].ToString(); } if (row["GateModel"] != null) { model.GateModel = row["GateModel"].ToString(); } if (row["Num"] != null) { model.Num = row["Num"].ToString(); } if (row["Control_Type"] != null) { model.Control_Type = row["Control_Type"].ToString(); } if (row["Switch_Style"] != null) { model.Switch_Style = row["Switch_Style"].ToString(); } if (row["Pressure_Type"] != null) { model.Pressure_Type = row["Pressure_Type"].ToString(); } if (row["Code"] != null) { model.Code = row["Code"].ToString(); } if (row["Model"] != null) { model.Model = row["Model"].ToString(); } if (row["Address"] != null) { model.Address = row["Address"].ToString(); } if (row["PointPosition"] != null && row["PointPosition"].ToString() != "") { model.PointPosition = int.Parse(row["PointPosition"].ToString()); } if (row["DataSource"] != null) { model.DataSource = row["DataSource"].ToString(); } if (row["Visibility"] != null) { model.Visibility = row["Visibility"].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 Update(Maticsoft.Model.ps_gate model) { StringBuilder strSql = new StringBuilder(); strSql.Append("update ps_gate set "); strSql.Append("Prj_No=@Prj_No,"); strSql.Append("Prj_Name=@Prj_Name,"); strSql.Append("MapCode=@MapCode,"); strSql.Append("Name=@Name,"); 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("Top_Ele=@Top_Ele,"); strSql.Append("Bot_Ele=@Bot_Ele,"); strSql.Append("Width=@Width,"); strSql.Append("Manufacturer=@Manufacturer,"); strSql.Append("GateModel=@GateModel,"); strSql.Append("Num=@Num,"); strSql.Append("Control_Type=@Control_Type,"); strSql.Append("Switch_Style=@Switch_Style,"); strSql.Append("Pressure_Type=@Pressure_Type,"); strSql.Append("Code=@Code,"); strSql.Append("Model=@Model,"); strSql.Append("Address=@Address,"); strSql.Append("PointPosition=@PointPosition,"); strSql.Append("DataSource=@DataSource,"); strSql.Append("Visibility=@Visibility,"); 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("@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("@Top_Ele", MySqlDbType.Decimal, 7), new MySqlParameter("@Bot_Ele", MySqlDbType.Decimal, 7), new MySqlParameter("@Width", MySqlDbType.Decimal, 7), new MySqlParameter("@Manufacturer", MySqlDbType.VarChar, 100), new MySqlParameter("@GateModel", MySqlDbType.VarChar, 100), new MySqlParameter("@Num", MySqlDbType.VarChar, 10), new MySqlParameter("@Control_Type", MySqlDbType.VarChar, 10), new MySqlParameter("@Switch_Style", MySqlDbType.VarChar, 10), new MySqlParameter("@Pressure_Type", MySqlDbType.VarChar, 10), new MySqlParameter("@Code", MySqlDbType.VarChar, 10), new MySqlParameter("@Model", MySqlDbType.VarChar, 50), new MySqlParameter("@Address", MySqlDbType.VarChar, 100), new MySqlParameter("@PointPosition", MySqlDbType.Int32, 10), new MySqlParameter("@DataSource", MySqlDbType.VarChar, 10), new MySqlParameter("@Visibility", MySqlDbType.VarChar, 4), 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.SewageSystem_ID; parameters[5].Value = model.StormSystem_ID; parameters[6].Value = model.Type; parameters[7].Value = model.X; parameters[8].Value = model.Y; parameters[9].Value = model.High; parameters[10].Value = model.Top_Ele; parameters[11].Value = model.Bot_Ele; parameters[12].Value = model.Width; parameters[13].Value = model.Manufacturer; parameters[14].Value = model.GateModel; parameters[15].Value = model.Num; parameters[16].Value = model.Control_Type; parameters[17].Value = model.Switch_Style; parameters[18].Value = model.Pressure_Type; parameters[19].Value = model.Code; parameters[20].Value = model.Model; parameters[21].Value = model.Address; parameters[22].Value = model.PointPosition; parameters[23].Value = model.DataSource; parameters[24].Value = model.Visibility; parameters[25].Value = model.Sunit; parameters[26].Value = model.Sdate; parameters[27].Value = model.UpdateTime; parameters[28].Value = model.Mdate; parameters[29].Value = model.DataListID; parameters[30].Value = model.Status; parameters[31].Value = model.Ename; parameters[32].Value = model.Design_Dept; parameters[33].Value = model.Conster_Dept; parameters[34].Value = model.Belong; parameters[35].Value = model.Operator; parameters[36].Value = model.Note; parameters[37].Value = model.Exp_NoOri; parameters[38].Value = model.FileName; parameters[39].Value = model.Uploadtime; parameters[40].Value = model.Exp_No; int rows = DbHelperMySQL.ExecuteSql(strSql.ToString(), parameters); if (rows > 0) { return(true); } else { return(false); } }