private void InitView() { _appList = _nsiService.Applications; _appList.Add(AppEntity.Create()); _orgList = _nsiService.Organizations; _orgList.Add(OrgEntity.Create()); _userList = _nsiService.Users; _userList.Add(UserEntity.Create()); _tagList = _nsiService.Tags; _dialogResult = null; _control = new RequestFilterControl(this); _caption = string.Format("Параметри пошуку звернень", ""); _hint = string.Format("Параметри пошуку звернень", ""); _image = Properties.Resources.Request; _filterList = new List <RequestListFilterEntity>(); foreach (RequestListFilterEntity filter in _mainController.Filters) { _filterList.Add(filter.Clone()); } if (_filterOrigin == null) { Filter = RequestListFilterEntity.Create(); } else { Filter = _filterOrigin.Clone(); } }
RequestListFilterEntity SettingToFilter(FilterEntitySetting setting) { RequestListFilterEntity filter = RequestListFilterEntity.Create(); filter.CloneKey = new IdentKey(setting.CloneKey); filter.FilterName = setting.FilterName; filter.StartDateTime = setting.StartDateTime; filter.StopDateTime = setting.StopDateTime; UserEntity user = _nsiService.GetUserById(setting.ResponseId); filter.ResponseUser = user == null?UserEntity.Create() : user; user = _nsiService.GetUserById(setting.CreatorId); filter.CreatorUser = user == null?UserEntity.Create() : user; AppEntity app = _nsiService.GetAppById(setting.ApplicationId); filter.Application = app == null?AppEntity.Create() : app; OrgEntity org = _nsiService.GetOrgById(setting.OrganizationId); filter.Organization = org == null?OrgEntity.Create() : org; filter.Comments = setting.Comments; filter.Subject = setting.Subject; filter.Contact = setting.Contact; filter.TagIdList = setting.TagIdList; filter.StatusIdList = setting.StatusIdList; return(filter); }
public RequestListFilterEntity() : base("ReqFilter") { FilterName = "Новий фільтр"; StartDateTime = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day).AddDays(-3); StopDateTime = null; ResponseUser = UserEntity.Create(); CreatorUser = UserEntity.Create(); Application = AppEntity.Create(); Organization = OrgEntity.Create(); }
RequestEntity SettingToRequest(RequestEntitySetting setting) { RequestEntity request = RequestEntity.Create(); request.Id = setting.Id; request.ReqDateTime = setting.RequestDateTime; request.CreateDateTime = setting.CreateDateTime; request.Subject = setting.Subject; request.Comments = setting.Comments; request.Contact = setting.Contact; AppEntity app = _nsiService.GetAppById(setting.ApplicationId); request.Application = app == null?AppEntity.Create() : app; OrgEntity org = _nsiService.GetOrgById(setting.OrganizationId); request.Organization = org == null?OrgEntity.Create() : org; UserEntity user = _nsiService.GetUserById(setting.ResponseId); request.ResponseUser = user == null?UserEntity.Create() : user; user = _nsiService.GetUserById(setting.CreatorId); request.CreatorUser = user == null?UserEntity.Create() : user; if (setting.TagIdList != null) { foreach (string id in setting.TagIdList) { TagEntity tag = _nsiService.GetTagById(id); if (tag != null) { request.Tags.Entities.Add(tag); } else { _logger.Warn("Can not find tag with such id = {0}", id); } } } //request.Attaches = setting.Attaches.Clone(); request.InfoSourceType = setting.InfoSourceType; request.State = setting.State; request.BugNumber = setting.BugNumber; request.CMVersion = setting.CMVersion; request.ComponentVersion = setting.ComponentVersion; request.IsImportant = setting.IsImportant; return(request); }
public RequestEntity() : base("Request") { Tags = new EntityList <TagEntity>(); Attaches = new EntityList <AttachEntity>(); InfoSourceType = InfoSourceType.Call; State = RequestState.Open; Organization = OrgEntity.Create(); Application = AppEntity.Create(); ResponseUser = UserEntity.Create(); CreatorUser = UserEntity.Create(); CreateDateTime = DateHlp.GetDateTime_hhmmss(); ReqDateTime = DateHlp.GetDateTime_hhmmss(); PropertyChanged += new PropertyChangedEventHandler(RequestEntity_PropertyChanged); }
private void InitView() { _image = Properties.Resources.Request; _appList = _nsiService.Applications; _appList.Add(AppEntity.Create()); _orgList = _nsiService.Organizations; _orgList.Add(OrgEntity.Create()); _userList = _nsiService.Users; _userList.Add(UserEntity.Create()); _tagList = _nsiService.Tags; _tagList.Add(TagEntity.Create()); _dialogResult = null; _control = new RequestEditControl(this); SetCaption(); _eventMgr.GetEvent <RequestChangedEvent>().Subscribe(OnRequestChanged); }