public FRM_AddNewCustomer(bool _ISUpdate) { InitializeComponent(); this.ISUpdate = _ISUpdate; cmb_country.DataSource = CLASS_COUNTRY.sp_country_display(); cmb_country.DisplayMember = "اسم الدولة"; cmb_country.ValueMember = "رقم الدولة"; cmb_country_SelectionChangeCommitted(null, null); if (ISUpdate) { this.Text = "تعديل بيانات العميل"; btn_ok.Text = "تعديل"; txt_Name.Text = FRM_CUSTOMER_MANEGEMENT.row.Cells[1].Value.ToString(); txt_Addres.Text = FRM_CUSTOMER_MANEGEMENT.row.Cells[2].Value.ToString(); txt_Mobile.Text = FRM_CUSTOMER_MANEGEMENT.row.Cells[3].Value.ToString(); MemoryStream ms = new MemoryStream(FRM_CUSTOMER_MANEGEMENT.row.Cells[4].Value as byte[]); pic_Image.Image = Image.FromStream(ms); cmb_country.Text = FRM_CUSTOMER_MANEGEMENT.row.Cells[5].Value.ToString(); cmb_city.Text = FRM_CUSTOMER_MANEGEMENT.row.Cells[6].Value.ToString(); } else { this.Text = "اضافة بيانات العميل "; btn_ok.Text = "اضافة "; } }
public FRM_CITY() { InitializeComponent(); cmb_country_ID.DataSource = CLASS_COUNTRY.sp_country_display(); cmb_country_ID.DisplayMember = "اسم الدولة"; cmb_country_ID.ValueMember = "رقم الدولة"; btn_Display_Click(null, null); }
private void btnUpdate_Click(object sender, EventArgs e) { try { if (txt_coID.Text != "") { CLASS_COUNTRY.sp_country_update(int.Parse(txt_coID.Text), txt_coName.Text); MessageBox.Show("تم التعديل بنجاح"); btn_coSelectALL_Click(null, null); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void btn_coAdd_Click(object sender, EventArgs e) { try { if (txt_coName.Text == "") { MessageBox.Show("يجب ادخال اسم الدولة "); return; } CLASS_COUNTRY.sp_country_insert(txt_coName.Text); MessageBox.Show("تم الاضافة بنجاح"); txt_coName.Text = ""; btn_coSelectALL_Click(null, null); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void txt_coSearch_TextChanged(object sender, EventArgs e) { dgvCountry.DataSource = CLASS_COUNTRY.sp_country_search(txt_coSearch.Text); }
private void btn_coSelectALL_Click(object sender, EventArgs e) { dgvCountry.DataSource = CLASS_COUNTRY.sp_country_display(); }