示例#1
0
 private void MoveContainer(IGenericContainer moveContainer,
                            IGenericContainer toContainer, int userId)
 {
     // Moves containers into target container. If tocontainer is null
     // the moveContainers is moved out from currect location
     try
     {
         if (toContainer.GetContainerType() == ContainerType.Uncontained)
         {
             toContainer = null;
         }
         // Move the containers.
         ChiasmaDepData.BeginTransaction();
         GenericContainerManager.MoveGenericContainer(moveContainer, toContainer, userId);
         ChiasmaDepData.CommitTransaction();
     }
     catch
     {
         ChiasmaDepData.RollbackTransaction();
         throw;
     }
 }
示例#2
0
        private bool SetAuthorityMappingForBarcode(string userBarcode)
        {
            if (!UserManager.IsUserBarcode(userBarcode))
            {
                MessageBox.Show("This barcode could not be linked to a Chiasma user!", "Login failure", MessageBoxButtons.OK,
                                MessageBoxIcon.Error);
                return(false);
            }
            try
            {
                ChiasmaDepData.BeginTransaction();
                UserManager.SetAuthorityMappingFromBarcode(userBarcode);
                ChiasmaDepData.CommitTransaction();
            }
            catch (System.Exception ex)
            {
                ChiasmaDepData.RollbackTransaction();
                HandleError("Could not logon to database", ex);
            }

            return(true);
        }