private void ContextMenuStrip_Opening(object sender, System.ComponentModel.CancelEventArgs e) { ContextMenuStrip menu = sender as ContextMenuStrip; ToolStripItem vip = menu.Items.Cast <ToolStripItem>().Where(x => x.Text.Contains(nameof(VIP))).FirstOrDefault(); if (vip != null) { VIPCDO cdo = CustomDataObject.Get <VIPCDO>(VIPCDO.Key); GVItem selected = FormWrapper.GetPipeline().SelectedItems.FirstOrDefault(); vip.Text = "Mark As VIP"; if (cdo.Loans.Contains((selected?.Tag as PipelineInfo).GUID)) { vip.Text = "Marked VIP"; } } }
private void Item_Click(object sender, EventArgs e) { GridView gridView = FormWrapper.GetPipeline(); VIPRoot cdo = VIPCDO.CDO; string guid = (gridView.SelectedItems.FirstOrDefault().Tag as PipelineInfo).GUID; if (cdo.Loans.Contains(guid)) { cdo.Loans.Remove(guid); } else { cdo.Loans.Add(guid); } VIPCDO.UpdateCDO(cdo); VIPCDO.UploadCDO(); }
private void Item_Click(object sender, EventArgs e) { GridView gridView = FormWrapper.GetPipeline(); VIPCDO cdo = CustomDataObject.Get <VIPCDO>(VIPCDO.Key); string guid = (gridView.SelectedItems.FirstOrDefault().Tag as PipelineInfo).GUID; if (cdo.Loans.Contains(guid)) { cdo.Loans.Remove(guid); } else { cdo.Loans.Add(guid); } CustomDataObject.Save <VIPCDO>(VIPCDO.Key, cdo); }
private void GridView_ItemDoubleClick(object source, GVItemEventArgs e) { VIPCDO cdo = CustomDataObject.Get <VIPCDO>(VIPCDO.Key); if (cdo.Loans.Contains(EncompassApplication.CurrentLoan.Guid)) { UserGroup group = EncompassApplication.Session.Users.Groups.GetGroupByName("VIP"); if (group == null) { return; } UserList users = group.GetUsers(); if (!users.Contains(EncompassApplication.CurrentUser)) { Session.Application.GetService <ILoanConsole>().CloseLoanWithoutPrompts(false); EncompassHelper.ShowOnTop("VIP", "You do not have access to this loan."); } } }