Exemple #1
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(Model.fmd070 model)
        {
            int rowsAffected = DbHelperMySql.ExecuteSql(Update_SQL(model));

            if (rowsAffected > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemple #2
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public bool Add(Model.fmd070 model)
        {
            int rows = DbHelperMySql.ExecuteSql(Add_SQL(model));

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemple #3
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Model.fmd070 GetModel(string CLBH, string PHBBH)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select  ");
            strSql.Append(" CLBH,PHBBH,ZDRQ,ZT,BL,SYBH,PZRBH,BZ,PHBN,ZF,RLZBH,RLR,RLSJ,RLDMM,GXZBH,GXR,GXSJ,GXDMM,XS ");
            strSql.Append(" from fmd070 ");
            strSql.Append(" where CLBH='" + CLBH + "' and PHBBH='" + PHBBH + "' ");
            Model.fmd070 model = new Model.fmd070();
            DataSet      ds    = DbHelperMySql.Query(strSql.ToString());

            if (ds.Tables[0].Rows.Count > 0)
            {
                return(DataRowToModel(ds.Tables[0].Rows[0]));
            }
            else
            {
                return(null);
            }
        }
Exemple #4
0
        public string Add_SQL(Model.fmd070 model)
        {
            StringBuilder strSql  = new StringBuilder();
            StringBuilder strSql1 = new StringBuilder();
            StringBuilder strSql2 = new StringBuilder();

            if (model.CLBH != null)
            {
                strSql1.Append("CLBH,");
                strSql2.Append("'" + model.CLBH + "',");
            }
            if (model.PHBBH != null)
            {
                strSql1.Append("PHBBH,");
                strSql2.Append("'" + model.PHBBH + "',");
            }
            if (model.ZDRQ != null)
            {
                strSql1.Append("ZDRQ,");
                strSql2.Append("'" + model.ZDRQ + "',");
            }
            if (model.ZT != null)
            {
                strSql1.Append("ZT,");
                strSql2.Append("'" + model.ZT + "',");
            }
            if (model.BL != null)
            {
                strSql1.Append("BL,");
                strSql2.Append("'" + model.BL + "',");
            }
            if (model.SYBH != null)
            {
                strSql1.Append("SYBH,");
                strSql2.Append("'" + model.SYBH + "',");
            }
            if (model.PZRBH != null)
            {
                strSql1.Append("PZRBH,");
                strSql2.Append("'" + model.PZRBH + "',");
            }
            if (model.BZ != null)
            {
                strSql1.Append("BZ,");
                strSql2.Append("'" + model.BZ + "',");
            }
            if (model.PHBN != null)
            {
                strSql1.Append("PHBN,");
                strSql2.Append("'" + model.PHBN + "',");
            }
            if (model.ZF != null)
            {
                strSql1.Append("ZF,");
                strSql2.Append("'" + model.ZF + "',");
            }
            if (model.XS != null)
            {
                strSql1.Append("XS,");
                strSql2.Append("'" + model.XS + "',");
            }
            if (model.RLZBH != null)
            {
                strSql1.Append("RLZBH,");
                strSql2.Append("'" + model.RLZBH + "',");
            }
            if (model.RLR != null)
            {
                strSql1.Append("RLR,");
                strSql2.Append("'" + model.RLR + "',");
            }
            if (model.RLSJ != null)
            {
                strSql1.Append("RLSJ,");
                strSql2.Append("'" + model.RLSJ + "',");
            }
            if (model.RLDMM != null)
            {
                strSql1.Append("RLDMM,");
                strSql2.Append("'" + model.RLDMM + "',");
            }
            if (model.GXZBH != null)
            {
                strSql1.Append("GXZBH,");
                strSql2.Append("'" + model.GXZBH + "',");
            }
            if (model.GXR != null)
            {
                strSql1.Append("GXR,");
                strSql2.Append("'" + model.GXR + "',");
            }
            if (model.GXSJ != null)
            {
                strSql1.Append("GXSJ,");
                strSql2.Append("'" + model.GXSJ + "',");
            }
            if (model.GXDMM != null)
            {
                strSql1.Append("GXDMM,");
                strSql2.Append("'" + model.GXDMM + "',");
            }
            strSql.Append("insert into fmd070(");
            strSql.Append(strSql1.ToString().Remove(strSql1.Length - 1));
            strSql.Append(")");
            strSql.Append(" values (");
            strSql.Append(strSql2.ToString().Remove(strSql2.Length - 1));
            strSql.Append(")");

            return(strSql.ToString());
        }
Exemple #5
0
 /// <summary>
 /// 得到一个对象实体
 /// </summary>
 public Model.fmd070 DataRowToModel(DataRow row)
 {
     Model.fmd070 model = new Model.fmd070();
     if (row != null)
     {
         if (row["CLBH"] != null)
         {
             model.CLBH = row["CLBH"].ToString();
         }
         if (row["PHBBH"] != null)
         {
             model.PHBBH = row["PHBBH"].ToString();
         }
         if (row["ZDRQ"] != null)
         {
             model.ZDRQ = row["ZDRQ"].ToString();
         }
         if (row["ZT"] != null)
         {
             model.ZT = row["ZT"].ToString();
         }
         if (row["BL"] != null)
         {
             model.BL = row["BL"].ToString();
         }
         if (row["SYBH"] != null)
         {
             model.SYBH = row["SYBH"].ToString();
         }
         if (row["PZRBH"] != null)
         {
             model.PZRBH = row["PZRBH"].ToString();
         }
         if (row["BZ"] != null)
         {
             model.BZ = row["BZ"].ToString();
         }
         if (row["PHBN"] != null)
         {
             model.PHBN = row["PHBN"].ToString();
         }
         if (row["ZF"] != null)
         {
             model.ZF = row["ZF"].ToString();
         }
         if (row["XS"] != null)
         {
             model.XS = Convert.ToDouble(row["XS"]);
         }
         if (row["RLZBH"] != null)
         {
             model.RLZBH = row["RLZBH"].ToString();
         }
         if (row["RLR"] != null)
         {
             model.RLR = row["RLR"].ToString();
         }
         if (row["RLSJ"] != null)
         {
             model.RLSJ = row["RLSJ"].ToString();
         }
         if (row["RLDMM"] != null)
         {
             model.RLDMM = row["RLDMM"].ToString();
         }
         if (row["GXZBH"] != null)
         {
             model.GXZBH = row["GXZBH"].ToString();
         }
         if (row["GXR"] != null)
         {
             model.GXR = row["GXR"].ToString();
         }
         if (row["GXSJ"] != null)
         {
             model.GXSJ = row["GXSJ"].ToString();
         }
         if (row["GXDMM"] != null)
         {
             model.GXDMM = row["GXDMM"].ToString();
         }
     }
     return(model);
 }
Exemple #6
0
        public string Update_SQL(Model.fmd070 model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update fmd070 set ");
            if (model.ZDRQ != null)
            {
                strSql.Append("ZDRQ='" + model.ZDRQ + "',");
            }
            else
            {
                strSql.Append("ZDRQ= null ,");
            }
            if (model.ZT != null)
            {
                strSql.Append("ZT='" + model.ZT + "',");
            }
            else
            {
                strSql.Append("ZT= null ,");
            }
            if (model.BL != null)
            {
                strSql.Append("BL='" + model.BL + "',");
            }
            else
            {
                strSql.Append("BL= null ,");
            }
            if (model.SYBH != null)
            {
                strSql.Append("SYBH='" + model.SYBH + "',");
            }
            else
            {
                strSql.Append("SYBH= null ,");
            }
            if (model.PZRBH != null)
            {
                strSql.Append("PZRBH='" + model.PZRBH + "',");
            }
            else
            {
                strSql.Append("PZRBH= null ,");
            }
            if (model.BZ != null)
            {
                strSql.Append("BZ='" + model.BZ + "',");
            }
            else
            {
                strSql.Append("BZ= null ,");
            }
            if (model.PHBN != null)
            {
                strSql.Append("PHBN='" + model.PHBN + "',");
            }
            else
            {
                strSql.Append("PHBN= null ,");
            }
            if (model.ZF != null)
            {
                strSql.Append("ZF='" + model.ZF + "',");
            }
            else
            {
                strSql.Append("ZF= null ,");
            }
            if (model.RLZBH != null)
            {
                strSql.Append("RLZBH='" + model.RLZBH + "',");
            }
            else
            {
                strSql.Append("RLZBH= null ,");
            }
            if (model.RLR != null)
            {
                strSql.Append("RLR='" + model.RLR + "',");
            }
            else
            {
                strSql.Append("RLR= null ,");
            }
            if (model.RLSJ != null)
            {
                strSql.Append("RLSJ='" + model.RLSJ + "',");
            }
            else
            {
                strSql.Append("RLSJ= null ,");
            }
            if (model.RLDMM != null)
            {
                strSql.Append("RLDMM='" + model.RLDMM + "',");
            }
            else
            {
                strSql.Append("RLDMM= null ,");
            }
            if (model.GXZBH != null)
            {
                strSql.Append("GXZBH='" + model.GXZBH + "',");
            }
            else
            {
                strSql.Append("GXZBH= null ,");
            }
            if (model.GXR != null)
            {
                strSql.Append("GXR='" + model.GXR + "',");
            }
            else
            {
                strSql.Append("GXR= null ,");
            }
            if (model.GXSJ != null)
            {
                strSql.Append("GXSJ='" + model.GXSJ + "',");
            }
            else
            {
                strSql.Append("GXSJ= null ,");
            }
            if (model.GXDMM != null)
            {
                strSql.Append("GXDMM='" + model.GXDMM + "',");
            }
            else
            {
                strSql.Append("GXDMM= null ,");
            }
            int n = strSql.ToString().LastIndexOf(",");

            strSql.Remove(n, 1);
            strSql.Append(" where CLBH='" + model.CLBH + "' and PHBBH='" + model.PHBBH + "' ");

            return(strSql.ToString());
        }
Exemple #7
0
 /// <summary>
 /// 得到一个对象实体
 /// </summary>
 public Model.fmd070 GetModel(string CLBH,string PHBBH)
 {
     StringBuilder strSql=new StringBuilder();
     strSql.Append("select  ");
     strSql.Append(" CLBH,PHBBH,ZDRQ,ZT,BL,SYBH,PZRBH,BZ,PHBN,ZF,RLZBH,RLR,RLSJ,RLDMM,GXZBH,GXR,GXSJ,GXDMM,XS ");
     strSql.Append(" from fmd070 ");
     strSql.Append(" where CLBH='"+CLBH+"' and PHBBH='"+PHBBH+"' " );
     Model.fmd070 model=new Model.fmd070();
     DataSet ds=DbHelperMySql.Query(strSql.ToString());
     if(ds.Tables[0].Rows.Count>0)
     {
         return DataRowToModel(ds.Tables[0].Rows[0]);
     }
     else
     {
         return null;
     }
 }
Exemple #8
0
 /// <summary>
 /// 得到一个对象实体
 /// </summary>
 public Model.fmd070 DataRowToModel(DataRow row)
 {
     Model.fmd070 model=new Model.fmd070();
     if (row != null)
     {
         if(row["CLBH"]!=null)
         {
             model.CLBH=row["CLBH"].ToString();
         }
         if(row["PHBBH"]!=null)
         {
             model.PHBBH=row["PHBBH"].ToString();
         }
         if(row["ZDRQ"]!=null)
         {
             model.ZDRQ=row["ZDRQ"].ToString();
         }
         if(row["ZT"]!=null)
         {
             model.ZT=row["ZT"].ToString();
         }
         if(row["BL"]!=null)
         {
             model.BL=row["BL"].ToString();
         }
         if(row["SYBH"]!=null)
         {
             model.SYBH=row["SYBH"].ToString();
         }
         if(row["PZRBH"]!=null)
         {
             model.PZRBH=row["PZRBH"].ToString();
         }
         if(row["BZ"]!=null)
         {
             model.BZ=row["BZ"].ToString();
         }
         if(row["PHBN"]!=null)
         {
             model.PHBN=row["PHBN"].ToString();
         }
         if(row["ZF"]!=null)
         {
             model.ZF=row["ZF"].ToString();
         }
         if (row["XS"] != null)
         {
             model.XS = Convert.ToDouble(row["XS"]);
         }
         if(row["RLZBH"]!=null)
         {
             model.RLZBH=row["RLZBH"].ToString();
         }
         if(row["RLR"]!=null)
         {
             model.RLR=row["RLR"].ToString();
         }
         if(row["RLSJ"]!=null)
         {
             model.RLSJ=row["RLSJ"].ToString();
         }
         if(row["RLDMM"]!=null)
         {
             model.RLDMM=row["RLDMM"].ToString();
         }
         if(row["GXZBH"]!=null)
         {
             model.GXZBH=row["GXZBH"].ToString();
         }
         if(row["GXR"]!=null)
         {
             model.GXR=row["GXR"].ToString();
         }
         if(row["GXSJ"]!=null)
         {
             model.GXSJ=row["GXSJ"].ToString();
         }
         if(row["GXDMM"]!=null)
         {
             model.GXDMM=row["GXDMM"].ToString();
         }
     }
     return model;
 }