private void SetRadioButtonValue(DataGridViewDisableCheckBoxCell cell) { SelectedStatus status = (SelectedStatus)cell.Value; if (status == SelectedStatus.Selected) { status = SelectedStatus.NoSelected; } else { status = SelectedStatus.Selected; } if (this.tabControlHealthDocManage.SelectedIndex == 0) { for (int i = 0; i < dataGridView1.Rows.Count; i++) { DataGridViewDisableCheckBoxCell cel = dataGridView1.Rows[i].Cells["ColCheck"] as DataGridViewDisableCheckBoxCell; if (!cel.Equals(cell)) { cel.Value = status; } } } if (this.tabControlHealthDocManage.SelectedIndex == 1) { for (int i = 0; i < dataGridView2.Rows.Count; i++) { DataGridViewDisableCheckBoxCell cel = dataGridView2.Rows[i].Cells["columnCheck"] as DataGridViewDisableCheckBoxCell; if (!cel.Equals(cell)) { cel.Value = status; } } } }
/// <summary> /// Function to Delete record for user. /// </summary> /// <param name="obj"></param> /// <returns>void</returns> /// <createdBy></createdBy> public void DeleteRecord(object obj) { try { CommonSettings.logger.LogInfo(typeof(string), string.Format(CultureInfo.InvariantCulture, Resources.loggerMsgStart, DateTime.Now.ToShortDateString(), DateTime.Now.ToShortTimeString(), MethodBase.GetCurrentMethod().Name)); MessageBoxResult messageBoxResult = MessageBox.Show(Resources.MsgDeleteConfirm, Resources.msgTitleMessageBoxDelete, MessageBoxButton.YesNo); if (messageBoxResult == MessageBoxResult.Yes) { string errMsg = string.Empty; FindUserProp objFindUserProp = new FindUserProp(); objFindUserProp.UserID = obj.GetType().GetProperty("UdUserID").GetValue(obj).ToString(); objFindUserProp.RecordStatus = "Inactive"; objFindUserProp.FirstName = obj.GetType().GetProperty("UdUserFirstName").GetValue(obj).ToString();; objFindUserProp.LastName = obj.GetType().GetProperty("UdUserLastName").GetValue(obj).ToString();; objFindUserProp.UserCode = obj.GetType().GetProperty("UdUserCode").GetValue(obj).ToString();; objFindUserProp.SelectedRole = SelectedRole; string currentUserName = Application.Current.Properties["LoggedInUserName"].ToString().ToUpper(); string deleteUserName = objFindUserProp.UserCode.ToUpper(); if (deleteUserName != currentUserName) { int value = _serviceInstance.RemoveUserDetails(objFindUserProp); if (SelectedStatus != null && !SelectedStatus.Equals("All")) { objFindUserProp.selectedStatusRole = SelectedStatus; } if (obj.GetType().GetProperty("UdUserStatus").GetValue(obj) != null && !obj.GetType().GetProperty("UdUserStatus").GetValue(obj).ToString().Equals("All")) { objFindUserProp.selectedStatusRole = obj.GetType().GetProperty("UdUserStatus").GetValue(obj).ToString();; } FindUserDeligate.SetValueMethodCmdReferesh(string.Empty); MessageBox.Show(Resources.msgDeleteSuccessfully); UsersRecordList(null); } else { MessageBox.Show(Resources.WarnDeleteCurrentUser); } } } catch (Exception ex) { LogHelper.LogErrorToDb(ex); bool displayErrorOnUI = false; CommonSettings.logger.LogError(this.GetType(), ex); if (displayErrorOnUI) { throw; } } finally { CommonSettings.logger.LogInfo(typeof(string), string.Format(CultureInfo.InvariantCulture, Resources.loggerMsgEnd, DateTime.Now.ToShortDateString(), DateTime.Now.ToShortTimeString(), MethodBase.GetCurrentMethod().Name)); } }
private void FilterBySelection() { FilteredApartmentList = new ObservableCollection <ApartmentWithComplexes>( ApartmentList.Where(item => (String.IsNullOrEmpty(SelectedStatus) || item.StatusSaleName.ToUpper().Contains(SelectedStatus.ToUpper())) && (String.IsNullOrEmpty(SelectedComplex) || item.NameHousingComplex.ToUpper().Contains(SelectedComplex.ToUpper())) && (String.IsNullOrEmpty(SelectedHouseAddress) || item.HouseAddress.ToUpper().Contains(SelectedHouseAddress.ToUpper())) && (SelectedFloor.Equals(default) ||
public StatusesViewModel(TimelineModelBase model, IReactiveProperty <Status> inReplyTo, TabsModel tabs, bool streamingOnStartup = false) { this.model = model; this.inReplyTo = inReplyTo; this.tabs = tabs; IsStreaming = this.model.StreamingStarted.ToReadOnlyReactiveProperty(); IsStreamingAvailable = this.model.IsStreamingAvailable; Statuses = this.model.ToReadOnlyReactiveCollection(s => new StatusViewModel(s)); ReloadCommand = new AsyncReactiveCommand() .WithSubscribe(() => this.model.FetchPreviousAsync()); ReloadOlderCommand = new AsyncReactiveCommand() .WithSubscribe(() => this.model.FetchNextAsync()); ToggleStreamingCommand = Observable.Repeat(IsStreamingAvailable, 1).ToReactiveCommand() .WithSubscribe(() => this.model.StreamingStarting.Value = !IsStreaming.Value); var IsStatusSelected = SelectedStatus.Select(x => x != null); OpenCommand = IsStatusSelected.ToReactiveCommand() .WithSubscribe(() => Process.Start(SelectedStatus.Value.Status.Url ?? SelectedStatus.Value.Status.Reblog.Url)); FavouriteCommand = IsStatusSelected.ToAsyncReactiveCommand() .WithSubscribe(() => this.model.FavouriteAsync(SelectedStatus.Value.Status.Id)); ReblogCommand = IsStatusSelected.ToAsyncReactiveCommand() .WithSubscribe(() => this.model.ReblogAsync(SelectedStatus.Value.Status.Id)); ReplyCommand = IsStatusSelected.ToReactiveCommand() .WithSubscribe(() => this.inReplyTo.Value = SelectedStatus.Value.Status); DeleteCommand = IsStatusSelected.ToAsyncReactiveCommand() .WithSubscribe(() => this.model.DeleteAsync(SelectedStatus.Value.Status.Id)); OpenAccountTabCommand = IsStatusSelected.ToReactiveCommand() .WithSubscribe(() => { Account account = SelectedStatus.Value.OriginalStatus.Account; this.tabs.SwitchToOrOpen(new AccountTabParameters() { Name = $"user: {account.AccountName}", Id = account.Id }); }); this.model.StreamingStarting.Value = streamingOnStartup; ReloadCommand.Execute(); }
private void SetRadioButtonValue(DataGridViewDisableCheckBoxCell cell) { SelectedStatus status = (SelectedStatus)cell.Value; if (status == SelectedStatus.Selected) { status = SelectedStatus.NoSelected; } else { status = SelectedStatus.Selected; } for (int i = 0; i < storageDataGridView.Rows.Count; i++) { DataGridViewDisableCheckBoxCell cel = storageDataGridView.Rows[i].Cells["checkBoxColumn"] as DataGridViewDisableCheckBoxCell; if (!cel.Equals(cell)) { cel.Value = status; } } }
/// <summary> /// Method To Show All Record /// </summary> public void UsersRecordList(object obj) { try { Count = 0; CommonSettings.logger.LogInfo(typeof(string), string.Format(CultureInfo.InvariantCulture, "Called {2} function ::{0} {1}.", DateTime.Now.ToShortDateString(), DateTime.Now.ToShortTimeString(), MethodBase.GetCurrentMethod().Name)); if (obj == null) { CurrentPageIndex = 0; } if (CurrentPageIndex == 0) { Application.Current.Properties["FindUserGridLastScrollOffset"] = 0; Application.Current.Properties["FindUserGridCurrentPageIndex"] = 0; } FindUserProp objFindUserProp = new FindUserProp(); objFindUserProp.CurrentPageIndex = CurrentPageIndex; objFindUserProp.PageSize = CurrentPageIndex > 0 ? _GridPageSizeOnScroll : _GridPageSize;; objFindUserProp.DefaultPageSize = _GridPageSize; objFindUserProp.FirstName = FirstName; objFindUserProp.LastName = LastName; objFindUserProp.UserCode = UserCode; objFindUserProp.SelectedRole = RoleName; if (SelectedStatus != null && !SelectedStatus.Equals("All")) { objFindUserProp.selectedStatusRole = SelectedStatus; } var list = _serviceInstance.GetUserRecord(objFindUserProp).Select(d => new UserDetails { UdUserCode = d.UserCode, UdUserFirstName = d.FirstName, UdUserLastName = d.LastName, UdUserStatus = d.UserStatus, UdUserID = d.UserID, TotalPageCount = d.TotalPageCount }); if (CurrentPageIndex == 0) { UserDetailList = null; UserDetailList = new ObservableCollection <UserDetails>(list); } else { if (UserDetailList != null && UserDetailList.Count > 0) { foreach (UserDetails ud in new ObservableCollection <UserDetails>(list)) { UserDetailList.Add(ud); } } } Count = userDetailList.ToList().Where(x => x.TotalPageCount > 0).FirstOrDefault().TotalPageCount; } catch (Exception ex) { LogHelper.LogErrorToDb(ex); bool displayErrorOnUI = false; CommonSettings.logger.LogError(this.GetType(), ex); if (displayErrorOnUI) { throw; } } finally { CommonSettings.logger.LogInfo(typeof(string), string.Format(CultureInfo.InvariantCulture, Resources.loggerMsgEnd, DateTime.Now.ToShortDateString(), DateTime.Now.ToShortTimeString(), MethodBase.GetCurrentMethod().Name)); if (_searchTimer != null) { _searchTimer.Dispose(); } } }