Esempio n. 1
0
 private void ShowInfo(string Exp_No)
 {
     Maticsoft.BLL.ps_manhole   bll   = new Maticsoft.BLL.ps_manhole();
     Maticsoft.Model.ps_manhole 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.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.txtWellDeep.Text      = model.WellDeep.ToString();
     this.txtOffset.Text        = model.Offset;
     this.txtRotation.Text      = model.Rotation.ToString();
     this.txtCode.Text          = model.Code;
     this.txtModel.Text         = model.Model;
     this.txtWellShape.Text     = model.WellShape;
     this.txtWellSize.Text      = model.WellSize;
     this.txtWellMaterial.Text  = model.WellMaterial;
     this.txtWellPipes.Text     = model.WellPipes.ToString();
     this.txtWaterDeep.Text     = model.WaterDeep.ToString();
     this.txtMudDeep.Text       = model.MudDeep.ToString();
     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.txtManhole_Type.Text  = model.Manhole_Type;
     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;
 }
Esempio n. 2
0
 private void ShowInfo(string Exp_No)
 {
     Maticsoft.BLL.ps_manhole   bll   = new Maticsoft.BLL.ps_manhole();
     Maticsoft.Model.ps_manhole 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.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.lblWellDeep.Text      = model.WellDeep.ToString();
     this.lblOffset.Text        = model.Offset;
     this.lblRotation.Text      = model.Rotation.ToString();
     this.lblCode.Text          = model.Code;
     this.lblModel.Text         = model.Model;
     this.lblWellShape.Text     = model.WellShape;
     this.lblWellSize.Text      = model.WellSize;
     this.lblWellMaterial.Text  = model.WellMaterial;
     this.lblWellPipes.Text     = model.WellPipes.ToString();
     this.lblWaterDeep.Text     = model.WaterDeep.ToString();
     this.lblMudDeep.Text       = model.MudDeep.ToString();
     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.lblManhole_Type.Text  = model.Manhole_Type;
     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;
 }
Esempio n. 3
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Maticsoft.Model.ps_manhole GetModel(string Exp_No)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select Prj_No,Prj_Name,Exp_No,MapCode,SewageSystem_ID,StormSystem_ID,Type,X,Y,High,WellDeep,Offset,Rotation,Code,Model,WellShape,WellSize,WellMaterial,WellPipes,WaterDeep,MudDeep,Address,PointPosition,DataSource,Visibility,Sunit,Sdate,UpdateTime,Mdate,Manhole_Type,Status,Ename,Design_Dept,Conster_Dept,Belong,Operator,Note,Exp_NoOri,FileName,Uploadtime from ps_manhole ");
            strSql.Append(" where Exp_No=@Exp_No ");
            MySqlParameter[] parameters =
            {
                new MySqlParameter("@Exp_No", MySqlDbType.VarChar, 100)
            };
            parameters[0].Value = Exp_No;

            Maticsoft.Model.ps_manhole model = new Maticsoft.Model.ps_manhole();
            DataSet ds = DbHelperMySQL.Query(strSql.ToString(), parameters);

            if (ds.Tables[0].Rows.Count > 0)
            {
                return(DataRowToModel(ds.Tables[0].Rows[0]));
            }
            else
            {
                return(null);
            }
        }
