Exemple #1
0
        public Models.Vendor Update(int id, Models.Vendor entity, string userName)
        {
            try
            {
                var old = RestfulVendor.Read(id);

                if (!VendorAccessControl.Pass(RestfulAction.Update, old, userName))
                {
                    throw new NoAccessException("No Access");
                }

                entity.Title   = old.Title;
                entity.Creator = userName;
                entity.Created = old.Created;
                entity.Updated = DateTime.Now;

                return(RestfulVendor.Update(id, entity));
            }
            catch
            {
                throw;
            }
        }