Exemplo n.º 1
0
 private void GetAccountName()
 {
     if (dgvExpensses.CurrentCell.ColumnIndex == clmAccNo.Index || dgvExpensses.CurrentCell.ColumnIndex == clmAccName.Index)
     {
         Accounts.frmFindAccount frm = new Accounts.frmFindAccount();
         frm.strWhere = " ";
         frm.ShowDialog();
         if (frm.strPKid != "")
         {
             int iRow = dgvExpensses.CurrentCell.RowIndex;
             dgvExpensses[clmExpPKid.Index, iRow].Value = "";
             dgvExpensses[clmAccId.Index, iRow].Value   = frm.strPKid;
             dgvExpensses[clmAccNo.Index, iRow].Value   = frm.strAccNo;
             dgvExpensses[clmAccName.Index, iRow].Value = frm.strAccName;
         }
     }
 }
Exemplo n.º 2
0
 private void frmFindAccount_Click(object sender, EventArgs e)
 {
     Accounts.frmFindAccount frm = new Accounts.frmFindAccount();
     frm.strWhere  = " where a.stat='فعال' ";
     frm.strSelect = "select  a.swid,acc_no,acc_name,acc_type,a.acc_class from accounts a  ";
     frm.ShowDialog();
     if (frm.strAccid != "")
     {
         lstAccName.SelectedValue = Convert.ToInt16(frm.strAccid);
     }
     else
     {
         lstAccNo.Text            = "";
         lstAccName.Text          = "";
         lstAccNo.SelectedIndex   = -1;
         lstAccName.SelectedIndex = -1;
     }
 }