示例#1
0
        public void insertOrder2(Warehouse_Management wh)
        {
            getConnection();
            string     sql = "insert into Orders(TransactionTypeID, SourceWarehouseID, DestinationWarehouseID,Date) values(2, @sourceid, @desid, @date)";
            SqlCommand cmd = new SqlCommand(sql, cnn);

            cmd.Parameters.AddWithValue("sourceid", wh.sourceid);
            cmd.Parameters.AddWithValue("desid", wh.destinationid);
            cmd.Parameters.AddWithValue("date", wh.date);
            cmd.ExecuteNonQuery();
            cnn.Close();
        }
示例#2
0
        internal string getPartnamByID(Warehouse_Management wh)
        {
            getConnection();
            string     sql = "select name from parts where id = @partid";
            SqlCommand cmd = new SqlCommand(sql, cnn);

            cmd.Parameters.AddWithValue("partid", wh.partid);
            SqlDataReader dr = cmd.ExecuteReader();

            while (dr.Read())
            {
                wh.partname = (string)dr["Name"];
            }
            cnn.Close();
            return(wh.partname);
        }
示例#3
0
        public string getSourceNameByID(Warehouse_Management wh)
        {
            getConnection();
            string     sql = "select name from Warehouses where id=@id";
            SqlCommand cmd = new SqlCommand(sql, cnn);

            cmd.Parameters.AddWithValue("id", wh.sourceid);
            SqlDataReader dr = cmd.ExecuteReader();

            while (dr.Read())
            {
                wh.source = (string)dr["Name"];
            }
            cnn.Close();
            return(wh.source);
        }