private void button4_Click(object sender, EventArgs e) { FrmAddItems.windowName = "تعديل صنف"; FrmAddItems frm = new FrmAddItems(); frm.BtnNew.Visible = false; frm.BtnAdd.Enabled = true; frm.BtnAdd.Text = "تعديل"; frm.BtnAdd.Location = new Point(333, 23); frm.BtnAdd.ImageIndex = 1; frm.State = "Update"; try { frm.txtItemId.Text = this.dgSupp.CurrentRow.Cells[0].Value.ToString(); frm.txtBarcode.Text = this.dgSupp.CurrentRow.Cells[1].Value.ToString(); frm.txtItemName.Text = this.dgSupp.CurrentRow.Cells[2].Value.ToString(); frm.dateItem.Text = this.dgSupp.CurrentRow.Cells[3].Value.ToString(); frm.txtPurPrice.Text = this.dgSupp.CurrentRow.Cells[4].Value.ToString(); frm.txtSalePrice.Text = this.dgSupp.CurrentRow.Cells[5].Value.ToString(); frm.txtItemQTE.Text = this.dgSupp.CurrentRow.Cells[6].Value.ToString(); frm.txtDiscount.Text = this.dgSupp.CurrentRow.Cells[7].Value.ToString(); frm.comboGroup.Text = this.dgSupp.CurrentRow.Cells[8].Value.ToString(); frm.ShowDialog(); LoadData(); } catch { return; } }
private void btnPreview_Click(object sender, EventArgs e) { FrmAddItems.windowName = "معاينة صنف"; FrmAddItems frm = new FrmAddItems(); frm.BtnNew.Visible = false; frm.BtnAdd.Visible = false; frm.btnPurList.Visible = false; try { frm.txtItemId.Text = this.dgSupp.CurrentRow.Cells[0].Value.ToString(); frm.txtBarcode.Text = this.dgSupp.CurrentRow.Cells[1].Value.ToString(); frm.txtItemName.Text = this.dgSupp.CurrentRow.Cells[2].Value.ToString(); frm.dateItem.Text = this.dgSupp.CurrentRow.Cells[3].Value.ToString(); frm.txtPurPrice.Text = this.dgSupp.CurrentRow.Cells[4].Value.ToString(); frm.txtSalePrice.Text = this.dgSupp.CurrentRow.Cells[5].Value.ToString(); frm.txtItemQTE.Text = this.dgSupp.CurrentRow.Cells[6].Value.ToString(); frm.txtDiscount.Text = this.dgSupp.CurrentRow.Cells[7].Value.ToString(); frm.comboGroup.Text = this.dgSupp.CurrentRow.Cells[8].Value.ToString(); frm.ShowDialog(); LoadData(); } catch { return; } }
private void BtnAdd_Click(object sender, EventArgs e) { FrmAddItems.windowName = "اضافة صنف"; FrmAddItems frm = new FrmAddItems(); frm.ShowDialog(); LoadData(); }