예제 #1
0
        /// <summary>
        /// 查询一条加载减速限值地标
        /// </summary>
        /// <returns>JZJS_XZDB</returns>
        public JZJS_XZDB Get_JZJS_XZDB()
        {
            string    sql       = "select * from JZJS_XZDB";
            JZJS_XZDB jzjs_xzdb = new JZJS_XZDB();

            try
            {
                DataTable dt = DBHelperSQL.GetDataTable(sql);
                if (dt.Rows.Count > 0)
                {
                    jzjs_xzdb.d1Date20000701b        = dt.Rows[0]["d1Date20000701b"].ToString();
                    jzjs_xzdb.d1Date2000070120050630 = dt.Rows[0]["d1Date2000070120050630"].ToString();
                    jzjs_xzdb.d1Date20050701         = dt.Rows[0]["d1Date20050701"].ToString();
                    jzjs_xzdb.d2Date20011001b        = dt.Rows[0]["d2Date20011001b"].ToString();
                    jzjs_xzdb.d2Date2001100120060630 = dt.Rows[0]["d2Date2001100120060630"].ToString();
                    jzjs_xzdb.d2Date20060701         = dt.Rows[0]["d2Date20060701"].ToString();
                    jzjs_xzdb.zxDate20010901b        = dt.Rows[0]["zxDate20010901b"].ToString();
                    jzjs_xzdb.zxDate2001090120040831 = dt.Rows[0]["zxDate2001090120040831"].ToString();
                    jzjs_xzdb.zxDate20040901         = dt.Rows[0]["zxDate20040901"].ToString();
                }
                return(jzjs_xzdb);
            }
            catch (Exception)
            {
                throw;
            }
        }
예제 #2
0
        /// <summary>
        /// 用JZJS对象插入或更新数据
        /// </summary>
        /// <param name="jzjs"></param>
        /// <returns>int 0为失败,1为插入成功</returns>
        public int Save_JZJS_XZDB(JZJS_XZDB jzjs)
        {
            string sqli = "insert into JZJS_XZDB(d1Date20000701b,d1Date2000070120050630,d1Date20050701,d2Date20011001b,d2Date2001100120060630,d2Date20060701,zxDate20010901b,zxDate2001090120040831,zxDate20040901) values(@d1Date20000701b,@d1Date2000070120050630,@d1Date20050701,@d2Date20011001b,@d2Date2001100120060630,@d2Date20060701,@zxDate20010901b,@zxDate2001090120040831,@zxDate20040901)";

            SqlParameter[] sqr =
            {
                new SqlParameter("@d1Date20000701b",        jzjs.d1Date20000701b),
                new SqlParameter("@d1Date2000070120050630", jzjs.d1Date2000070120050630),
                new SqlParameter("@d1Date20050701",         jzjs.d1Date20050701),
                new SqlParameter("@d2Date20011001b",        jzjs.d2Date20011001b),
                new SqlParameter("@d2Date2001100120060630", jzjs.d2Date2001100120060630),
                new SqlParameter("@d2Date20060701",         jzjs.d2Date20060701),
                new SqlParameter("@zxDate20010901b",        jzjs.zxDate20010901b),
                new SqlParameter("@zxDate2001090120040831", jzjs.zxDate2001090120040831),
                new SqlParameter("@zxDate20040901",         jzjs.zxDate20040901)
            };
            try
            {
                if (Have_GB("JZJS_XZDB"))
                {
                    string sql = "delete from JZJS_XZDB";
                    DBHelperSQL.Execute(sql);
                    if (DBHelperSQL.Execute(sqli, sqr) > 0)
                    {
                        return(1);
                    }
                    else
                    {
                        return(0);
                    }
                }
                else
                {
                    if (DBHelperSQL.Execute(sqli, sqr) > 0)
                    {
                        return(1);
                    }
                    else
                    {
                        return(0);
                    }
                }
            }
            catch (Exception)
            {
                throw;
            }
        }