private void btnOk_Click(object sender, System.EventArgs e) { WhereClauseListEmployee = ""; WhereClauseListRefNo = ""; if (radioVoucher.Checked) { if (grdVoucher.DataSource != null && grdViewVoucher.RowCount > 0) { for (var i = 0; i < grdViewVoucher.RowCount; i++) { if (Selection2.IsRowSelected(i)) { var row = (SalaryVoucherModel)grdViewVoucher.GetRow(i); WhereClauseListRefNo = WhereClauseListRefNo + "'" + row.RefNo + "',"; } } } } else { if (grdEmployee.DataSource != null && gridViewEmployee.RowCount > 0) { for (var i = 0; i < gridViewEmployee.RowCount; i++) { if (Selection1.IsRowSelected(i)) { var row = (EmployeeModel)gridViewEmployee.GetRow(i); WhereClauseListEmployee = WhereClauseListEmployee + row.EmployeeId + ","; } } } } if (WhereClauseListEmployee != "") { WhereClauseListEmployee = WhereClauseListEmployee.Substring(0, WhereClauseListEmployee.Length - 1); } if (WhereClauseListRefNo != "") { WhereClauseListRefNo = WhereClauseListRefNo.Substring(0, WhereClauseListRefNo.Length - 1); // WhereClauseListRefNo = WhereClauseListRefNo } }
private void btnOk_Click(object sender, System.EventArgs e) { WhereClauseListEmployee = ""; WhereClauseListRefNo = ""; if (radioVoucher.Checked) { if (grdVoucher.DataSource != null && grdViewVoucher.RowCount > 0) { for (var i = 0; i < grdViewVoucher.RowCount; i++) { if (grdViewVoucher.GetRow(i) != null) { WhereClauseListRefNo = WhereClauseListRefNo + (string)grdViewVoucher.GetRowCellValue(i, "RefNo") + ","; } } } } else { if (grdEmployee.DataSource != null && gridViewEmployee.RowCount > 0) { for (var i = 0; i < gridViewEmployee.RowCount; i++) { if (gridViewEmployee.GetRow(i) != null) { WhereClauseListEmployee = WhereClauseListEmployee + (string)gridViewEmployee.GetRowCellValue(i, "EmployeeId") + ","; } } } } if (WhereClauseListEmployee != "") { WhereClauseListEmployee = WhereClauseListEmployee.Substring(0, WhereClauseListEmployee.Length - 1); } if (WhereClauseListRefNo != "") { WhereClauseListRefNo = WhereClauseListRefNo.Substring(0, WhereClauseListRefNo.Length - 1); } }