private void BindList() { DataTable tblIncluded = CDL.GetDSIncludedEmployee(_strCDLCode); lvIncluded.Items.Clear(); foreach (DataRow drw in tblIncluded.Rows) { ListViewItem lvi = new ListViewItem(); lvi.Tag = drw["username"].ToString(); lvi.Text = drw["lastname"].ToString() + ", " + drw["firname"].ToString(); lvIncluded.Items.Add(lvi); } DataTable tblExclude = CDL.GetDSExcludedEmployee(_strCDLCode); lvExcluded.Items.Clear(); foreach (DataRow drw in tblExclude.Rows) { ListViewItem lvi = new ListViewItem(); lvi.Tag = drw["username"].ToString(); lvi.Text = drw["lastname"].ToString() + ", " + drw["firname"].ToString(); lvi.SubItems.Add(LeaveApplicationBalance.GetRemainingBalance(drw["username"].ToString(), cmbLeaveType.SelectedValue.ToString()).ToString()); lvExcluded.Items.Add(lvi); } }
private void cmbLeaveType_SelectedIndexChanged(object sender, EventArgs e) { try { if (LeaveApplicationTypes.GetHasBalance(_strLeaveTypeCode) == "1") { txtBalance.Text = LeaveApplicationBalance.GetRemainingBalance(_strUsername, _strLeaveTypeCode).ToString(); } else { txtBalance.Text = "NA"; } } catch { } }
private void cmbLeaveType_SelectedIndexChanged(object sender, EventArgs e) { try { if (LeaveApplicationTypes.GetHasBalance(cmbLeaveType.SelectedValue.ToString()) == "1") { txtBalance.Text = LeaveApplicationBalance.GetRemainingBalance(cmbRequestor.SelectedValue.ToString(), cmbLeaveType.SelectedValue.ToString()).ToString(); } else { txtBalance.Text = "NA"; } } catch { } }
private void cmbLeaveType_SelectedIndexChanged(object sender, EventArgs e) { try { DataTable tblExclude = CDL.GetDSExcludedEmployee(_strCDLCode); lvExcluded.Items.Clear(); foreach (DataRow drw in tblExclude.Rows) { ListViewItem lvi = new ListViewItem(); lvi.Tag = drw["username"].ToString(); lvi.Text = drw["lastname"].ToString() + ", " + drw["firname"].ToString(); lvi.SubItems.Add(LeaveApplicationBalance.GetRemainingBalance(drw["username"].ToString(), cmbLeaveType.SelectedValue.ToString()).ToString()); lvExcluded.Items.Add(lvi); } } catch { } }