private List <WorkType> SearchWorkType(string name, string status) { IWorkTypeService service = null; try { // Create service. service = AppService.Create <IWorkTypeService>(); service.AppManager = this.mAppManager; // Call service method. return(service.Search( new MasterEntitySearchCriteria() { Name = name, Status = status })); } catch { throw; } finally { if (service != null) { service.Dispose(); } } }
/// <summary> /// コンストラクタ /// </summary> /// <param name="mapper"><see cref="IMapper"/></param> /// <param name="workTypeService"><see cref="IWorkTypeService"/></param> /// <param name="workTypeQueryService"><see cref="IWorkTypeQueryService"/></param> public WorkTypesController( IMapper mapper, IWorkTypeService workTypeService, IWorkTypeQueryService workTypeQueryService) { _mapper = mapper; _workTypeService = workTypeService; _workTypeQueryService = workTypeQueryService; }
private void DisplayWorkTypeInfo(int id) { IWorkTypeService WorkTypeService = null; WorkType mWorkType = null; try { // Create service. WorkTypeService = AppService.Create <IWorkTypeService>(); WorkTypeService.AppManager = this.mAppManager; // retrieve data mWorkType = new WorkType(id); mWorkType = WorkTypeService.Retrieve(id); //this.spnMessage.InnerHtml = ""; hiddenEntityId.Value = "0"; if (mWorkType != null) { hiddenEntityId.Value = id.ToString(); txtEntityName.Value = mWorkType.Name; txtEntityDescription.Value = mWorkType.Description; //drpActivity.SelectedIndex = mWorkType.ActivityTypeId; drpActivity.SelectedValue = mWorkType.ActivityTypeId.ToString(); //drpActivity.Items.FindByValue(mWorkType.ActivityTypeId.ToString()).Selected = true;for Html Drop Control chkEntityConsiderForReport.Checked = mWorkType.ConsiderForReport; chkEntityActive.Checked = mWorkType.IsActive; txtEntityReason.Value = string.Empty; if (drpActivity.SelectedValue.ToString() == "1") { chkEntityConsiderForReport.Disabled = true; } else { chkEntityConsiderForReport.Disabled = false; //chkEntityConsiderForReport.Checked = mWorkType.ConsiderForReport; //chkEntityActive.Checked = mWorkType.IsActive; //txtEntityReason.Value = string.Empty; } } // Show/Hide the controls. //this.ShowHideEditControls(true); } catch { throw; } finally { if (WorkTypeService != null) { WorkTypeService.Dispose(); } WorkTypeService = null; } }
private void FillWorkTypes() { IWorkTypeService service = null; try { // Create service. service = AppService.Create <IWorkTypeService>(); service.AppManager = this.AppManager; // Call service method. List <WorkType> workTypes = service.RetrieveAll(); // Filter active entities. IEnumerable <WorkType> activeList = from item in workTypes where item.IsActive == true && item.ActivityTypeId == 1 orderby item.Name select item; // Bind. Session.Add("ActivityEntry_Worktype", workTypes); this.ddlWorkTypeList.Items.Clear(); this.ddlWorkTypeList.DataTextField = "Name"; this.ddlWorkTypeList.DataValueField = "Id"; this.ddlWorkTypeList.DataSource = activeList; this.ddlWorkTypeList.DataBind(); // Add default item. this.ddlWorkTypeList.Items.Insert(0, new ListItem("-- Select --", "0")); // Select first item as default. if (this.ddlWorkTypeList.Items.Count > 0) { this.ddlWorkTypeList.SelectedIndex = 0; } if (this.ddlWorkTypeList.Items.Count == 2) { this.ddlWorkTypeList.SelectedIndex = 1; SetDefaultmins(); } } catch { throw; } finally { if (service != null) { service.Dispose(); } } }
public JobAdvertisementService(IJobAdvertisementRepository jobAdvertisementRepository, ICityService cityService, IEducationLevelService educationLevelService, IDepartmantService departmantService, IWorkTypeService workTypeService, IPositionService positionService, ICompanyDetailService companyDetailService, ISectorService sectorService, IUserService userService, IAdvertisementApplyRepository advertisementApplyRepository, IAdvertisementViewCountRepository advertisementViewCountRepository, INationalityService nationalityService, IDrivingLicenseService drivingLicenseService, IUserDetailService userDetailService) { _jobAdvertisementRepository = jobAdvertisementRepository; _cityService = cityService; _educationLevelService = educationLevelService; _departmantService = departmantService; _workTypeService = workTypeService; _positionService = positionService; _companyDetailService = companyDetailService; _sectorService = sectorService; _nationalityService = nationalityService; _drivingLicenseService = drivingLicenseService; _userService = userService; _advertisementApplyRepository = advertisementApplyRepository; _advertisementViewCountRepository = advertisementViewCountRepository; _userDetailService = userDetailService; }
private Boolean UpdateWorkTypeInfo(int id) { IWorkTypeService WorkTypeService = null; WorkType mWorkType = null; bool validatelocation = true; this.HideStatusMessage(string.Empty, false); try { // Validate the entity values. if (this.ValidateControls() == false) { return(false); } else { // create instance mWorkType = new WorkType(id); mWorkType.Name = txtEntityName.Value.ToString().Trim(); mWorkType.Description = txtEntityDescription.Value.ToString().Trim(); if (id != 0) { mWorkType.IsActive = chkEntityActive.Checked; //mWorkType.ConsiderForReport = chkEntityConsiderForReport.Checked; } else { mWorkType.IsActive = true; //mWorkType.ConsiderForReport = true; } mWorkType.ConsiderForReport = chkEntityConsiderForReport.Checked; mWorkType.Reason = txtEntityReason.Value.ToString().Trim(); mWorkType.ActivityTypeId = Convert.ToInt32(drpActivity.Items[drpActivity.SelectedIndex].Value); mWorkType.LastUpdateUserId = 1; mWorkType.LastUpdateDate = DateTime.Now; // Create service and call method. WorkTypeService = AppService.Create <IWorkTypeService>(); WorkTypeService.AppManager = mAppManager; // data to update WorkTypeService.Update(mWorkType); // clear this.ClearControls(); this.CloseDialogControl(); } } catch (ValidationException ve) { // Display validation erros. this.DisplayValidationError(this.ErrorMessage(ve)); validatelocation = false; } finally { if (WorkTypeService != null) { WorkTypeService.Dispose(); } } return(validatelocation); }
public DiariesController(IWorkTypeService WorkTypeService,IDiaryService DiaryService,IProjectService ProjectService) { _WorkTypeService = WorkTypeService; _DiaryService = DiaryService; _ProjectService = ProjectService; }
public WorkTypesController(IWorkTypeService workTypeService, IUnitOfWorkAsync unitOfWork) { _workTypeService = workTypeService; _unitOfWork = unitOfWork; }
public WorkTypeController(IServiceFactory serviceFactory, IFilterServiceFactory filterServiceFactory) : base(filterServiceFactory) { _workTypeService = serviceFactory.WorkTypeService; }
public WorkTypesController (IWorkTypeService workTypeService, IUnitOfWorkAsync unitOfWork) { _workTypeService = workTypeService; _unitOfWork = unitOfWork; }