Exemplo n.º 1
0
        private void btnClone_Click(object sender, EventArgs e)
        {
            if (dataGridViewSanPham.SelectedRows.Count > 0)
            {
                int rowSelected = dataGridViewSanPham.SelectedRows[0].Index;

                SanPhamDto dto = new SanPhamDto();
                //Ten Loai san pham
                dto.idSanPhamCha = int.Parse(cbbLoaiSanPham.SelectedValue.ToString());
                dto.name         = dataGridViewSanPham.Rows[rowSelected].Cells["TEN_SAN_PHAM"].Value.ToString();
                dto.loaiBia      = dataGridViewSanPham.Rows[rowSelected].Cells["LOAI_BIA"].Value.ToString();
                dto.loaiGiay     = dataGridViewSanPham.Rows[rowSelected].Cells["LOAI_GIAY"].Value.ToString();
                dto.size         = dataGridViewSanPham.Rows[rowSelected].Cells["SIZE"].Value.ToString();
                dto.notes        = dataGridViewSanPham.Rows[rowSelected].Cells["DESCRIPTION"].Value.ToString();
                double.TryParse(dataGridViewSanPham.Rows[rowSelected].Cells["DON_GIA"].Value.ToString(), out dto.donGia);
                int.TryParse(dataGridViewSanPham.Rows[rowSelected].Cells["NUM_PAGE_DEFAULT"].Value.ToString(), out dto.numPageDefault);
                double.TryParse(dataGridViewSanPham.Rows[rowSelected].Cells["ADDITIONAL_PAGES_COST"].Value.ToString(), out dto.addPageCost);

                AddProduct frmProduct = new AddProduct();
                frmProduct.cloneProduct(dto);
                frmProduct.ShowDialog(this);

                reloadData();
            }
        }
Exemplo n.º 2
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            AddProduct frmAdd = new AddProduct();

            if (frmAdd.ShowDialog(this) == DialogResult.OK)
            {
                loadData();
            }
        }
Exemplo n.º 3
0
        private void DM_SanPham_ThemMoiToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            AddProduct frmAddProduct = new AddProduct();

            frmAddProduct.ShowDialog(this);
        }
Exemplo n.º 4
0
        private void linkAdd_Click(object sender, EventArgs e)
        {
            AddProduct frmAddProduct = new AddProduct();

            frmAddProduct.ShowDialog();
        }