Ejemplo n.º 1
0
        private void BtnHuy_Click(object sender, EventArgs e)
        {
            GunaAdvenceTileButton nb = (GunaAdvenceTileButton)sender;

            for (int i = 0; i < pnChiTietHD.Controls.Count; i++)
            {
                if (pnChiTietHD.Controls[i].Tag != null && pnChiTietHD.Controls[i].Tag.ToString() == nb.Tag.ToString())
                {
                    pnChiTietHD.Controls.Remove(pnChiTietHD.Controls[i]);
                    lstChiTiet.RemoveAt(i);
                    capnhapTongTien();
                }
                else
                {
                    continue;
                }
            }
        }
        //Hien thi loai nguyen lieu
        public void loadLoaiNguyenLieu()
        {
            List <QL_LoaiNguyenLieu> lstLoai = sp_bll.getALLCateNL();
            int top = 10;

            for (int i = 0; i < lstLoai.Count; i++)
            {
                if (lstLoai[i].Hinh == null)
                {
                    continue;
                }
                try
                {
                    GunaAdvenceTileButton btnLoaiNguyenLieu = new GunaAdvenceTileButton()
                    {
                        Location         = new Point(7, top),
                        Text             = lstLoai[i].TenLoai,
                        Width            = pnLoaiNguyenLieu.Width,
                        Size             = new Size(59, 50),
                        Image            = Image.FromFile("../../img/icon_loai/" + lstLoai[i].Hinh),
                        ImageSize        = new Size(25, 25),
                        BaseColor        = Color.Transparent,
                        OnHoverBaseColor = Color.Transparent,
                        BackColor        = Color.Transparent,
                        CheckedBaseColor = Color.Transparent,
                        Animated         = true,
                        Tag  = lstLoai[i].MaLoaiNL,
                        Font = new Font("Microsoft Sans Serif", 9, FontStyle.Regular)
                    };
                    top += btnLoaiNguyenLieu.Height + 5;
                    btnLoaiNguyenLieu.Click += BtnLoaiNguyenLieu_Click;;

                    pnLoaiNguyenLieu.Controls.Add(btnLoaiNguyenLieu);
                }
                catch (Exception)
                {
                    continue;
                    throw;
                }
            }
        }
Ejemplo n.º 3
0
        private void BtnNhomNguyenLieu_Click(object sender, EventArgs e)
        {
            GunaAdvenceTileButton btn = (GunaAdvenceTileButton)sender;

            loadSPTheoNhomSP(btn.Tag.ToString());
        }