コード例 #1
0
        public MaterialRecordWindow(WaysToOpenForm.WaysToOpen waysToOpen, string vendorCode = "")
        {
            material = new Material();
            InitializeComponent();
            way              = waysToOpen;
            connection       = new MySqlConnection(connectionString);
            vendorCodeRecord = vendorCode;

            // Заполнение шапки, полей
            Title = FormLoader.setNewTitle(way, Title);

            FillComboBoxes();

            if (vendorCodeRecord != "")
            {
                material          = new Material(vendorCodeRecord, connection);
                Border.Visibility = (material.photo != null) ? Visibility.Hidden : Visibility.Visible;
                FillFields();
            }
        }
コード例 #2
0
        public CustomersRecordWindow(WaysToOpenForm.WaysToOpen waysToOpen, int id = -1)
        {
            customer = new Customer();
            InitializeComponent();
            way        = waysToOpen;
            connection = new MySqlConnection(connectionString);
            idRecord   = id;

            // Заполнение шапки, полей даты
            Title = FormLoader.setNewTitle(way, Title);
            datePickerBirthday.Text = DateTime.Now.ToLongDateString();

            FillComboBoxes();

            if (idRecord != -1)
            {
                customer          = new Customer(idRecord, connection);
                Border.Visibility = (customer.photo != null) ? Visibility.Hidden : Visibility.Visible;
                FillFields();
            }
        }
コード例 #3
0
        public OrderRecordWindow(WaysToOpenForm.WaysToOpen waysToOpen, int id = -1)
        {
            order = new Order();
            InitializeComponent();
            way        = waysToOpen;
            connection = new MySqlConnection(connectionString);
            idRecord   = id;

            // При создании они не могут накинуть сразу и список изделий в заказ
            buttonListProducts.Visibility = (way == WaysToOpenForm.WaysToOpen.create) ? Visibility.Hidden : Visibility.Visible;

            // Заполнение шапки, полей даты
            Title = FormLoader.setNewTitle(way, Title);
            datePickerDateOfDelievery.Text = DateTime.Now.ToLongDateString();
            datePickerDateOfOrder.Text     = DateTime.Now.ToLongDateString();

            FillComboBoxes();

            if (idRecord != -1)
            {
                order = new Order(idRecord, connection);
                FillFields();
            }
        }