Ejemplo n.º 1
0
        private void SecurityXtraForm_Load(object sender, EventArgs e)
        {
            m_Users           = new UsersBLL();
            m_UserPermissions = new UserPermissionsBLL();

            CheckPermissions();

            usersListBoxControl.ValueMember   = "strUserName";
            usersListBoxControl.DisplayMember = "strUserName";
            BindUsersListBox();

            permissionIDGridColumn.FieldName     = "UserPermissionID";
            permissionLevelGridColumn.FieldName  = "PermissionLevel";
            permissionObjectGridColumn.FieldName = "PermissionObject";
            userNaemGridColumn.FieldName         = "UserName";

            passwordTextEdit.Properties.ReadOnly   = true;
            confirmTextEdit.Properties.ReadOnly    = true;
            LPNPrinterTextEdit.Properties.ReadOnly = true;
            locationLookUpEdit.Properties.ReadOnly = true;
            resetSimpleButton.Enabled   = false;
            usersListBoxControl.Enabled = true;
            userPermissionsGridView.OptionsBehavior.Editable = false;
            customersGridView.OptionsBehavior.Editable       = false;

            m_CustomersUOW = new UnitOfWork(MyDataLayers.SPGDataLayer);
        }
Ejemplo n.º 2
0
        private void CustomersXtraForm_Load(object sender, EventArgs e)
        {
            Cursor             = Cursors.WaitCursor;
            m_Customer         = new CustomersBLL();
            m_CustomersItems   = new ItemsBLL();
            m_Receiving        = new ReceivingsBLL();
            m_ReceivingDetails = new ReceivingDetailsBLL();
            m_Production       = new ProductionBLL();
            m_Shippings        = new ShippingsBLL();
            m_UserPermissions  = new UserPermissionsBLL();

            m_CustomersSession = new Session(MyDataLayers.SPGDataLayer);
            m_CustomersSession.TrackPropertiesModifications  = true;
            m_CustomersSession.OptimisticLockingReadBehavior = OptimisticLockingReadBehavior.MergeCollisionThrowException;

            CheckPermissions();

            for (int i = 0; i < components.Components.Count; i++)
            {
                if ((components.Components[i]) is XPView)
                {
                    ((XPView)components.Components[i]).Session = m_CustomersSession;
                }
                else if ((components.Components[i]) is XPCollection)
                {
                    ((XPCollection)components.Components[i]).Session = m_CustomersSession;
                }
            }

            BindCustomerSearch();
            customerShiftsXpCollection.Criteria = new BinaryOperator(CustomerShifts.Fields.Customer, null, BinaryOperatorType.Equal);
            customerPlantsXpCollection.Criteria = new BinaryOperator(CustomerPlants.Fields.Customer, null, BinaryOperatorType.Equal);

            Utilities.MakeFormReadOnly(generalXtraTabPage, true);
            addRelatedCustomerGroupControl.Enabled          = false;
            customerPlantsGridView.OptionsBehavior.Editable = false;
            customerShiftsGridView.OptionsBehavior.Editable = false;
            deleteGridColumn.Visible = false;
            deleteCustomerPlantGridColumn.Visible = false;
            deleteCustomerShiftGridColumn.Visible = false;
            customerSearchGridControl.Enabled     = true;

            Cursor = Cursors.Default;
        }