Exemplo n.º 1
0
        //private void LoadProduct()
        //{
        //    productCode = "";
        //    try
        //    {
        //        using (var db = new SlaughterhouseEntities())
        //        {
        //            var products = db.products.Where(p => p.product_group_code == this.ProductGroup).ToList();
        //            flowLayoutPanel1.Controls.Clear();
        //            buttons = new List<Button>();
        //            foreach (var product in products)
        //            {
        //                var btn = new Button
        //                {
        //                    Text = $"{product.product_code}:{product.product_name}",
        //                    Width = 180,
        //                    Height = 80,
        //                    FlatStyle = FlatStyle.Flat,
        //                    Font = new Font("Kanit", 14),
        //                    BackColor = Color.WhiteSmoke,
        //                    Tag = product.product_code
        //                };
        //                buttons.Add(btn);
        //                btn.Click += Btn_Click;
        //                //flowLayoutPanel1.Controls.Add(btn);
        //            }
        //            DisplayPaging();
        //        }
        //    }
        //    catch (Exception)
        //    {
        //        throw;
        //    }
        //}
        private void btnShowProduct_Click(object sender, EventArgs e)
        {
            var frm = new Form_LookupProduct();

            frm.ProductGroup = 4;
            frm.ShowDialog();
        }
Exemplo n.º 2
0
 private void btnProduct_Click(object sender, EventArgs e)
 {
     try
     {
         var frm = new Form_LookupProduct
         {
             ProductGroup = 9//ชิ้นส่วนหลัก
         };
         if (frm.ShowDialog() == DialogResult.OK)
         {
             product_code = frm.ProductCode;
             LoadProduct();
             LoadLotNo();
             btnStart.Enabled = true;
             lot_no           = "";
             //LoadData(frm.ReceiveNo);
             //LoadBomItem(bom.bom_code);
             //lblMessage.Text = Constants.PRODUCT_WAITING;
             //int stock_qty = 0;
             //decimal stock_wgh = 0;
             ////int remain_qty = lblSwineQty.Text.ToInt16() - stock_qty;
             //lblStockQty.Text = stock_qty.ToComma();
             //lblStockWgh.Text = stock_wgh.ToFormat2Decimal();
             ////lblRemainQty.Text = remain_qty.ToComma();
         }
     }
     catch (Exception ex)
     {
         DisplayNotification("Error", ex.Message, Color.Red);
     }
 }
 private void btnProduct_Click(object sender, EventArgs e)
 {
     try
     {
         var frm = new Form_LookupProduct();
         if (frm.ShowDialog() == DialogResult.OK)
         {
             product_code = frm.ProductCode;
             LoadProduct();
             LoadLotNo();
             btnStart.Enabled      = true;
             issuedProductSelected = null;
         }
     }
     catch (Exception ex)
     {
         DisplayNotification("Error", ex.Message, Color.Red);
     }
 }