示例#1
0
 private void mnuPardakht_Click(object sender, EventArgs e)
 {
     try
     {
         frmBank_Pardakht f = new frmBank_Pardakht();
         f.Form_Load();
         f.op = "Add";
         f.ShowDialog();
     }
     catch
     {
     }
 }
示例#2
0
 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() != "7" && dt.Rows[0].ItemArray[0].ToString() != "8")
         {
             frmMessage f = new frmMessage();
             f.flag            = 0;
             f.lblMessage.Text = "این عملیات مختص فاکتور بوده و باید از همان طریق نسبت به ویرایش آن اقدام نمایید";
             f.ShowDialog();
         }
         else
         {
             if (dgvProduct.CurrentRow.Cells["Bedehkar"].Value.ToString() != "")
             {
                 frmBank_Daryaft f = new frmBank_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() != "")
             {
                 frmBank_Pardakht f = new frmBank_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 mnuBank_Click(object sender, EventArgs e)
 {
     try
     {
         frmBank_Pardakht f = new frmBank_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
     {
     }
 }