Esempio n. 1
0
        //-------------------------------------------------------------------------------------------------------------------------//
        private void button_SanPham_Click(object sender, EventArgs e)
        {
            sanPham sp = new sanPham();

            sp.FormClosed += new FormClosedEventHandler(SanPham_FormClose);
            sp.Show();
            this.Hide();
        }
Esempio n. 2
0
        public ChinhSuaDSSP(sanPham parent)
        {
            this.parent = parent;
            InitializeComponent();
            SetCulture();
            DataGridViewCell cell = parent.dataGridView_danhSachSanPham.CurrentCell;

            textBox_msp.Text       = parent.dataGridView_danhSachSanPham.Rows[cell.RowIndex].Cells[1].Value.ToString();
            textBox_tenSP.Text     = parent.dataGridView_danhSachSanPham.Rows[cell.RowIndex].Cells[2].Value.ToString();
            textBox_soLuong.Text   = parent.dataGridView_danhSachSanPham.Rows[cell.RowIndex].Cells[3].Value.ToString();
            textBox_donViTinh.Text = parent.dataGridView_danhSachSanPham.Rows[cell.RowIndex].Cells[4].Value.ToString();
            //textBox_giaBanLe.Text = parent.dataGridView_danhSachSanPham.Rows[cell.RowIndex].Cells[5].Value.ToString();

            //textBox_giaBanLe.Text = string.Format(cultureInfo, "{0:C0}", Convert.ToInt32(parent.dataGridView_danhSachSanPham.Rows[cell.RowIndex].Cells[5].Value));
            textBox_giaBanLe.Text = string.Format(cultureInfo, "{0:C0}", int.Parse(parent.dataGridView_danhSachSanPham.Rows[cell.RowIndex].Cells[5].Value.ToString(), NumberStyles.Currency));

            dateTimePicker1_hsd.Text = parent.dataGridView_danhSachSanPham.Rows[cell.RowIndex].Cells[6].Value.ToString();
            textBox_nhaCungCap.Text  = parent.dataGridView_danhSachSanPham.Rows[cell.RowIndex].Cells[7].Value.ToString();
        }