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; } }
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); }