Esempio n. 1
0
        private async void ButtonBase_OnClick(object sender, RoutedEventArgs e)//add tovar
        {
            using (var uow = new AuctionUnitOfWork())
            {
                var category = uow.CategoryRepository.Get().FirstOrDefault();
                var content  = uow.ProductContentRepository.Get().FirstOrDefault();
                var user     = uow.UserRepository.Get(_userId);

                var product = new Product
                {
                    Name            = ProductTextBox.Text,
                    Category        = category,
                    CategoryId      = category.Id,
                    Owner           = user,
                    OwnerId         = user.Id,
                    ProductContents = new List <ProductContent> {
                        content
                    }
                };

                var nameArg     = new System.Data.SqlClient.SqlParameter("name", product.Name);
                var categoryArg = new System.Data.SqlClient.SqlParameter("category", category.Id);
                var userArg     = new System.Data.SqlClient.SqlParameter("user", user.Id);
                await uow.ProductRepository.Query(
                    "INSERT INTO dbo.Products (Name, CategoryId, OwnerId) VALUES(@name, @category, @user)",
                    nameArg, categoryArg, userArg);

                //_products.Add(product);

                ReloadProducts();

                ProductTextBox.Clear();
            }
        }
Esempio n. 2
0
    protected void LocationButton_Click(object sender, EventArgs e)
    {
        Valid = new Validation();
        string LocationID  = LocationTextBox.Text;
        string shipmentID  = Valid.GetShipmentID(BoxID);
        string OrderNumber = Valid.GetOrderNumber(BoxID);

        if (LocationID != "")
        {
            if (Valid.IsValidLocation(LocationID) == true)
            {
                if (Valid.LocationInZone(LocationID, CurrentZone) == true)
                {
                    if (Valid.IsLocationInOrder(LocationID, shipmentID, OrderNumber) == true)
                    {
                        if (Valid.IsThereAPriority1ReplenComingHere(LocationID) != true)
                        {
                            LocationTextBox.Text = LocationID.ToUpper();
                            LocationInputGroup.Attributes["class"] = "form-group has-success";
                            ProductTextBox.Focus();
                            PickingUpdatePanel.Update();
                        }
                        else
                        {
                            LocationTextBox.Text = "";
                            LocationTextBox.Attributes["placeholder"] = "No Inventory Can't Pick";
                            LocationInputGroup.Attributes["class"]    = "form-group has-error";
                        }
                    }
                    else
                    {
                        LocationTextBox.Text = "";
                        LocationTextBox.Attributes["placeholder"] = "Not In this Order";
                        LocationInputGroup.Attributes["class"]    = "form-group has-error";
                    }
                }
                else
                {
                    LocationTextBox.Text = "";
                    LocationTextBox.Attributes["placeholder"] = "Not In Your Zone";
                    LocationInputGroup.Attributes["class"]    = "form-group has-error";
                }
            }
            else
            {
                LocationTextBox.Text = "";
                LocationTextBox.Attributes["placeholder"] = "Not A Valid Location";
                LocationInputGroup.Attributes["class"]    = "form-group has-error";
            }
        }
        else
        {
            LocationTextBox.Text = "";
            LocationTextBox.Attributes["placeholder"] = "Enter Location";
            LocationInputGroup.Attributes["class"]    = "form-group has-error";
        }
    }
Esempio n. 3
0
 private void Add(object sender, RoutedEventArgs e)
 {
     Products.Add(new product {
         Producted = ProductTextBox.Text, Description = DescriptionTextBox.Text, Image = ((Icon)ImageComboBox.SelectedValue).Icons
     });
     ProductTextBox.Text         = "";
     DescriptionTextBox.Text     = "";
     ImageComboBox.SelectedIndex = -1;
     ProductTextBox.Focus(FocusState.Programmatic);
 }
Esempio n. 4
0
        private void NewContactButton_Click(object sender, RoutedEventArgs e)
        {
            string avatar = ((Icon)AvatarComboBox.SelectedValue).IconPath;

            Contacts.Add(new Contact {
                Product = ProductTextBox.Text, Descripion = DescripionTextBox.Text, AvatarPath = avatar
            });
            ProductTextBox.Text          = "";
            DescripionTextBox.Text       = "";
            AvatarComboBox.SelectedIndex = -1;
            ProductTextBox.Focus(FocusState.Programmatic);
            DescripionTextBox.Focus(FocusState.Programmatic);
        }