Esempio n. 4
0
        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.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(txtWellDeep.Text))
            {
                strErr += "WellDeep格式错误!\\n";
            }
            if (this.txtOffset.Text.Trim().Length == 0)
            {
                strErr += "Offset不能为空!\\n";
            }
            if (!PageValidate.IsDecimal(txtRotation.Text))
            {
                strErr += "Rotation格式错误!\\n";
            }
            if (this.txtCode.Text.Trim().Length == 0)
            {
                strErr += "Code不能为空!\\n";
            }
            if (this.txtModel.Text.Trim().Length == 0)
            {
                strErr += "Model不能为空!\\n";
            }
            if (this.txtWellShape.Text.Trim().Length == 0)
            {
                strErr += "WellShape不能为空!\\n";
            }
            if (this.txtWellSize.Text.Trim().Length == 0)
            {
                strErr += "WellSize不能为空!\\n";
            }
            if (this.txtWellMaterial.Text.Trim().Length == 0)
            {
                strErr += "WellMaterial不能为空!\\n";
            }
            if (!PageValidate.IsNumber(txtWellPipes.Text))
            {
                strErr += "WellPipes格式错误!\\n";
            }
            if (!PageValidate.IsDecimal(txtWaterDeep.Text))
            {
                strErr += "WaterDeep格式错误!\\n";
            }
            if (!PageValidate.IsDecimal(txtMudDeep.Text))
            {
                strErr += "MudDeep格式错误!\\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.txtManhole_Type.Text.Trim().Length == 0)
            {
                strErr += "Manhole_Type不能为空!\\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  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 WellDeep      = decimal.Parse(this.txtWellDeep.Text);
            string  Offset        = this.txtOffset.Text;
            decimal Rotation      = decimal.Parse(this.txtRotation.Text);
            string  Code          = this.txtCode.Text;
            string  Model         = this.txtModel.Text;
            string  WellShape     = this.txtWellShape.Text;
            string  WellSize      = this.txtWellSize.Text;
            string  WellMaterial  = this.txtWellMaterial.Text;
            int     WellPipes     = int.Parse(this.txtWellPipes.Text);
            decimal WaterDeep     = decimal.Parse(this.txtWaterDeep.Text);
            decimal MudDeep       = decimal.Parse(this.txtMudDeep.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  Manhole_Type  = this.txtManhole_Type.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_manhole model = new Maticsoft.Model.ps_manhole();
            model.Prj_No          = Prj_No;
            model.Prj_Name        = Prj_Name;
            model.Exp_No          = Exp_No;
            model.MapCode         = MapCode;
            model.SewageSystem_ID = SewageSystem_ID;
            model.StormSystem_ID  = StormSystem_ID;
            model.Type            = Type;
            model.X             = X;
            model.Y             = Y;
            model.High          = High;
            model.WellDeep      = WellDeep;
            model.Offset        = Offset;
            model.Rotation      = Rotation;
            model.Code          = Code;
            model.Model         = Model;
            model.WellShape     = WellShape;
            model.WellSize      = WellSize;
            model.WellMaterial  = WellMaterial;
            model.WellPipes     = WellPipes;
            model.WaterDeep     = WaterDeep;
            model.MudDeep       = MudDeep;
            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.Manhole_Type  = Manhole_Type;
            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_manhole bll = new Maticsoft.BLL.ps_manhole();
            bll.Add(model);
            Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "add.aspx");
        }
Esempio n. 5
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public bool Add(Maticsoft.Model.ps_manhole model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into ps_manhole(");
            strSql.Append("Prj_No,Prj_Name,Exp_No,MapCode,SewageSystem_ID,StormSystem_ID,Type,X,Y,High,WellDeep,Offset,Rotation,Code,Model,WellShape,WellSize,WellMaterial,WellPipes,WaterDeep,MudDeep,Address,PointPosition,DataSource,Visibility,Sunit,Sdate,UpdateTime,Mdate,Manhole_Type,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,@SewageSystem_ID,@StormSystem_ID,@Type,@X,@Y,@High,@WellDeep,@Offset,@Rotation,@Code,@Model,@WellShape,@WellSize,@WellMaterial,@WellPipes,@WaterDeep,@MudDeep,@Address,@PointPosition,@DataSource,@Visibility,@Sunit,@Sdate,@UpdateTime,@Mdate,@Manhole_Type,@Status,@Ename,@Design_Dept,@Conster_Dept,@Belong,@Operator,@Note,@Exp_NoOri,@FileName,@Uploadtime)");
            MySqlParameter[] parameters =
            {
                new MySqlParameter("@Prj_No",          MySqlDbType.VarChar, 255),
                new MySqlParameter("@Prj_Name",        MySqlDbType.VarChar, 255),
                new MySqlParameter("@Exp_No",          MySqlDbType.VarChar, 100),
                new MySqlParameter("@MapCode",         MySqlDbType.VarChar,  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("@WellDeep",        MySqlDbType.Decimal,   7),
                new MySqlParameter("@Offset",          MySqlDbType.VarChar,  50),
                new MySqlParameter("@Rotation",        MySqlDbType.Decimal,  10),
                new MySqlParameter("@Code",            MySqlDbType.VarChar,  10),
                new MySqlParameter("@Model",           MySqlDbType.VarChar,  50),
                new MySqlParameter("@WellShape",       MySqlDbType.VarChar,  50),
                new MySqlParameter("@WellSize",        MySqlDbType.VarChar,  50),
                new MySqlParameter("@WellMaterial",    MySqlDbType.VarChar,  50),
                new MySqlParameter("@WellPipes",       MySqlDbType.Int32,    10),
                new MySqlParameter("@WaterDeep",       MySqlDbType.Decimal,   7),
                new MySqlParameter("@MudDeep",         MySqlDbType.Decimal,   7),
                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("@Manhole_Type",    MySqlDbType.VarChar,  10),
                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.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.WellDeep;
            parameters[11].Value = model.Offset;
            parameters[12].Value = model.Rotation;
            parameters[13].Value = model.Code;
            parameters[14].Value = model.Model;
            parameters[15].Value = model.WellShape;
            parameters[16].Value = model.WellSize;
            parameters[17].Value = model.WellMaterial;
            parameters[18].Value = model.WellPipes;
            parameters[19].Value = model.WaterDeep;
            parameters[20].Value = model.MudDeep;
            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.Manhole_Type;
            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;

            int rows = DbHelperMySQL.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Esempio n. 6
0
 /// <summary>
 /// 得到一个对象实体
 /// </summary>
 public Maticsoft.Model.ps_manhole DataRowToModel(DataRow row)
 {
     Maticsoft.Model.ps_manhole model = new Maticsoft.Model.ps_manhole();
     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["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["WellDeep"] != null && row["WellDeep"].ToString() != "")
         {
             model.WellDeep = decimal.Parse(row["WellDeep"].ToString());
         }
         if (row["Offset"] != null)
         {
             model.Offset = row["Offset"].ToString();
         }
         if (row["Rotation"] != null && row["Rotation"].ToString() != "")
         {
             model.Rotation = decimal.Parse(row["Rotation"].ToString());
         }
         if (row["Code"] != null)
         {
             model.Code = row["Code"].ToString();
         }
         if (row["Model"] != null)
         {
             model.Model = row["Model"].ToString();
         }
         if (row["WellShape"] != null)
         {
             model.WellShape = row["WellShape"].ToString();
         }
         if (row["WellSize"] != null)
         {
             model.WellSize = row["WellSize"].ToString();
         }
         if (row["WellMaterial"] != null)
         {
             model.WellMaterial = row["WellMaterial"].ToString();
         }
         if (row["WellPipes"] != null && row["WellPipes"].ToString() != "")
         {
             model.WellPipes = int.Parse(row["WellPipes"].ToString());
         }
         if (row["WaterDeep"] != null && row["WaterDeep"].ToString() != "")
         {
             model.WaterDeep = decimal.Parse(row["WaterDeep"].ToString());
         }
         if (row["MudDeep"] != null && row["MudDeep"].ToString() != "")
         {
             model.MudDeep = decimal.Parse(row["MudDeep"].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["Manhole_Type"] != null)
         {
             model.Manhole_Type = row["Manhole_Type"].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);
 }
Esempio n. 7
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(Maticsoft.Model.ps_manhole model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update ps_manhole set ");
            strSql.Append("Prj_No=@Prj_No,");
            strSql.Append("Prj_Name=@Prj_Name,");
            strSql.Append("MapCode=@MapCode,");
            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("WellDeep=@WellDeep,");
            strSql.Append("Offset=@Offset,");
            strSql.Append("Rotation=@Rotation,");
            strSql.Append("Code=@Code,");
            strSql.Append("Model=@Model,");
            strSql.Append("WellShape=@WellShape,");
            strSql.Append("WellSize=@WellSize,");
            strSql.Append("WellMaterial=@WellMaterial,");
            strSql.Append("WellPipes=@WellPipes,");
            strSql.Append("WaterDeep=@WaterDeep,");
            strSql.Append("MudDeep=@MudDeep,");
            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("Manhole_Type=@Manhole_Type,");
            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, 255),
                new MySqlParameter("@Prj_Name",        MySqlDbType.VarChar, 255),
                new MySqlParameter("@MapCode",         MySqlDbType.VarChar,  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("@WellDeep",        MySqlDbType.Decimal,   7),
                new MySqlParameter("@Offset",          MySqlDbType.VarChar,  50),
                new MySqlParameter("@Rotation",        MySqlDbType.Decimal,  10),
                new MySqlParameter("@Code",            MySqlDbType.VarChar,  10),
                new MySqlParameter("@Model",           MySqlDbType.VarChar,  50),
                new MySqlParameter("@WellShape",       MySqlDbType.VarChar,  50),
                new MySqlParameter("@WellSize",        MySqlDbType.VarChar,  50),
                new MySqlParameter("@WellMaterial",    MySqlDbType.VarChar,  50),
                new MySqlParameter("@WellPipes",       MySqlDbType.Int32,    10),
                new MySqlParameter("@WaterDeep",       MySqlDbType.Decimal,   7),
                new MySqlParameter("@MudDeep",         MySqlDbType.Decimal,   7),
                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("@Manhole_Type",    MySqlDbType.VarChar,  10),
                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.SewageSystem_ID;
            parameters[4].Value  = model.StormSystem_ID;
            parameters[5].Value  = model.Type;
            parameters[6].Value  = model.X;
            parameters[7].Value  = model.Y;
            parameters[8].Value  = model.High;
            parameters[9].Value  = model.WellDeep;
            parameters[10].Value = model.Offset;
            parameters[11].Value = model.Rotation;
            parameters[12].Value = model.Code;
            parameters[13].Value = model.Model;
            parameters[14].Value = model.WellShape;
            parameters[15].Value = model.WellSize;
            parameters[16].Value = model.WellMaterial;
            parameters[17].Value = model.WellPipes;
            parameters[18].Value = model.WaterDeep;
            parameters[19].Value = model.MudDeep;
            parameters[20].Value = model.Address;
            parameters[21].Value = model.PointPosition;
            parameters[22].Value = model.DataSource;
            parameters[23].Value = model.Visibility;
            parameters[24].Value = model.Sunit;
            parameters[25].Value = model.Sdate;
            parameters[26].Value = model.UpdateTime;
            parameters[27].Value = model.Mdate;
            parameters[28].Value = model.Manhole_Type;
            parameters[29].Value = model.Status;
            parameters[30].Value = model.Ename;
            parameters[31].Value = model.Design_Dept;
            parameters[32].Value = model.Conster_Dept;
            parameters[33].Value = model.Belong;
            parameters[34].Value = model.Operator;
            parameters[35].Value = model.Note;
            parameters[36].Value = model.Exp_NoOri;
            parameters[37].Value = model.FileName;
            parameters[38].Value = model.Uploadtime;
            parameters[39].Value = model.Exp_No;

            int rows = DbHelperMySQL.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }