Ejemplo n.º 1
0
        private void Init()
        {
            if (SystemUser.GetInstance().UserType == SystemUser.UsersType.Client)
            {
                AddButton.Visibility    = Visibility.Hidden;
                UpdateButton.Visibility = Visibility.Hidden;
                DeleteButton.Visibility = Visibility.Hidden;
            }
            if (SystemUser.GetInstance().UserType == SystemUser.UsersType.Admin)
            {
                AddOrderButton.Visibility = Visibility.Hidden;
            }
            // Buffer initializes
            bufferData = BufferData.GetInstance();
            // list of tables initializes
            if (bufferData.Mode == BufferData.Modes.Structure)
            {
                StructureRadioButton1.IsChecked = true;
            }
            else
            {
                ViewRadioButton2.IsChecked = true;
            }

            tableListBox.ItemsSource = bufferData.TablesList;

            depotDbConnector = DepotDbConnector.GetInstance();

            string selectedTable = "state";

            SelectTable(selectedTable);
        }
        public static void Identification(string login, string password)
        {


            SystemUser user = SystemUser.GetInstance();
            //user.UserType = SystemUser.UsersType.Admin;
            //user.UserType = SystemUser.UsersType.Client;
            user.UserType = FindUser(login, password);

            StockControlWindow scWindow = new StockControlWindow();
            scWindow.Show();
        }
Ejemplo n.º 3
0
        private BufferData()
        {
            UserType = SystemUser.GetInstance().UserType;
            Mode     = Modes.Structure;
            Rebuild();
            NameOfAttribDictinionary = new Dictionary <string, string>();
            InitListOfNameOfAttrib();

            DestinationTable      = new DestinationTable();
            FashionTable          = new FashionTable();
            IssuedMaterialsTable  = new IssuedMaterialsTable();
            IssuedViewTable       = new IssuedViewTable();
            ManufacturerTable     = new ManufacturerTable();
            MaterialTable         = new MaterialTable();
            MaterialTypeTable     = new MaterialTypeTable();
            MaterialViewTable     = new MaterialViewTable();
            OrdersTable           = new OrdersTable();
            OrdersViewTable       = new OrdersViewTable();
            ReceivedMaterialTable = new ReceivedMaterialTable();
            ReceivedViewTable     = new ReceivedViewTable();
            StateTable            = new StateTable();

            RelateDbTableNameWithClasses();
        }