Esempio n. 1
0
        private void Init()
        {
            DateTime dt   = DateTime.Now;
            string   line = dt.ToString();

            Log(line + " INIT");

            SqlSpCommand init_cmd = NewSqlSpCommand();

            init_cmd.ExecuteNonQuery("DROP TABLE custmast");
            init_cmd.ExecuteNonQuery("DROP TABLE custordr");
            init_cmd.ExecuteNonQuery("DROP TABLE ordritem");
            init_cmd.ExecuteNonQuery("DROP TABLE itemmast");
        }
Esempio n. 2
0
        private void Delete_Records(String tablename)
        {
            DateTime dt   = DateTime.Now;
            string   line = dt.ToString();

            Log(line + "\tDelete Records...");

            SqlSpCommand delete_cmd = NewSqlSpCommand();

            delete_cmd.ExecuteNonQuery("DELETE FROM " + tablename);
        }
Esempio n. 3
0
        private void Create_ItemMaster_Table()
        {
            DateTime dt   = DateTime.Now;
            string   line = dt.ToString();

            Log(line + "\ttable Item Master");

            SqlSpCommand create_cmd = NewSqlSpCommand();

            create_cmd.ExecuteNonQuery(
                "CREATE TABLE itemmast (" +
                "im_itemwght INTEGER, " +
                "im_itempric MONEY, " +
                "im_itemnumb CHAR(5), " +
                "im_itemdesc VARCHAR(47))"
                );

            create_cmd.ExecuteNonQuery(
                "CREATE UNIQUE INDEX im_itemnumb_idx ON itemmast (im_itemnumb)"
                );
        }
Esempio n. 4
0
        private void Create_OrderMaster_Table()
        {
            DateTime dt   = DateTime.Now;
            string   line = dt.ToString();

            Log(line + "\ttable Order Master");
            SqlSpCommand create_cmd = NewSqlSpCommand();

            create_cmd.ExecuteNonQuery(
                "CREATE TABLE ordritem (" +
                "oi_sequnumb SMALLINT, " +
                "oi_quantity SMALLINT, " +
                "oi_ordrnumb CHAR(6), " +
                "oi_itemnumb CHAR(5))"
                );
            create_cmd.ExecuteNonQuery(
                "CREATE UNIQUE INDEX oi_ordrnumb_idx ON ordritem (oi_ordrnumb, oi_sequnumb)"
                );
            create_cmd.ExecuteNonQuery(
                "CREATE INDEX oi_itemnumb_idx ON ordritem (oi_itemnumb)"
                );
        }
Esempio n. 5
0
        private void Create_CustomerOrders_Table()
        {
            DateTime dt   = DateTime.Now;
            string   line = dt.ToString();

            Log(line + "\ttable CustomerOrders");

            SqlSpCommand create_cmd = NewSqlSpCommand();

            create_cmd.ExecuteNonQuery(
                "CREATE TABLE custordr (" +
                "co_ordrdate DATE, " +
                "co_promdate DATE, " +
                "co_ordrnumb CHAR(6), " +
                "co_custnumb CHAR(4)) "
                );
            create_cmd.ExecuteNonQuery(
                "CREATE UNIQUE INDEX co_ordrnumb_idx ON custordr (co_ordrnumb)"
                );
            create_cmd.ExecuteNonQuery(
                "CREATE INDEX co_custnumb_idx ON custordr (co_custnumb)"
                );
        }
Esempio n. 6
0
        private void Create_CustomerMaster_Table()
        {
            DateTime dt   = DateTime.Now;
            string   line = dt.ToString();

            Log(line + "\ttable Customer Master");

            SqlSpCommand create_cmd = NewSqlSpCommand();

            create_cmd.ExecuteNonQuery(
                "CREATE TABLE custmast (" +
                "cm_custnumb CHAR(4), " +
                "cm_custzipc CHAR(9), " +
                "cm_custstat CHAR(2), " +
                "cm_custrtng CHAR(1), " +
                "cm_custname VARCHAR(47), " +
                "cm_custaddr VARCHAR(47), " +
                "cm_custcity VARCHAR(47))"
                );

            create_cmd.ExecuteNonQuery(
                "CREATE UNIQUE INDEX cm_custnumb_idx ON custmast (cm_custnumb)"
                );
        }
Esempio n. 7
0
        private void Define()
        {
            DateTime dt   = DateTime.Now;
            string   line = dt.ToString();

            Log(line + " DEFINE");

            SqlSpCommand create_cmd = NewSqlSpCommand();

            create_cmd.ExecuteNonQuery("CREATE TABLE custmast (" +
                                       "cm_custnumb CHAR(4), " +
                                       "cm_custzipc CHAR(9), " +
                                       "cm_custstat CHAR(2), " +
                                       "cm_custrtng CHAR(1), " +
                                       "cm_custname VARCHAR(47), " +
                                       "cm_custaddr VARCHAR(47), " +
                                       "cm_custcity VARCHAR(47))");
        }