예제 #1
0
 private void RadioButton_Click(object sender, RoutedEventArgs e)
 {
     if (grdProducts.View.FocusedRow != null)
     {
         SAPProduct = grdProducts.GetFocusedRow() as Product;
     }
 }
예제 #2
0
        public EditProductMultiples(Product p)
        {
            InitializeComponent();

            manager = EditProductMultiplesManager.Instance;
            manager.EditEntity = p;

            TableViewEventHandlers<Multiple> eventHandler = new TableViewEventHandlers<Multiple>(grdMultiples, manager);
            eventHandler.AssignEvents();

            Loaded += new RoutedEventHandler(EditProductMultiples_Loaded);
        }
예제 #3
0
        public MergeProduct(Product p)
        {
            InitializeComponent();

            dummyProduct = p;

            txtDescription.Text = p.Description;
            txtMaterialCode.Text = p.MaterialCode;

            this.DataContext = ProductManager.Instance.GetAll().Where(pp => pp.Manual == false);
            cboDivisions.ItemsSource = DivisionManager.Instance.GetAll();
        }
예제 #4
0
파일: TestBase.cs 프로젝트: ddksaku/loreal
        protected ProductReceived CreateProductReceived(Product product, int month, int year, int quantity)
        {
            ProductReceived pr = new ProductReceived();
            pr.ID = Guid.NewGuid();
            pr.Product = product;
            pr.Month = month;
            pr.Year = year;
            pr.Quantity = quantity;

            return pr;
        }
예제 #5
0
파일: TestBase.cs 프로젝트: ddksaku/loreal
        protected AnimationProduct CreateAnimationProduct(Product product, Division division, Animation animation, int normalMultiple, int warehouseMultiple, BrandAxe brandAxe, Signature signature)
        {
            AnimationProduct animationProduct = new AnimationProduct();
            animationProduct.ID = Guid.NewGuid();
            animationProduct.Animation = animation;
            animationProduct.ItemType = CreateItemType(division);
            animationProduct.ItemGroup = CreateItemGroup(division);
            animationProduct.Product = product;
            animationProduct.Signature = signature;
            animationProduct.BrandAxe = brandAxe;
            animationProduct.Multiple = CreateMultiple(animationProduct.Product, normalMultiple);
            animationProduct.Multiple1 = CreateMultiple(animationProduct.Product, warehouseMultiple);
            animationProduct.OnCAS = true;
            animationProduct.ConfirmedMADMonth = DateTime.Now;
            animationProduct.StockRisk = true;
            animationProduct.DeliveryRisk = true;
            animationProduct.SortOrder = 1;

            return animationProduct;
        }
예제 #6
0
파일: TestBase.cs 프로젝트: ddksaku/loreal
        protected Multiple CreateMultiple(Product product, int multipleValue)
        {
            Multiple multiple = new Multiple();
            multiple.ID = Guid.NewGuid();
            multiple.Product = product;
            multiple.Value = multipleValue;
            multiple.Deleted = false;
            multiple.Manual = false;

            return multiple;
        }
예제 #7
0
파일: TestBase.cs 프로젝트: ddksaku/loreal
        protected Product CreateProduct(Division division, string materialCode)
        {
            Product product = new Product();
            product.ID = Guid.NewGuid();
            product.Division = division;
            product.MaterialCode = materialCode;
            product.Description = "Product Description";
            product.InternationalCode = "International 12345";
            product.EAN = "123456789";
            product.Status = "Active";
            product.Manual = false;
            product.ProcurementType = "Procurement type";
            product.CIV = 999;
            product.Stock = 100;
            product.StockLessPipe = 50;
            product.InTransit = 50;

            return product;

        }
예제 #8
0
        private void btnMerge_Click(object sender, RoutedEventArgs e)
        {
            if (SAPProduct == null)
            {
                MessageBox.Show(SystemMessagesManager.Instance.GetMessage("MergeProductSelectProduct"));
                return;
            }

            if (SAPProduct.AnimationProducts.Any(ap=>ap.Animation != null && ap.Animation.IsActive) == true)
            {
                MessageBox.Show(SystemMessagesManager.Instance.GetMessage("MergeProductAttachedToLiveAnimation"));
                return;
            }

            try
            {
                dummyProduct.Manual = false;
                dummyProduct.MaterialCode = SAPProduct.MaterialCode;
                dummyProduct.Description = SAPProduct.Description;
                dummyProduct.InternationalCode = SAPProduct.InternationalCode;
                dummyProduct.EAN = SAPProduct.EAN;
                dummyProduct.Status = SAPProduct.Status;
                dummyProduct.ProcurementType = SAPProduct.ProcurementType;
                dummyProduct.CIV = SAPProduct.CIV;
                dummyProduct.Stock = SAPProduct.Stock;
                dummyProduct.StockLessPipe = SAPProduct.StockLessPipe;
                dummyProduct.InTransit = SAPProduct.InTransit;
                

                DbDataContext.GetInstance().up_mergeProducts(dummyProduct.ID, SAPProduct.ID);
                MultipleManager.Instance.Refresh();
                ProductManager manager = ProductManager.Instance;

                // insert
                manager.InsertOrUpdate(dummyProduct);

                // delete
                removedSAPProduct = SAPProduct;
                manager.Delete(SAPProduct);

                MessageBox.Show(SystemMessagesManager.Instance.GetMessage("MergeProductMerged"), "Merge Product");

                btnClose.RaiseEvent(new RoutedEventArgs(Button.ClickEvent));
            }
            catch (Exception exc)
            {
                removedSAPProduct = null;
                //MessageBox.Show("An error occured when replacing the dummy store with a SAP store: " + LorealOptimiseShared.Utility.GetExceptionsMessages(exc));
                MessageBox.Show(SystemMessagesManager.Instance.GetMessage("MergeProductException", LorealOptimiseShared.Utility.GetExceptionsMessages(exc)));
            }
        }
예제 #9
0
        private void SaveAndNew()
        {
            Save();

            newProduct = new Product();
            this.NormalMultiple = 0;
            this.WarehouseMultiple = 0;
            this.txtCIV.Text = "";
            this.txtEAN.Text = "";
            this.txtInternationalCode.Text = "";
            
            this.DataContext = null;
            this.DataContext = this;
        }