private void btn_add_product_Click(object sender, EventArgs e) { lbl_qty.Text = "الكمية بــ "; lbl_min_qty.Text = "الكمية بــ "; Choose frm = new Choose("products"); frm.ShowDialog(); txt_p_id.Text = frm.dgv.CurrentRow.Cells[0].Value.ToString(); txt_p_name.Text = frm.dgv.CurrentRow.Cells[1].Value.ToString(); lbl_qty.Text += frm.dgv.CurrentRow.Cells[3].Value.ToString(); txt_min_qty.Text = string.Empty; txt_qty.Text = string.Empty; if (frm.dgv.CurrentRow.Cells[4].Value.ToString() != string.Empty) { lbl_min_qty.Text += frm.dgv.CurrentRow.Cells[4].Value.ToString(); txt_min_qty.Enabled = true; } else { txt_min_qty.Enabled = false; txt_min_qty.Text = string.Empty; lbl_min_qty.Text = "الكمية بــ "; } txt_qty.Focus(); }
private void Choose_Btn_Click(object sender, EventArgs e) { DialogResult result = Choose.ShowDialog(); filePath = Choose.FileName; label2.Text = filePath; }
private void btn_choose_su_Click(object sender, EventArgs e) { Choose frm = new Choose("customers"); frm.ShowDialog(); if (frm.dgv.Rows.Count > 0) { txt_cu_id.Text = frm.dgv.CurrentRow.Cells[0].Value.ToString(); txt_cu_name.Text = frm.dgv.CurrentRow.Cells[1].Value.ToString(); txt_cu_address.Text = frm.dgv.CurrentRow.Cells[2].Value.ToString(); txt_cu_phone.Text = frm.dgv.CurrentRow.Cells[3].Value.ToString(); txt_cu_phone.Enabled = txt_cu_name.Enabled = txt_cu_address.Enabled = false; } }
private void btn_choose_driver_Click(object sender, EventArgs e) { Choose frm = new Choose("drivers"); frm.ShowDialog(); if (frm.dgv.Rows.Count > 0) { txt_d_id.Text = frm.dgv.CurrentRow.Cells[0].Value.ToString(); txt_d_name.Text = frm.dgv.CurrentRow.Cells[1].Value.ToString(); txt_d_natnum.Text = frm.dgv.CurrentRow.Cells[2].Value.ToString(); txt_car_type.Text = frm.dgv.CurrentRow.Cells[3].Value.ToString(); txt_car_num.Text = frm.dgv.CurrentRow.Cells[4].Value.ToString(); txt_car_num.Enabled = txt_d_name.Enabled = txt_d_natnum.Enabled = txt_car_type.Enabled = false; } }
private void btn_choose_su_Click(object sender, EventArgs e) { Choose frm = new Choose("orders_reback"); frm.ShowDialog(); if (frm.dgv.Rows.Count > 0) { txt_or_id.Text = frm.dgv.CurrentRow.Cells[0].Value.ToString(); txt_re_date.Text = frm.dgv.CurrentRow.Cells[1].Value.ToString(); cu_name.Text = frm.dgv.CurrentRow.Cells[2].Value.ToString(); txt_driver_name.Text = frm.dgv.CurrentRow.Cells[3].Value.ToString(); txt_driver_name.Enabled = txt_re_date.Enabled = cu_name.Enabled = false; } for (int i = 0; i < dgv.Rows.Count; i++) { dgv.Rows.Remove(dgv.Rows[i]); } txt_p_id.Text = txt_p_name.Text = string.Empty; }
private void btn_add_product_Click(object sender, EventArgs e) { lbl_qty.Text = "الكمية بــ "; lbl_min_qty.Text = "الكمية بــ "; if (txt_or_id.Text == string.Empty) { MessageBox.Show("الرجاء اختيار الفاتورة"); return; } Choose frm = new Choose("orders_details", txt_or_id.Text); frm.ShowDialog(); txt_p_id.Text = frm.dgv.CurrentRow.Cells[0].Value.ToString(); txt_p_name.Text = frm.dgv.CurrentRow.Cells[1].Value.ToString(); this.qty = 0; if (frm.dgv.CurrentRow.Cells[4].Value.ToString() != string.Empty) { this.qty = (Convert.ToDecimal(frm.dgv.CurrentRow.Cells[2].Value.ToString()) * Convert.ToDecimal(frm.dgv.CurrentRow.Cells[4].Value.ToString())) + Convert.ToDecimal(frm.dgv.CurrentRow.Cells[3].Value.ToString()); } else { this.qty = Convert.ToDecimal(frm.dgv.CurrentRow.Cells[2].Value.ToString()); } txt_min_qty.Text = string.Empty; txt_qty.Text = string.Empty; if (frm.dgv.CurrentRow.Cells[4].Value.ToString() != string.Empty) { txt_min_qty.Enabled = true; } else { txt_min_qty.Enabled = false; txt_min_qty.Text = string.Empty; lbl_min_qty.Text = "الكمية بــ "; } txt_qty.Focus(); }
private void btnAddFormaPago_Click(object sender, EventArgs e) { var selectedCaja = commB.SetEntity <ControlEntity.Caja>(cajaBindingSource.Current); var formasPagoDisp = LocalData.GetFormasPagoDisponibles(selectedCaja.IdCaja); if (formasPagoDisp != null && formasPagoDisp.Count > 0) { var searchTable = formasPagoDisp.AsDataTable(); // transforma en dataTable var searchForm = new Choose(searchTable, "FormaPago", true); searchForm.ShowDialog(); if (!string.IsNullOrEmpty(searchForm.StringSelectedKey)) { var curKey = searchForm.StringSelectedKey.ToString().Trim(); //if (curKey!=null) ventB.InsertPagoCaja(curKey, Convert.ToInt16(idCajaTextBox.Text)); } GetFormasPago(); } else { MessageBox.Show("No hay formas de pago sin asignar para la caja seleccionada"); } }