public static void AddProductCheck(XElement element, decimal qty) { CassieService.OpenProductsCheck(); if (ClassProMode.ModePro) { element = ClassProMode.Replace(new[] { element }).First(); } var product = ProductType.FromXElement(element); product = RepositoryProduct.Products.FirstOrDefault(p => p.CustomerId == product.CustomerId); if (product.Balance) { if (GetBallance(product) == null) { var button = new Button { ToolTip = "ShowBallance" }; FunctionsService.Click(button, product); } else { AddProductCheck(product, product.Qty); } } else { AddProductCheck(product, qty); } }
private static XElement XelementCopy(XElement xe) { var x = new XDocument(); x.Add(new XElement("rec")); var p = ProductType.FromXElement(xe); x.GetXElement("rec").Add( new XElement("ii", p.Ii), new XElement("CustomerId", p.CustomerId), new XElement("Name", p.Name.ToUpper()), new XElement("Desc", p.Desc), new XElement("price", p.Price), new XElement("priceGros", p.PriceGros), new XElement("tva", p.Tva), new XElement("qty", p.Qty), new XElement("CodeBare", p.CodeBare), new XElement("balance", p.Balance), new XElement("contenance", p.Contenance), new XElement("uniteContenance", p.UniteContenance), new XElement("tare", p.Tare), new XElement("date", p.Date ?? DateTime.Now), new XElement("cusumerIdRealStock", p.CusumerIdRealStock), new XElement("cusumerIdSubGroup", p.CusumerIdSubGroup), new XElement("ProductsWeb_CustomerId", p.ProductsWebCustomerId), new XElement("grp", p.Grp), new XElement("sgrp", p.Sgrp)); return(x.Element("rec")); }
private void DataGrid1Selected(object sender, RoutedEventArgs e) { var selected = (XElement)dataGrid1.SelectedItem; if (selected != null) { LoadFromWindow(ProductType.FromXElement(selected)); } }