예제 #1
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;
 }
예제 #2
0
 protected void btnAddNewColumn_Click(object sender, EventArgs e)
 {
     ColumnInfo columninfo = new ColumnInfo();
     columninfo.Columnname = tbxColumnname.Text.Trim();
     columninfo.Parentid = Convert.ToInt32(dddlParentid.SelectedValue);
     Columns.CreateColumn(columninfo);
     lbMessage.Text = "��ӳɹ�!";
     RemoveColumnListCache();
     BindData();
 }
예제 #3
0
        public void EditColumn(ColumnInfo columninfo)
        {
            DbParameter[] prams = 
		    {
			    DbHelper.MakeInParam("?columnname", (DbType)MySqlDbType.String, 100,columninfo.Columnname),
			    DbHelper.MakeInParam("?columnid", (DbType)MySqlDbType.Int32, 4,columninfo.Columnid),
			    DbHelper.MakeInParam("?parentid", (DbType)MySqlDbType.Int32, 4,columninfo.Parentid)
		    };
            DbHelper.ExecuteNonQuery(CommandType.Text, "UPDATE wy_columns SET columnname=?columnname,parentid=?parentid WHERE columnid=?columnid", prams);
        }
예제 #4
0
        public void CreateColumn(ColumnInfo columninfo)
        {
            DbParameter[] prams = 
		    {
			    //DbHelper.MakeInParam("?columnid", (DbType)MySqlDbType.Int32, 4,columninfo.Columnid),
			    DbHelper.MakeInParam("?columnname", (DbType)MySqlDbType.String, 50,columninfo.Columnname),
			    DbHelper.MakeInParam("?parentid", (DbType)MySqlDbType.Int32, 4,columninfo.Parentid)
		    };
            DbHelper.ExecuteNonQuery(CommandType.Text, "INSERT INTO wy_columns(columnname,parentid) VALUES(?columnname,?columnname)", prams);
        }
예제 #5
0
 protected void gvColumnList_RowUpdating(object sender, GridViewUpdateEventArgs e)
 {
     ColumnInfo columninfo = new ColumnInfo();
     columninfo.Columnid = Convert.ToInt32(gvColumnList.Rows[e.RowIndex].Cells[0].Text);
     columninfo.Columnname = ((TextBox)(gvColumnList.Rows[e.RowIndex].Cells[1].Controls[0])).Text.Trim();
     columninfo.Parentid = Convert.ToInt32((((TextBox)gvColumnList.Rows[e.RowIndex].Cells[2].Controls[0])).Text.Trim());
     Columns.EditColumn(columninfo);
     lbMessage.Text = "���³ɹ�!";
     gvColumnList.EditIndex = -1;
     RemoveColumnListCache();
     BindData();
 }
예제 #6
0
파일: Columns.cs 프로젝트: wenysky/itcaweb
 /// <summary>
 /// �༭��Ŀ
 /// </summary>
 /// <param name="columninfo"></param>
 public static void EditColumn(ColumnInfo columninfo)
 {
     DatabaseProvider.GetInstance().EditColumn(columninfo);
 }
예제 #7
0
파일: Columns.cs 프로젝트: wenysky/itcaweb
 /// <summary>
 /// �½���Ŀ
 /// </summary>
 /// <param name="columninfo"></param>
 public static void CreateColumn(ColumnInfo columninfo)
 {
     DatabaseProvider.GetInstance().CreateColumn(columninfo);
 }