天天看點

自動生産程式代碼

資料庫方面的程式代碼,畫面和資料庫之間互相複制資料的代碼非常普遍。資料庫建立好了之後,可以使用工具程式生成這樣的代碼。

自動生産程式代碼

下面拷貝一點生成的代碼的樣子:

namespace THIS_PJ_LIB.Entity {

    public class A02card_time {

public System.Int32 record_id;//記錄的ID

public System.String user_id;//使用者id

    }

}

public static void ff給Entity指派(A02card_time ent, DataRow dr) {

ent.record_id = XLIB.Data.DbTools.ff_object2int(dr["record_id"]);

ent.user_id = XLIB.Data.DbTools.ff_object2string(dr["user_id"]);

}

public static void ff給DataRow指派(A02card_time ent, DataRow dr) {

dr["record_id"]=ent.record_id;

dr["user_id"]=ent.user_id;

}

在“Xtools工具箱”裡提供了從ACCESS,SQL-Server,Oracle,DB2等資料庫裡生産原代碼的工具。