private void button3_Click(object sender, EventArgs e) { Cls_SK_NormalClass.UI_SK_MC_QtyANDRemove_InterLock_Reduce = false; Cls_SK_NormalClass.UI_SK_MC_QtyANDRemove_InterLock_Increase = false; Cls_SK_NormalClass.UI_SK_MC_QtyANDRemove_InterLock_Remove = false; UI_SK_MC_ProductFlowPanel.Controls.Clear(); for (int index = 0; index <= Cls_Utility.Class1.CartList.Count - 1; index++) { Cls_SK_NormalClass.indexself = index; UCSKSI = new UC_SK_ShoppingItem(index); UCSKSI.UC_SK_ShoppingItem_ProductName_linklbl_GetSet = Cls_Utility.Class1.CartList[index].ProductName; UCSKSI.UC_SK_ShoppingItem_ProductSize_lbl_GetSet = Cls_Utility.Class1.CartList[index].ProductSizeName; UCSKSI.UC_SK_ShoppingItem_ProductColor_lbl_GetSet = Cls_Utility.Class1.CartList[index].ProductColorName; UCSKSI.UC_SK_ShoppingItem_ProductStockQTY_lbl_GetSet = CHECK(Cls_Utility.Class1.CartList[index].ProductColorID, Cls_Utility.Class1.CartList[index].ProductSizeID, Cls_Utility.Class1.CartList[index].ProductID); UCSKSI.UC_SK_ShoppingItem_ProductOrderQTY_lbl_GetSet = Cls_Utility.Class1.CartList[index].Qty.ToString(); UCSKSI.UC_SK_ShoppingItem_RemoveRowOrder_btn_GetSet = Cls_SK_NormalClass.indexself; UI_SK_MC_ProductFlowPanel.Controls.Add(UCSKSI); } }
public UI_SK_MainCart() { InitializeComponent(); #region 初次顯示 //int j; //int tempQTY_SearchStockQTY; //bool UI_SK_MC_OrderQTY_Checker = true; //for (int i = 0; i <= Cls_Utility.Class1.CartList.Count - 1; i++) //{ // j = Cls_Utility.Class1.CartList[i].ProductID; // var q = dbContext_FSE.ProductStocks // .Where(ps => ps.ProductID == j) // .Select(ps => ps.StockQTY).FirstOrDefault(); // tempQTY_SearchStockQTY = q; // Cls_Utility.Cls_SK_NormalClass.ShoppingList[i].ProductStockQTY = tempQTY_SearchStockQTY; //} button3.Visible = false; Cls_SK_NormalClass.FW = UI_SK_MC_ProductFlowPanel; //UC_SK_ShoppingItem UCSKSI_IC = new UC_SK_ShoppingItem(FWPAL); for (int index = 0; index <= Cls_Utility.Class1.CartList.Count - 1; index++) { Cls_SK_NormalClass.indexself = index; UCSKSI = new UC_SK_ShoppingItem(index); UCSKSI.UC_SK_ShoppingItem_ProductName_linklbl_GetSet = Cls_Utility.Class1.CartList[index].ProductName; UCSKSI.UC_SK_ShoppingItem_ProductSize_lbl_GetSet = Cls_Utility.Class1.CartList[index].ProductSizeName; UCSKSI.UC_SK_ShoppingItem_ProductColor_lbl_GetSet = Cls_Utility.Class1.CartList[index].ProductColorName; UCSKSI.UC_SK_ShoppingItem_ProductStockQTY_lbl_GetSet = CHECK(Cls_Utility.Class1.CartList[index].ProductColorID, Cls_Utility.Class1.CartList[index].ProductSizeID, Cls_Utility.Class1.CartList[index].ProductID); UCSKSI.UC_SK_ShoppingItem_ProductOrderQTY_lbl_GetSet = Cls_Utility.Class1.CartList[index].Qty.ToString(); UCSKSI.tableLayoutPanel1_GetSet = Cls_SK_NormalClass.indexself; UCSKSI.UC_SK_ShoppingItem_RemoveRowOrder_btn_GetSet = Cls_SK_NormalClass.indexself; UI_SK_MC_ProductFlowPanel.Controls.Add(UCSKSI); } #endregion 初次顯示 }