예제 #1
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Tunnel.Model.Tunnel_flowclass GetModel(long fc_id)
        {
            SqlParameter[] parameters =
            {
                new SqlParameter("@fc_id", SqlDbType.BigInt)
            };
            parameters[0].Value = fc_id;

            Tunnel.Model.Tunnel_flowclass model = new Tunnel.Model.Tunnel_flowclass();
            DataSet ds = DbHelperSQL.RunProcedure("Tunnel_flowclass_GetModel", parameters, "ds");

            if (ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[0].Rows[0]["fc_id"].ToString() != "")
                {
                    model.fc_id = long.Parse(ds.Tables[0].Rows[0]["fc_id"].ToString());
                }
                model.fc_name  = ds.Tables[0].Rows[0]["fc_name"].ToString();
                model.Fc_desin = ds.Tables[0].Rows[0]["fc_desin"].ToString();
                return(model);
            }
            else
            {
                return(null);
            }
        }
예제 #2
0
        /// <summary>
        ///  更新一条数据
        /// </summary>
        public void Update(Tunnel.Model.Tunnel_flowclass model)
        {
            int rowsAffected;

            SqlParameter[] parameters =
            {
                new SqlParameter("@fc_id",    SqlDbType.BigInt,    8),
                new SqlParameter("@fc_name",  SqlDbType.VarChar, 100),
                new SqlParameter("@fc_desin", SqlDbType.VarChar, 500)
            };
            parameters[0].Value = model.fc_id;
            parameters[1].Value = model.fc_name;
            parameters[2].Value = model.Fc_desin;

            DbHelperSQL.RunProcedure("Tunnel_flowclass_Update", parameters, out rowsAffected);
        }
예제 #3
0
        /// <summary>
        ///  增加一条数据
        /// </summary>
        public int Add(Tunnel.Model.Tunnel_flowclass model)
        {
            int rowsAffected;

            SqlParameter[] parameters =
            {
                new SqlParameter("@fc_id",    SqlDbType.BigInt,    8),
                new SqlParameter("@fc_name",  SqlDbType.VarChar, 100),
                new SqlParameter("@fc_desin", SqlDbType.VarChar, 500)
            };
            parameters[0].Direction = ParameterDirection.Output;
            parameters[1].Value     = model.fc_name;
            parameters[2].Value     = model.Fc_desin;

            DbHelperSQL.RunProcedure("Tunnel_flowclass_ADD", parameters, out rowsAffected);
            return(int.Parse(parameters[0].Value.ToString()));
        }