Backend.Objects.SaleItem ToSaleItem(Backend.Objects.Product product) { return(new Backend.Objects.SaleItem { Product = product, }); }
void Initialize() { user = Util.Data.GetUser(); store = Util.Data.GetStore(); product = ProductObject; //Get Task if (Task == Enums.Task.Get || Task == Enums.Task.Update) { GetProduct(); } else if (Task == Enums.Task.Create) { product = new Backend.Objects.Product { Supplier = new Backend.Objects.ProductSupplier(), Brand = new Backend.Objects.ProductBrand(), Type = new Backend.Objects.ProductType(), Tax = new Backend.Objects.Tax() }; txtCustomBarcode.Text = ServerUtil.RandomDigits(13); btnDelete.Visible = false; } sign_currency1.Text = sign_currency2.Text = store.CurrencySign; // Add DropDown Items SetDropDownItems(); Translate(); }
void GetProduct(Backend.Objects.Product product = null) { product = product ?? Product; //Get if (product is object && User is object && Store is object) { lblProductName.Text = product.Name; lblProductId.Text = product.Id; lblProductPrice.Text = string.Format("{0} {1}", Store.CurrencySign, product.RetailPrice.ToString()); lblProductBarcode.Text = product.Barcode; lblCurrentStock.Text = product.Stock.ToString(); // If is from Search Item then Get Supplier .. Since the couldn't be fetched in another query if (product.IsSearchItem) { product.Supplier = ProductSupplier.GetSupplier(product.Supplier.Id); product.Image = Backend.Database.Queries.Product.GetImage(product.ImageBlobId, product.Name, product.Color); //Update Product = product; } imgProductImage.Image = product.Image; lblProductSupplier.Text = product.Supplier.Name; lblProductSupplyPrice.Text = product.SupplyPrice.ToString(); lblProductPrice.Text = product.RetailPrice.ToString(); } else { Alert.Show("Error", $"Something wrong occured", Alert.AlertType.Error); } }
void AddProductToCheckout(Backend.Objects.Product product) { // Increment to 1 Since OnClick adds 1 decimal quantity = 1; // Get Balance Value if Required else add 1 if (product.IsBalanceRequired) { quantity = GetBalanceValue(); } /** Add Product To Checkout only if it doesn't contains it else, update Quantity * */ foreach (ProductCheckout productCheckout in CheckoutGrid.Controls) { if (productCheckout.Item.Product.Id == product.Id) { productCheckout.Item.Quantity += quantity; //Update productCheckout.OnQuantityUpdated(); return; } } var saleItem = ToSaleItem(product); saleItem.Quantity += quantity; // Add a new Item to Checkout AddProductToCheckoutGrid(saleItem); // Update UpdateCheckout(); }
Backend.Objects.DiscountProduct ToProductDiscount(Backend.Objects.Product product) { return(new Backend.Objects.DiscountProduct { ProductId = product.Id, DiscountId = discount.Id, }); }
public void OnAddProduct(object sender, EventArgs e) { var product = (Backend.Objects.Product)sender; Product = product; GetProduct(product); // Render Product in Cards RenderCards(true); }
void Get(Backend.Objects.Product product) { lblProductName.Text = product.Name; lblProductBarcode.Text = product.Barcode; lblProductQuantity.Text = lblProductQuantity_Card.Text = Item.Quantity.ToString(); lblProductPrice.Text = lblProductPrice_Sub.Text = string.Format("{0} {1}", Currency, ToRoundedString(product.Price)); imgProductImage.Image = product.Image; lblDiscountPrice.Visible = product.IsDiscounted; Indicator.BackColor = cardProductQuantity.BackColor = cardProductQuantity.color = lblShowProductDetails.ForeColor = product.Color; }
void AddProductToGrid(Backend.Objects.Product product) { //Fill Grid [ InventoryGrid ] With Rows InventoryReportModel inventoryReportModel = new InventoryReportModel { Product = product, Currency = Store.CurrencySign, }; //Add To Grid InventoryGrid.Controls.Add(inventoryReportModel); }
void AddTopProductToGrid(Backend.Objects.Product product, int medalIndex) { //Fill Grid [ TopSoldProductsGrid ] With Rows TopSoldProductModel productModel = new TopSoldProductModel { Product = product, Currency = Currency, MedalIndex = medalIndex, }; //Add To Grid TopSoldProductsGrid.Controls.Add(productModel); }
void AddProductToGrid(Backend.Objects.Product product) { //Fill Grid [ ProductsGrid ] With Rows ProductModel productModel = new ProductModel { OnDelete = OnDeleteProduct, Product = product, User = User, Store = Store, }; //Add To Grid ProductsGrid.Controls.Add(productModel); }
void AddProductToGrid(Backend.Objects.Product product) { //Fill Grid [ ProductsGrid ] With Rows DiscountProductModel productModel = new DiscountProductModel { Product = product, Currency = Store.CurrencySign, DiscountValue = Discount.Value, DiscountType = Discount.Type, }; //Add To Grid ProductsGrid.Controls.Add(productModel); }
void AddItemToGrid(Backend.Objects.Product product) { //Fill Grid [ ItemsGrid ] With Rows ProductItemModel productItemModel = new ProductItemModel { OnAdd = OnAddItem, Product = product, User = User, Store = Store, IsSearchItem = true, }; //Add To Grid ItemsGrid.Controls.Add(productItemModel); }
void AddProductToGrid(Backend.Objects.Product product) { //Fill Grid [ ProductsGrid ] With Rows ProductSellModel productModel = new ProductSellModel { OnAdd = OnAddProductToCheckout, OnSelect = OnSelectProduct, Product = product, User = Sale.User, Store = Sale.Store, }; //Add To Grid ProductsGrid.Controls.Add(productModel); }
void UploadProductImage(Backend.Objects.Product product) { Backend.Objects.File file = new Backend.Objects.File { SystemFileName = LocalImagePath, Extension = ".jpg", ServerFolder = ServerConstants.ServerFolderPath, }; // Returns BlobId var response = QueryController.Blob.Create(file); var _file = (Backend.Objects.File)response.Data; // Update ImageBlobId QueryController.Products.Product.UpdateImage(product, _file); product.Image = imgProductImage.Image; }
void AddProductToGrid(Backend.Objects.Product product) { //Fill Grid [ ItemsGrid ] With Rows ProductItemModel productItemModel = new ProductItemModel { //OnAdd = OnAddProduct, OnDelete = OnRemoveProduct, Product = product, User = User, Store = Store, CanDelete = true, }; //Add To Grid ProductDiscountsGrid.Controls.Add(productItemModel); }
public bool IsProductInCheckout(Backend.Objects.Product product) { foreach (ProductCheckout productCheckout in CheckoutGrid.Controls) { if (productCheckout.Item.Product.Id == product.Id) { return(true); } else { return(false); } } return(false); }