private void btnSave_Click(object sender, EventArgs e) { if (ss.Equals("ShowQManag")) { try { if (txtIMGid.Text.Equals("") && picImage.Image != null) { int addIMG = ClassQute.AddImgQute(arr, DocID); dt = ClassQute.selectimgforQute(DocID); MessageBox.Show("Done . ."); numOfImag = dt.Rows.Count; btnFirstIMG_Click(null, null); } } catch (Exception) { } } else if (ss.Equals("ShowOManag")) { try { if (txtIMGid.Text.Equals("") && picImage.Image != null) { int addIMG = ClassOrder.AddImageOrder(arr, DocID); dt = ClassOrder.selectImgOrder(DocID); MessageBox.Show("Done . ."); numOfImag = dt.Rows.Count; btnFirstIMG_Click(null, null); } } catch (Exception) { } } }
private void btnSave_Click(object sender, EventArgs e) { try { if (txtType.Text.Equals("") || txtOwnDoc.Text.Equals("")) { MessageBox.Show("الرجاء ملئ الحقول الضرورية"); } else { int addDoc = ClassOrder.AddNewOrder(txtType.Text, txtOwnDoc.Text, txtNumber.Text, dtpDoc.Value, rtxtNote.Text, 1, Qute_Id, FRM_Main.emp_fname + " " + FRM_Main.emp_lname); if (NumOfImage > 0) { DataTable LastOne = ClassOrder.selectlastOrder(); for (int i = 0; i < images.Count; i++) { int AddImg = ClassOrder.AddImageOrder(images[i], int.Parse(LastOne.Rows[0][0].ToString())); } } int updateQute = ClassQute.UpdateStatQute(Qute_Id); Qute_Id = 0; txtNumber.Text = txtOwnDoc.Text = txtType.Text = rtxtNote.Text = ""; lbNumIMG.Text = "0"; NumOfImage = 0; images.Clear(); label7.Text = "0"; MessageBox.Show("تمت عملية الحفظ بنجاح"); } } catch (Exception) { MessageBox.Show("يجب اختيار عرض اسعار مرتبط بالطلبية"); } }