public override void SetParam(DataTypeBase paramData) { switch (paramData.Type()) { case DataType.UserName: userName = (TypeUserName)paramData; break; default: break; } }
//挿入 public override void Regist(DataTable table, ParamList param) { //20130705から追加 string query = ""; switch (table) { case DataTable.Books: Console.WriteLine("this is Regist!!"); // DataTypeBase dtb = param.GetParam(DataType.BookName); TypeBookName tbn = (TypeBookName)param.GetParam(DataType.BookName); TypeAuthor ta = (TypeAuthor)param.GetParam(DataType.Author); // TypeBookName tbnn = (TypeBookName)dtb.Type(); // TypeBookName tbn = new TypeBookName("opengl"); String s1 = tbn.BookName(); String s2 = ta.Author();; //Console.WriteLine(s); query = "insert into books (book_name, author) values('" + s1 + "', '" + s2 + "')"; break; case DataTable.Category: break; case DataTable.Rental: break; case DataTable.User: TypeUserName tun = (TypeUserName)param.GetParam(DataType.UserName); //tun.UserName(); query = "insert into users (user_name) values('" + tun.UserName() + "')"; break; default: break; } db.QueryInsert(query); }