Esempio n. 5
0
        private void NewProductButton_Click(object sender, RoutedEventArgs e)
        {
            string imgs = ((Images)ImageComboBox.SelectedValue).ImgPath;

            Productss.Add(new Products {
                Product = ProductTextBox.Text, Description = DescriptionTextBox.Text, ImagePath = imgs
            });

            ProductTextBox.Text         = "";
            DescriptionTextBox.Text     = "";
            ImageComboBox.SelectedIndex = -1;

            ProductTextBox.Focus(FocusState.Programmatic);
        }
        private void NewProductButton_Click(object sender, RoutedEventArgs e)
        {
            string image = ((Models.Image)ImageComboBox.SelectedValue).ProductPath;

            Products.Add(new Product
            {
                ProductName = ProductTextBox.Text,
                Description = DescriptionTextBox.Text,
                Image       = image
            });

            ProductTextBox.Text         = "";
            DescriptionTextBox.Text     = "";
            ImageComboBox.SelectedIndex = -1;

            ProductTextBox.Focus(FocusState.Programmatic);
        }
 private void ResetForm()
 {
     ProductTextBox.Clear();
     ConditionTextBox.Clear();
     CostTextBox.Clear();
     PlatFormTextBox.Clear();
     OsTextBox.Clear();
     ManuFacTextBox.Clear();
     ModelTextBox.Clear();
     MemoryTextBox.Clear();
     LCDTextBox.Clear();
     HDDTextBox.Clear();
     CPUBTextBox.Clear();
     CPUNumTextBox.Clear();
     GPUTTextBox.Clear();
     CPUTTextBox.Clear();
     CPUspeedTextBox.Clear();
     WebCamTextBox.Clear();
 }
        /// <summary>
        /// Обработка изменения выбраных значений RadioButton'ов, для скрытия/отображения ComboBox'ов
        /// </summary>
        private void RadioButton_OnChecked(object senderIsRadioButton, RoutedEventArgs e)
        {
            const int              defaultComboBoxIndex  = 0;
            const int              disabledComboBoxIndex = -1;
            const string           periodGroup           = "PeriodRadioButtonGroup";
            const string           workGuildGroup        = "WorkGuildRadioButtonGroup";
            const string           productGroup          = "ProductRadioButtonGroup";
            const StringComparison comparisonIgnoreCase  = StringComparison.OrdinalIgnoreCase;
            var radioButton = senderIsRadioButton as RadioButton;

            if (radioButton == null)
            {
                return;
            }

            var groupName = radioButton.GroupName;

            if (string.Equals(workGuildGroup, groupName, comparisonIgnoreCase))
            {
                if (string.Equals(radioButton.Name, WorkguildAllRadioButton.Name, comparisonIgnoreCase))
                {
                    WorkguildSpecifiedComboBox.SelectedIndex = disabledComboBoxIndex;
                    WorkguildSpecifiedComboBox.IsEnabled     = false;
                }

                if (string.Equals(radioButton.Name, WorkguildSpecifiedRadioButton.Name, comparisonIgnoreCase))
                {
                    WorkguildSpecifiedComboBox.IsEnabled     = true;
                    WorkguildSpecifiedComboBox.SelectedIndex = defaultComboBoxIndex;
                }
            }

            // ReSharper restore InvertIf
            if (string.Equals(periodGroup, groupName, comparisonIgnoreCase))
            {
                if (string.Equals(radioButton.Name, MonthPeriodRadioButton.Name, comparisonIgnoreCase))
                {
                    DateWrapperGrid.Visibility       = Visibility.Visible;
                    DatePeriodWrapperGrid.Visibility = Visibility.Collapsed;
                    _isSelectedPeriod = "m";
                }

                if (string.Equals(radioButton.Name, YearPeriodRadioButton.Name, comparisonIgnoreCase))
                {
                    DateWrapperGrid.Visibility       = Visibility.Visible;
                    DatePeriodWrapperGrid.Visibility = Visibility.Collapsed;
                    _isSelectedPeriod = "y";
                }

                if (string.Equals(radioButton.Name, PeriodRadioButton.Name, comparisonIgnoreCase))
                {
                    DateWrapperGrid.Visibility       = Visibility.Collapsed;
                    DatePeriodWrapperGrid.Visibility = Visibility.Visible;
                    _isSelectedPeriod = "p";
                }
            }

            if (string.Equals(productGroup, groupName, comparisonIgnoreCase))
            {
                if (string.Equals(radioButton.Name, ProductAllRadioButton.Name, comparisonIgnoreCase))
                {
                    ProductTextBox.Clear();
                    ProductTextBox.IsEnabled      = false;
                    ProductWrapperGrid.Visibility = Visibility.Collapsed;
                }

                if (string.Equals(radioButton.Name, ProductSpecifiedRadioButton.Name, comparisonIgnoreCase))
                {
                    ProductTextBox.Clear();
                    ProductTextBox.IsEnabled = true;
                    ProductLabel.Content     = "Укажите изделие :";
                    ProductWrapperGrid.ColumnDefinitions[0].Width = new GridLength(140);
                    ProductWrapperGrid.ColumnDefinitions[1].Width = new GridLength(420);
                    ProductWrapperGrid.Visibility = Visibility.Visible;
                }
            }
        }