SoFunction
Updated on 2025-03-06

Small example of winfrom implementing transaction control at the business layer


try
    {
 using (TransactionScope tr = new TransactionScope())
 {
     int i = (customer);
     int j = (homestatus);
     if ((i * j) > 0)
     {
("Record insertion successfully!", "Message", , );
  Empty();
  ();
     }
     else
     {
("Record insertion failed! Contact the administrator!", "Message", , );
  Empty();
     }
     ();
 }

    }
    catch(Exception err)
    {
("Record insertion failed" +(), "Message", , );
    }