private void mnuPardakht_Click(object sender, EventArgs e) { try { frmCash_Pardakht f = new frmCash_Pardakht(); f.op = "Add"; f.Form_Load(); f.ShowDialog(); } catch { } }
private void mnuView_Click(object sender, EventArgs e) { try { SqlDataAdapter da = new SqlDataAdapter("SELECT Parent FROM tbl_Transaction WHERE Parent_Code='" + dgvProduct.CurrentRow.Cells["ID"].Value.ToString() + "'", dataconnection); DataTable dt = new DataTable(); da.Fill(dt); if (dt.Rows[0].ItemArray[0].ToString() != "5" && dt.Rows[0].ItemArray[0].ToString() != "6") { frmMessage f = new frmMessage(); f.flag = 0; f.lblMessage.Text = "این عملیات مختص فاکتور بوده و باید از همان طریق نسبت به مشاهده آن اقدام نمایید"; f.ShowDialog(); } else { if (dgvProduct.CurrentRow.Cells["Bedehkar"].Value.ToString() != "") { frmCash_Daryaft f = new frmCash_Daryaft(); f.Fill_Data(Convert.ToInt32(dgvProduct.CurrentRow.Cells["ID"].Value)); f.grpAccount.Enabled = false; f.btnFinish.Enabled = false; f.ShowDialog(); } else if (dgvProduct.CurrentRow.Cells["Bestankar"].Value.ToString() != "") { frmCash_Pardakht f = new frmCash_Pardakht(); f.Fill_Data(Convert.ToInt32(dgvProduct.CurrentRow.Cells["ID"].Value)); f.grpAccount.Enabled = false; f.btnFinish.Enabled = false; f.ShowDialog(); } } } catch { frmMessage f = new frmMessage(); f.flag = 0; f.lblMessage.Text = "عملیات انتخابی معتبر نمی باشد"; f.ShowDialog(); } }
private void mnuCash_Click(object sender, EventArgs e) { try { frmCash_Pardakht f = new frmCash_Pardakht(); f.Form_Load(); f.op = "Add"; f.txtDate.Text = dgvTables.CurrentRow.Cells["Date"].Value.ToString(); f.Loan_Date = dgvTables.CurrentRow.Cells["Date"].Value.ToString(); f.txtCode.Text = Code; f.Loan_Code = Code; f.txtCash.Text = dgvTables.CurrentRow.Cells["Price"].Value.ToString(); f.Loan_Price = Convert.ToInt64(dgvTables.CurrentRow.Cells["Price"].Value); f.txtBabat_Code.Text = "029925"; f.Type = "Loan"; f.ShowDialog(); } catch { } }