It looks you are looking for a function to search in a table in database, if that value found, you insert a record on Workorders table, and update a column in the table Assets. Am I right?
i can finish it right now, according to your specs, please feel free to contact me, and I am also native Arabic speaker.