Exemplo n.º 1
0
        private void buttonAddProduct_Click(object sender, EventArgs e)
        {
            AddProduct a = new AddProduct();

            a.ShowDialog();
            GetProducts();
        }
Exemplo n.º 2
0
        private void buttonThêm_Click_1(object sender, EventArgs e)
        {
            AddProduct a = new AddProduct();

            a.ShowDialog();
            WireData();
        }
Exemplo n.º 3
0
        private void btnThemSP_Click(object sender, EventArgs e)
        {
            AddProduct themSP = new AddProduct();

            themSP.ShowDialog();
            WireData();
        }
Exemplo n.º 4
0
        private void buttonSua_Click(object sender, EventArgs e)
        {
            string          ID, Name, Cate, Size, material, color, objectt, season, manu, quantity, pic = "Khong co anh", entryPrice, sellPrice;
            Model_Product   pro = null;
            DataGridViewRow d   = DanhsachSP.CurrentRow;

            if (d.Index >= 0)
            {
                //Lấy thông tin từ datagrid view
                ID         = d.Cells[0].Value.ToString();
                Name       = d.Cells[1].Value.ToString();
                Cate       = d.Cells[2].Value.ToString();
                Size       = d.Cells[3].Value.ToString();
                material   = d.Cells[4].Value.ToString();
                color      = d.Cells[5].Value.ToString();
                objectt    = d.Cells[6].Value.ToString();
                season     = d.Cells[7].Value.ToString();
                manu       = d.Cells[8].Value.ToString();
                quantity   = d.Cells[9].Value.ToString();
                entryPrice = d.Cells[10].Value.ToString();
                sellPrice  = d.Cells[11].Value.ToString();
                try
                {
                    pic = GlobalConfig.Connection.find_anh(ID);
                }
                catch
                {
                }
                //cho thông tin vào 1 đối tượng
                pro = new Model_Product(ID, Name, Cate, Size, material, color, objectt, season, manu, quantity, entryPrice, sellPrice, pic);
                //truyền đối tượng sang form addproduct để update :)
                AddProduct a = new AddProduct(pro);
                a.Text = "Sửa sản Phẩm";
                a.ShowDialog();
                WireData();
            }
        }