Example #1
0
        public long UpdateMenu(TblMenuContent model)
        {
            long res = 0;
            // Declare new DataAccess object
            ManageMenuDa dataAccess = new ManageMenuDa();

            using (var transaction = new TransactionScope())
            {
                try
                {
                    res = dataAccess.UpdateMenu(model);

                    if (res <= 0)
                    {
                        transaction.Dispose();
                    }
                    transaction.Complete();
                }
                catch (Exception ex)
                {
                    throw new Exception(ex.Message, ex);
                }
                finally
                {
                    transaction.Dispose();
                }
            }
            return(res);
        }