private void simpleButton3_Click(object sender, EventArgs e) { if (simpleButton3.Text == "تعديل بيانات منتج ") { simpleButton3.Text = "حفظ البيانات"; CQuen.Enabled = true; CSel.Enabled = true; CPrice1.Enabled = true; Cpric2.Enabled = true; } else if (simpleButton3.Text == "حفظ البيانات") { if (ValidationClass.ISDigit(CQuen.Text)) { dataGridView1[8, this.dataGridView1.SelectedRows[0].Index].Value = CQuen.Text; } if (ValidationClass.StringNotEmpty(CSel.Text)) { dataGridView1[5, this.dataGridView1.SelectedRows[0].Index].Value = CSel.Text; } if (ValidationClass.StringNotEmpty(CPrice1.Text)) { dataGridView1[6, this.dataGridView1.SelectedRows[0].Index].Value = CPrice1.Text; } if (ValidationClass.StringNotEmpty(Cpric2.Text)) { dataGridView1[7, this.dataGridView1.SelectedRows[0].Index].Value = Cpric2.Text; } CQuen.Enabled = false; CSel.Enabled = false; CPrice1.Enabled = false; Cpric2.Enabled = false; simpleButton3.Text = "تعديل بيانات منتج "; } dataGridView1[9, this.dataGridView1.SelectedRows[0].Index].Value = (int.Parse(dataGridView1[8, this.dataGridView1.SelectedRows[0].Index].Value.ToString()) * float.Parse(dataGridView1[5, this.dataGridView1.SelectedRows[0].Index].Value.ToString())).ToString(); orderTotal = 0; for (int r = 0; r < dataGridView1.RowCount; r++) { orderTotal = orderTotal + float.Parse((dataGridView1[9, r].Value.ToString())); } textEdit6.Text = orderTotal.ToString(); if (ValidationClass.ISDigit(Pauid.Text)) { float Paid = float.Parse(Pauid.Text); Remin.Text = (orderTotal - Paid).ToString(); } }
private void Barcode_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { if (ValidationClass.StringNotEmpty(Barcode.Text)) { Product_Table Ob = BussinessObj.Product_tb_search_by_Barecode(Barcode.Text); if (ValidationClass.ISDigit(SellingPrice.Text) && ValidationClass.ISDigit(Quantity.Text) && ValidationClass.ISDigit(Pric1.Text)) { AddProduct(Ob.Product_ID, int.Parse(Quantity.Text), float.Parse(SellingPrice.Text), float.Parse(Pric1.Text), Price2.Text); } else { XtraMessageBox.Show("يرجى اضافة بيانات الكمية والاسعار قبل محاولة الاضافة"); } } Barcode.Text = ""; } }