private async void frmProducts_Load(object sender, EventArgs e) { var request = new ProductSearchRequest() { Page = Page, ItemsPerPage = 4 }; var productList = await _service.Get <List <EToolService.Model.Models.Product> >(request); if (Page > 1 && productList.Count == 0) { Page--; return; } if (Page < 1) { Page = 1; return; } ClearPanel(); for (int i = productList.Count() - 1; i >= 0; i--) { var card = new ProductCard(productList[i]) { _ParentForm = this }; card.Show(); flowProductsPanel.Controls.Add(card); } flowProductsPanel.Show(); }
public ProductCard GetProductCardInfo(string serialNo, string mode, string userid, out string resultMessage) { resultMessage = string.Empty; ProductCard pcCard = null; try { ProcParam procPara = new ProcParam(5) { ProcedureName = "SCANNER_PACK_VER.GET_PC_INFO_PROCESS" }; procPara.AddParamRefCursor(0, "io_cursor"); procPara.AddParamInput(1, "strSERIAL_NO", serialNo); procPara.AddParamInput(2, "strPROCESS", mode); procPara.AddParamOutput(3, "resultmsg", OracleDbType.Varchar2, 255); procPara.AddParamInput(4, "strUser_id", userid); OraDataReader.Instance.OraReader = GlobalDB.Instance.DataAc.ExecuteDataReader(procPara); this.executionTime = GlobalDB.Instance.DataAc.ExecuteTime; if (OraDataReader.Instance.OraReader.HasRows) { while (OraDataReader.Instance.OraReader.Read()) { pcCard = new ProductCard(); pcCard.SERIAL_NO = OraDataReader.Instance.GetString("SERIAL_NO"); pcCard.PROD_SEQ_NO = OraDataReader.Instance.GetString("PROD_SEQ_NO"); pcCard.PRODUCT_NO = OraDataReader.Instance.GetString("PRODUCT_NO"); pcCard.PRODUCT_NAME = OraDataReader.Instance.GetString("PRODUCT_NAME"); pcCard.MTL_TYPE = OraDataReader.Instance.GetString("MTL_TYPE"); pcCard.JOB_NO = OraDataReader.Instance.GetString("JOB_NO"); pcCard.SHIFT = OraDataReader.Instance.GetString("SHIFT"); pcCard.LINE_NO = OraDataReader.Instance.GetInteger("LINE_NO"); pcCard.QTY = OraDataReader.Instance.GetInteger("QTY"); pcCard.BOX_SCANNED = OraDataReader.Instance.GetInteger("NO_OF_BOX"); pcCard.BOX_QTY = OraDataReader.Instance.GetInteger("TOT_BOX"); pcCard.UNIT_ID = OraDataReader.Instance.GetString("UNIT_ID"); } } else { OracleString resultDB = (OracleString)procPara.ReturnValue(3); if (!resultDB.IsNull) { resultMessage = resultDB.Value; } } // always call Close when done reading. OraDataReader.Instance.Close(); } catch (Exception ex) { throw ex; } return(pcCard); }
private void LoadProductCardComponent(IProduct product) { ProductCard productCard = (ProductCard)LoadControl("~/Components/Universal/ProductCard.ascx"); productCard.Product = product; ProductCardPlaceholder.Controls.Add(productCard); }
public ProductOrder(ProductCard product, int row) { Title = product.Product.Title; Row = row; Count = product.Count; Price = product.SoldPrice?.ToString("n0"); ImageName = product.Product.ImageName; }
public ProductCard Horizontal_GetUpdatePC_QCInfo(string serialNo, string qcStatus, string userid, out string resultMessage) { resultMessage = string.Empty; ProductCard pcCard = null; try { ProcParam procPara = new ProcParam(5) { ProcedureName = "SCANNER_PACK_HOZ.GET_UPD_PC_QC" }; procPara.AddParamRefCursor(0, "io_cursor"); procPara.AddParamInput(1, "strSERIAL_NO", serialNo); procPara.AddParamInput(2, "strQC_STATUS", qcStatus); procPara.AddParamOutput(3, "resultmsg", OracleDbType.Varchar2, 255); procPara.AddParamInput(4, "strUser_id", userid); OraDataReader.Instance.OraReader = GlobalDB.Instance.DataAc.ExecuteDataReader(procPara); this.executionTime = GlobalDB.Instance.DataAc.ExecuteTime; if (OraDataReader.Instance.OraReader.HasRows) { while (OraDataReader.Instance.OraReader.Read()) { pcCard = new ProductCard(); pcCard.JOB_NO = OraDataReader.Instance.GetString("JOB_NO"); pcCard.LINE_NO = OraDataReader.Instance.GetInteger("LINE_NO"); pcCard.JOB_LOT = OraDataReader.Instance.GetString("JOB_LOT"); pcCard.PROD_SEQ_NO = OraDataReader.Instance.GetString("PROD_SEQ_NO"); pcCard.PRODUCT_NO = OraDataReader.Instance.GetString("PRODUCT_NO"); pcCard.PRODUCT_NAME = OraDataReader.Instance.GetString("PRODUCT_NAME"); pcCard.MTL_TYPE = OraDataReader.Instance.GetString("MTL_TYPE"); pcCard.SERIAL_NO = OraDataReader.Instance.GetString("SERIAL_NO"); pcCard.QTY = OraDataReader.Instance.GetInteger("QTY"); pcCard.UNIT_ID = OraDataReader.Instance.GetString("UNIT_ID"); } } else { OracleString result = (OracleString)procPara.ReturnValue(3); if (!result.IsNull) { resultMessage = result.Value; } } // always call Close when done reading. OraDataReader.Instance.Close(); } catch (Exception ex) { throw ex; } return(pcCard); }
public async Task <bool> CreateOrUpdate(string userNameContext, Guid productId, int quantity) { if (productId == Guid.Empty) { throw new ArgumentNullException(nameof(productId)); } if (quantity < 0) { throw new ArgumentNullException(nameof(quantity)); } if (string.IsNullOrEmpty(userNameContext)) { throw new ArgumentNullException(nameof(userNameContext)); } var user = await _context.Users .FirstOrDefaultAsync(f => f.UserName == userNameContext.ToUpper()); if (user == null) { throw new ArgumentNullException(nameof(user)); } var basket = await _context.Baskets .FirstOrDefaultAsync(f => f.UserId == user.Id); if (basket == null) { throw new ArgumentNullException(nameof(user)); } var existedProductCard = await _context.ProductCards .Where(f => f.BasketId == basket.Id) .Include(f => f.Product.Category) .FirstOrDefaultAsync(f => f.ProductId == productId); if (existedProductCard == null) { var newProductCard = new ProductCard() { Quantity = quantity, ProductId = productId, BasketId = basket.Id }; return(await Add(newProductCard)); } else { existedProductCard.Quantity += quantity; var existedProductCardCore = _mapper.Map <Entities.ProductCard, Core.CoreModels.ProductCard>(existedProductCard); return(await Update(existedProductCardCore)); } }
public async Task <bool> Create(ProductCard productCard) { if (productCard == null) { throw new ArgumentNullException(nameof(productCard)); } return(await _productCardRepository.Add(productCard)); }
private void ExecuteAddCardButtonCommand(CardsSection section) { if (section != null) { var card = new ProductCard(); card.Title = "Card " + (section.Cards.Count + 1); section.Cards.Add(card); this.SelectedCard = card; } }
private void populateProducts() { productFlow.Controls.Clear(); foreach (Database.Product p in pquery) { VendorPOS.ProductCard productCard = new ProductCard(p, this); //publisher productCard.InvoiceAdded += this.OnInvoiceAdded; productFlow.Controls.Add(productCard); } }
public static string GetMaterial(this ProductCard product) { var material = string.Empty; switch (product.Material) { case Material.Chlopok: material = "Хлопок"; break; } return(material); }
public ActionResult ViewProducts(int selectedProductGroup, List <int> selectedBrands, List <int> selectedSubFeatures) { var products = new List <Product>(); if (selectedProductGroup == 0) { products = db.Products.Where(p => p.IsDeleted != true && p.ProductNotShow == false).Include(p => p.ProductMainFeatures).Include(p => p.ProductFeatureValues).ToList(); } else { products = db.Products.Where(p => p.ProductGroupId == selectedProductGroup && p.IsDeleted != true && p.ProductNotShow == false).Include(p => p.ProductMainFeatures).Include(p => p.ProductFeatureValues).ToList(); var childrenGroupIds = GetAllChildrenGroupIds(selectedProductGroup); foreach (var item in childrenGroupIds) { products.AddRange(db.Products.Where(p => p.ProductGroupId == item).Include(p => p.ProductMainFeatures).Include(p => p.ProductFeatureValues).ToList()); } } if (selectedBrands.Any() && selectedBrands.All(id => id != 0)) { var productFilteredByBrand = new List <Product>(); foreach (var brand in selectedBrands) { productFilteredByBrand.AddRange(products.Where(p => p.BrandId == brand)); } products = productFilteredByBrand; } if (selectedSubFeatures.Any() && selectedSubFeatures.All(id => id != 0)) { var productFilteredBySubFeature = new List <Product>(); foreach (var subFeature in selectedSubFeatures) { productFilteredBySubFeature.AddRange(products.Where(p => p.ProductFeatureValues.Any(pf => pf.SubFeatureId == subFeature) || p.ProductMainFeatures.Any(pf => pf.SubFeatureId == subFeature))); } products = productFilteredBySubFeature; } var vm = new List <ProductCard>(); foreach (var product in products) { var card = new ProductCard(); card.Id = product.Id; card.ProductName = product.ProductName; card.ProductImg = product.ProductImg; card.Price = product.ProductPrice; card.ProductDiscountPercent = product.ProductDiscountPercent; vm.Add(card); } return(PartialView(vm)); }
//Xóa giỏ hàng public ActionResult DeleteCart(int ProId) { List <ProductCard> lstCart = GetCard(); ProductCard c = lstCart.FirstOrDefault(n => n.iProID == ProId); //Xóa if (c != null) { lstCart.RemoveAll(n => n.iProID == ProId); } if (lstCart.Count == 0) { return(RedirectToAction("Index", "Home")); } return(RedirectToAction("ViewShoppingCard")); }
private void GetPrice(IWebElement product, ref ProductCard card) { var regularPrice = product.FindElement(By.ClassName("regular-price")); card.MainPrice = regularPrice.Text; card.MainPriceColor = regularPrice.GetCssValue("color"); card.MainPriceSize = regularPrice.GetCssValue("font-size"); card.MainPriceType = regularPrice.GetCssValue("text-decoration"); var salePrice = product.FindElement(By.ClassName("campaign-price")); card.SalePrice = salePrice.Text; card.SalePriceColor = salePrice.GetCssValue("color"); card.SalePriceSize = salePrice.GetCssValue("font-size"); card.SalePriceType = salePrice.TagName; }
public ProductCard Assembly_GetJobLotInfo(string jobNo, int lineNo, string userid) { ProductCard pcCard = null; try { ProcParam procPara = new ProcParam(4) { ProcedureName = "SCANNER_PACK_ASY.GET_JOB_LOT_INFO" }; procPara.AddParamRefCursor(0, "io_cursor"); procPara.AddParamInput(1, "strJOB_NO", jobNo); procPara.AddParamInput(2, "strLINE_NO", lineNo); procPara.AddParamInput(3, "strUserID", userid); OraDataReader.Instance.OraReader = GlobalDB.Instance.DataAc.ExecuteDataReader(procPara); this.executionTime = GlobalDB.Instance.DataAc.ExecuteTime; if (OraDataReader.Instance.OraReader.HasRows) { while (OraDataReader.Instance.OraReader.Read()) { pcCard = new ProductCard(); pcCard.JOB_NO = OraDataReader.Instance.GetString("JOB_NO"); pcCard.LINE_NO = OraDataReader.Instance.GetInteger("LINE_NO"); pcCard.JOB_LOT = OraDataReader.Instance.GetString("JOB_LOT"); pcCard.PROD_SEQ_NO = OraDataReader.Instance.GetString("PROD_SEQ_NO"); pcCard.PRODUCT_NO = OraDataReader.Instance.GetString("PRODUCT_NO"); pcCard.PRODUCT_NAME = OraDataReader.Instance.GetString("PRODUCT_NAME"); pcCard.MTL_TYPE = OraDataReader.Instance.GetString("MTL_TYPE"); pcCard.NG_QTY = OraDataReader.Instance.GetInteger("NG_QTY"); pcCard.UNIT_ID = OraDataReader.Instance.GetString("UNIT_ID"); } } // always call Close when done reading. OraDataReader.Instance.Close(); } catch (Exception ex) { throw ex; } return(pcCard); }
public ActionResult AddCard(int pid) // GET: ShoppingCard { List <ProductCard> lstCard = GetCard(); //session cart ProductCard c = lstCard.Where(n => n.iProID == pid).FirstOrDefault(); //Kiểm tra sp này đã có trong session[cart] chưa if (c == null) {//chưa có Thêm vào list cart { c = new ProductCard(pid); lstCard.Add(c); } else { lstCard[lstCard.IndexOf(c)].iQuantity += 1; } Session["Card"] = lstCard; return(Content("Gio hang (" + lstCard.Count + ")")); }
private float INCREASE_VALUE = 1; //確率上昇値 /// <summary> /// ボタンが押されたときの処理 /// </summary> /// <param name="starNum"></param> public void ButtonCommonFunc(int starNum) { int starNumber = starNum - 1;//配列に合わせるための-1 //会社情報の取得 CompanyInfomation company = CompanyInfomation.Instance; //選択中カードを取得 ProductCard currentCard = company.GetChosenCard(); if (currentCard == null) { return; } //カードレビューしたよ! currentCard.CardReviewedFunction(); //音を鳴らす AudioManager.Instance.PlaySE(1); }
public int Insert(ProductCard entity) { return(_connectionFactory.GetConnection.Query <int>(@" INSERT INTO [ProductCard]( [ProductId], [OrderId], [DealerId], [Price], [Count]) VALUES( @ProductId, @OrderId, @DealerId, @Price, @Count); SELECT SCOPE_IDENTITY();" , entity).FirstOrDefault()); }
public ProductCard GetJobLotInfo(string jobNo, int lineNo, string userid) { ProductCard pdCard = null; try { using (ProductCardNGBLL prodNGBll = new ProductCardNGBLL()) { pdCard = prodNGBll.Horizontal_GetJobLotInfo(jobNo, lineNo, userid); } } catch (Exception ex) { pdCard = null; throw ex; } return(pdCard); }
public ProductCard GetUpdatePCLoading(string loadNo, string serialNo, string userid, out string resultMsg) { resultMsg = string.Empty; ProductCard pdCard = null; try { using (ProductCardLOADBLL prdLoadingBll = new ProductCardLOADBLL()) { pdCard = prdLoadingBll.GetUpdatePCLoading(loadNo, serialNo, userid, out resultMsg); } } catch (Exception ex) { pdCard = null; throw ex; } return(pdCard); }
public ProductCard GetProductCardInfo(string serialNo, string processMode, string userid, out string resultMsg) //, out string resultMsg { resultMsg = string.Empty; ProductCard pdCard = null; try { using (ProductCardBLL pdBll = new ProductCardBLL()) { pdCard = pdBll.Horizontal_GetProductCardInfo(serialNo, processMode, userid, out resultMsg); } } catch (Exception ex) { pdCard = null; throw ex; } return(pdCard); }
public ProductCard GetUpdatePCPicking(string pickNo, string serialNo, string userid, out string resultMsg) { resultMsg = string.Empty; ProductCard pdCard = null; try { using (ProductCardPICKBLL pdBll = new ProductCardPICKBLL()) { pdCard = pdBll.GetUpdatePCPicking(pickNo, serialNo, userid, out resultMsg); } } catch (Exception ex) { pdCard = null; throw ex; } return(pdCard); }
public ProductCard GetReturnProductCardInfo(string qcReturnNo, string serialNo, string userid, out string resultMsg) //, out string resultMsg { resultMsg = string.Empty; ProductCard pdCard = null; try { using (QCReturnBLL qcREturnBll = new QCReturnBLL()) { pdCard = qcREturnBll.GetProductCardInfo(qcReturnNo, serialNo, userid, out resultMsg); } } catch (Exception ex) { pdCard = null; throw ex; } return(pdCard); }
public ProductCard GetUpdatePCPallet(string palletno, string serialNo, string userid, out string resultMsg) // { resultMsg = string.Empty; ProductCard pdCard = null; try { using (ProductCardRePackBLL prodRePack = new ProductCardRePackBLL()) { pdCard = prodRePack.GetUpdatePCRepack(palletno, serialNo, userid, out resultMsg); } } catch (Exception ex) { pdCard = null; throw ex; } return(pdCard); }
public void ProductCardCheck() { driver.Url = "http://localhost/litecart/en/"; var product = driver.FindElement(By.CssSelector("div#box-campaigns li.product")); var littleCard = new ProductCard { ProductName = product.FindElement(By.ClassName("name")).Text }; GetPrice(product, ref littleCard); product.Click(); product = driver.FindElement(By.Id("box-product")); var bigCard = new ProductCard { ProductName = product.FindElement(By.TagName("h1")).Text }; GetPrice(product, ref bigCard); Assert.Multiple(() => { Assert.AreEqual(littleCard.ProductName, bigCard.ProductName); Assert.AreEqual(littleCard.MainPrice, bigCard.MainPrice); Assert.AreEqual(littleCard.SalePrice, bigCard.SalePrice); StringAssert.Contains("line-through", littleCard.MainPriceType); Assert.IsTrue(IsItGray(FromString(littleCard.MainPriceColor))); Assert.AreEqual("strong", littleCard.SalePriceType); Assert.IsTrue(IsItRed(FromString(littleCard.SalePriceColor))); Assert.IsTrue(IsItSmaller(littleCard.MainPriceSize, littleCard.SalePriceSize)); StringAssert.Contains("line-through", bigCard.MainPriceType); Assert.IsTrue(IsItGray(FromString(bigCard.MainPriceColor))); Assert.AreEqual("strong", bigCard.SalePriceType); Assert.IsTrue(IsItRed(FromString(bigCard.SalePriceColor))); Assert.IsTrue(IsItSmaller(bigCard.MainPriceSize, bigCard.SalePriceSize)); }); }
public ProductCard GetUpdatePC_FG_In(string serialNo, string userid, out string resultMsg) // { resultMsg = string.Empty; ProductCard pdCard = null; try { using (ProductCardFGINBLL prdFGInBll = new ProductCardFGINBLL()) { pdCard = prdFGInBll.FGPress_GetUpdatePC_FGIn(serialNo, userid, out resultMsg); } } catch (Exception ex) { pdCard = null; throw ex; } return(pdCard); }
public ProductCard GetPC_NGInfo(string serialNo, string userid, out string resultMsg) { resultMsg = string.Empty; ProductCard pdCard = null; try { using (ProductCardNGConfBLL pdBll = new ProductCardNGConfBLL()) { pdCard = pdBll.Horizontal_GetPC_NGInfo(serialNo, userid, out resultMsg); } } catch (Exception ex) { pdCard = null; throw ex; } return(pdCard); }
public ProductCard GetUpdatePC_QC_Info(string serialNo, string qcStatus, string userid, out string resultMsg) // { resultMsg = string.Empty; ProductCard pdCard = null; try { using (ProductCardQCBLL pdBll = new ProductCardQCBLL()) { pdCard = pdBll.Horizontal_GetUpdatePC_QCInfo(serialNo, qcStatus, userid, out resultMsg); } } catch (Exception ex) { pdCard = null; throw ex; } return(pdCard); }
public ProductCard GetUpdatePC_MTST_In(string toNo, string serialNo, string userid, out string resultMsg) // { resultMsg = string.Empty; ProductCard pdCard = null; try { using (ProductCardDoBLL pdDoBll = new ProductCardDoBLL()) { pdCard = pdDoBll.GetUpdatePC_MTSTIn(toNo, serialNo, userid, out resultMsg); } } catch (Exception ex) { pdCard = null; throw ex; } return(pdCard); }
}//action xem gio hang //Cập nhật giỏ hàng public ActionResult UpdateCart(int ProId, FormCollection f) { //Kiểm tra sp Product p = pbo.GetProductbyId(ProId); if (p == null) { Response.StatusCode = 404; return(null); } //Lấy giỏ hàng ra từ session List <ProductCard> lstCart = GetCard(); ProductCard c = lstCart.FirstOrDefault(n => n.iProID == ProId); //Nếu có sp trong giỏ hàng if (c != null) { c.iQuantity = int.Parse(f["txtSoLuong"].ToString()); } return(RedirectToAction("ViewShoppingCard")); }
public ActionResult CalculationCard() { var cookies = Request.Cookies["Restoran"]; var locationId = int.Parse(cookies["locationId"]); if (locationId == 0) { return(RedirectToAction("List")); } var location = unitOfWork.LocationRep.Get(locationId); var recipes = location.Recipes; var products = location.Products; List <CalculationCardViewModel> model = new List <CalculationCardViewModel>(); foreach (var recipe in recipes) { var card = new CalculationCardViewModel(); var cardProduct = new ProductCard(); card.RecipeName = recipe.Name; foreach (var product in recipe.Products) { var productStorage = products.Where(p => p.Product.ProductId == product.ProductId).FirstOrDefault(); if (productStorage == null) { cardProduct.ProductName = product.Product.Name; cardProduct.Price = 0; cardProduct.Value = (double)product.Value; } else { cardProduct.ProductName = productStorage.Product.Name; cardProduct.Price = productStorage.Price; cardProduct.Value = (double)product.Value; } card.ProductsCard.Add(cardProduct); } model.Add(card); } return(View("CalculationCard", model)); }