Ejemplo n.º 1
0
 /// <summary>
 /// 编辑栏目
 /// </summary>
 /// <param name="columninfo"></param>
 public static void EditColumn(ColumnInfo columninfo)
 {
     DatabaseProvider.GetInstance().EditColumn(columninfo);
 }
Ejemplo n.º 2
0
 /// <summary>
 /// 新建栏目
 /// </summary>
 /// <param name="columninfo"></param>
 public static void CreateColumn(ColumnInfo columninfo)
 {
     DatabaseProvider.GetInstance().CreateColumn(columninfo);
 }
Ejemplo n.º 3
0
        public void EditColumn(ColumnInfo columninfo)
        {
            DbParameter[] prams = 
		    {
			    DbHelper.MakeInParam("@columnname", DbType.String, 100,columninfo.Columnname),
			    DbHelper.MakeInParam("@columnid", DbType.Int32, 4,columninfo.Columnid),
			    DbHelper.MakeInParam("@parentid", DbType.Int32, 4,columninfo.Parentid)
		    };
            DbHelper.ExecuteNonQuery(CommandType.Text, "UPDATE wy_columns SET columnname=@columnname,parentid=@parentid WHERE columnid=@columnid", prams);
        }
Ejemplo n.º 4
0
 /// <summary>
 /// 将DataReader的Column转换为ColumnInfo泛型列表
 /// </summary>
 /// <param name="reader"></param>
 /// <returns></returns>
 private static ColumnInfo DataReader2ColumnInfo(IDataReader reader)
 {
     ColumnInfo columninfo = new ColumnInfo();
     columninfo.Columnid = Convert.ToInt32(reader["columnid"]);
     columninfo.Columnname= reader["columnname"].ToString();
     columninfo.Parentid = Convert.ToInt32(reader["parentid"]);
     return columninfo;
 }
Ejemplo n.º 5
0
        public void CreateColumn(ColumnInfo columninfo)
        {
            DbParameter[] prams = 
		    {
			    //DbHelper.MakeInParam("@columnid", DbType.Int32, 4,columninfo.Columnid),
			    DbHelper.MakeInParam("@columnname", DbType.String, 50,columninfo.Columnname),
			    DbHelper.MakeInParam("@parentid", DbType.Int32, 4,columninfo.Parentid)
		    };
            DbHelper.ExecuteNonQuery(CommandType.Text, "INSERT INTO wy_columns(columnname,parentid) VALUES(@columnname,@columnname)", prams);
        }