public MainWindowViewModel() { var mediumViewModel = new MediumViewModel(); MediumViewUserControl = new MediumView { DataContext = mediumViewModel }; _gitHubViewModel = new GitHubViewModel(); GitHubViewUserControl = new GitHubView { DataContext = _gitHubViewModel }; _linkedInViewModel = new LinkedInViewModel(); LinkedInViewUserControl = new LinkedInView { DataContext = _linkedInViewModel }; _checkListViewModel = new CheckListViewModel(); CheckListViewUserControl = new CheckListView { DataContext = _checkListViewModel }; SearchCommand = new RelayCommand(ExecuteSearchCommand); }
public ActionResult CreateUpdateChecklist(CheckListViewModel checklist) { var nlist = new ListRequest() { Coments = checklist.Coments, ConsortiumId = checklist.ConsortiumId, Customer = checklist.Customer, Tasks = new List <TaskListRequest>(), OpenDate = DateTime.Now, Id = checklist.Id }; var statusList = this.StatusService.GetAll(); var TaskResults = this.TaskResultService.GetAll(); foreach (var task in checklist.Tasks) { var ntask = new TaskListRequest() { Id = task.Id, Coments = task.Coments, Description = task.Description, ResultId = task.IsSuccess ? TaskResults.Where(x => x.Description.Equals("success")).FirstOrDefault().Id : TaskResults.Where(x => x.Description.Equals("failed")).FirstOrDefault().Id, StatusId = !task.IsSuccess ? statusList.Where(x => x.Description.Equals("open")).FirstOrDefault().Id : statusList.Where(x => x.Description.Equals("closed")).FirstOrDefault().Id }; nlist.Tasks.Add(ntask); } try { var result = false; if (nlist.Id == 0) { result = this.ChecklistService.CreateList(nlist); } else { result = this.ChecklistService.UpdateList(nlist); } if (result) { return(Redirect(string.Format("/Consortium/Details/{0}", checklist.ConsortiumId))); } else { return(View("../Shared/Error")); } } catch (Exception ex) { return(View("../Shared/Error")); } }
async void Delete() { var response = await dialogService.ShowConfirm( Languages.Confirm, Languages.ConfirmationDelete + "CheckList" + " ?"); if (!response) { return; } await CheckListViewModel.GetInstance().Delete(this); }
public async Task <IActionResult> Save([FromBody] CheckListViewModel checkListViewModel) { if (checkListViewModel == default(CheckListViewModel)) { return(BadRequest()); } var result = await _checkListBusiness.UpdateCheckList(checkListViewModel.CheckListMap()); if (result == null || (result != null && result.CheckListId < 1)) { return(BadRequest()); } return(Ok(checkListViewModel)); }
public async Task <IActionResult> Add(CheckListViewModel model) { var task = await TaskRepository.FindAsync(model.TaskId); var info = new CheckList { TaskId = task.Id, WeekNumber = model.WeekNumber, Checked = false }; ChecklistRepository.Add(info); return(Redirect(nameof(Index))); }
public async Task <IActionResult> Post([FromBody] CheckListViewModel checkListViewModel) { if (checkListViewModel == default(CheckListViewModel)) { return(BadRequest()); } var result = await _checkListBusiness.CreateCheckList(checkListViewModel.CheckListMap()); if (result == null || (result != null && result.CheckListId < 1)) { return(BadRequest()); } checkListViewModel.ChecklistId = result.CheckListId; return(Created(Request.Path, checkListViewModel)); }
public ActionResult CreateChecklist(int id) { var consortium = this.ConsortiumService.GetConsortium(id); var customer = consortium.Managers.Count > 0 ? consortium.Managers.Where(x => !x.IsAlternate).FirstOrDefault() != null? consortium.Managers.Where(x => !x.IsAlternate).FirstOrDefault().User.Name + " " + consortium.Managers.Where(x => !x.IsAlternate).FirstOrDefault().User.Surname : consortium.Managers.Where(x => x.IsAlternate).FirstOrDefault().User.Name + " " + consortium.Managers.Where(x => x.IsAlternate).FirstOrDefault().User.Surname : consortium.FriendlyName; var checklistvm = new CheckListViewModel() { Customer = customer, ConsortiumId = consortium.Id }; checklistvm.Tasks = new List <TaskListViewModel>(); var items = this.ChecklistService.GetItems(); var TaskResults = this.TaskResultService.GetAll().Select(x => new SelectListItem() { Value = x.Id.ToString(), Text = x.Description }); var statusList = this.StatusService.GetAll().Select(x => new SelectListItem() { Value = x.Id.ToString(), Text = x.Description }); foreach (var item in items) { checklistvm.Tasks.Add( new TaskListViewModel() { Results = TaskResults, StatusList = statusList, Description = item.Description }); } return(View(checklistvm)); }
public ViewResult List(int?offset, int?limit) { if (offset == null) { offset = 0; } if (limit == null) { limit = 10; } var checkLists = _checkListRepository.GetAll(offset.Value, limit.Value); var statuses = _sr.GetAll(); var clvm = new CheckListViewModel() { Checklists = checkLists, Statuses = statuses }; return(View(clvm)); }
public async Task <IList <CheckListViewModel> > getGrowthStepPointCheckList(BasicSurveyReportViewModel paramModel, string quesCheckListSmallClassCd) { //사업참여 기업들의 레벨(창업보육, 보육성장, 자립성장) 분류 Dictionary <int, int> dicStartUp = new Dictionary <int, int>(); Dictionary <int, int> dicGrowth = new Dictionary <int, int>(); Dictionary <int, int> dicIndependent = new Dictionary <int, int>(); SqlParameter numSn = new SqlParameter("NUM_SN", paramModel.NumSn); object[] parameters = new object[] { numSn }; var curBizWorkObj = await procMngService.getBizWorkInfoByBizWorkSn(parameters); //var curBizWork = await scBizWorkService.GetBizWorkByBizWorkSn(int.Parse(paramModel.NumSn)); { //var compMappings = curBizWork.ScCompMappings.Where(sc => sc.Status == "A"); foreach (var compMapping in curBizWorkObj) { var quesMasters = await quesMasterService.GetQuesMasterAsync(compMapping.REGISTRATION_NO, paramModel.BizWorkYear); if (quesMasters == null) { continue; } //다래 재무정보 유무 체크하는 로직 추가해야함.(문진표정보, 재무정보가 있어야 보고서 생성가능.) //다래 재무정보 조회해야 함. var scFinancialIndexT = await scFinancialIndexTService.getScFinancialIndexTAsync(compMapping.COMP_SN, paramModel.BizWorkYear.ToString()); if (scFinancialIndexT == null) { continue; } //var sboFinacialIndexT = await sboFinancialIndexTService.GetSHUSER_SboFinancialIndexT(compMapping.ScCompInfo.RegistrationNo, ConfigurationManager.AppSettings["CorpCode"], ConfigurationManager.AppSettings["BizCode"], paramModel.BizWorkYear.ToString()); //if (sboFinacialIndexT == null) //{ // continue; //} //종합점수 조회하여 분류별로 딕셔너리 저장 var point = await GetCompanyTotalPoint(quesMasters.QuestionSn, scFinancialIndexT); if (point >= 0 && point <= 50) { dicStartUp.Add(compMapping.COMP_SN, quesMasters.QuestionSn); } else if (point > 50 && point <= 75) { dicGrowth.Add(compMapping.COMP_SN, quesMasters.QuestionSn); } else { dicIndependent.Add(compMapping.COMP_SN, quesMasters.QuestionSn); } } } //리스트 데이터 생성 var quesResult1s = await quesResult1Service.GetQuesResult1sAsync(paramModel.QuestionSn, quesCheckListSmallClassCd); int count = 1; var CheckList = new List <CheckListViewModel>(); foreach (var item in quesResult1s) { CheckListViewModel checkListViewModel = new CheckListViewModel(); checkListViewModel.Count = count.ToString(); checkListViewModel.AnsVal = item.AnsVal.Value; checkListViewModel.DetailCd = item.QuesCheckList.DetailCd; checkListViewModel.Title = item.QuesCheckList.ReportTitle; //창업보육단계 평균 int startUpCnt = await GetCheckListCnt(dicStartUp, checkListViewModel.DetailCd); checkListViewModel.StartUpAvg = Math.Round(((startUpCnt + item.QuesCheckList.StartUpStep.Value + 0.0) / (50 + dicStartUp.Count)) * 100, 0).ToString(); //보육성장단계 평균 int growthCnt = await GetCheckListCnt(dicGrowth, checkListViewModel.DetailCd); checkListViewModel.GrowthAvg = Math.Round(((growthCnt + item.QuesCheckList.GrowthStep.Value + 0.0) / (46 + dicGrowth.Count)) * 100, 0).ToString(); //자립성장단계 평균 int IndependentCnt = await GetCheckListCnt(dicIndependent, checkListViewModel.DetailCd); checkListViewModel.IndependentAvg = Math.Round(((IndependentCnt + item.QuesCheckList.IndependentStep.Value + 0.0) / (4 + dicIndependent.Count)) * 100, 0).ToString(); //참여기업 평균 checkListViewModel.BizInCompanyAvg = Math.Round(((IndependentCnt + growthCnt + startUpCnt + 0.0) / (dicStartUp.Count + dicGrowth.Count + dicIndependent.Count)) * 100, 0).ToString(); //전체 평균 checkListViewModel.TotalAvg = Math.Round(((IndependentCnt + growthCnt + startUpCnt + item.QuesCheckList.TotalStep.Value + 0.0) / (100 + dicStartUp.Count + dicGrowth.Count + dicIndependent.Count)) * 100, 0).ToString(); CheckList.Add(checkListViewModel); count++; } return(CheckList); }
public async Task <IActionResult> Index(int?subunit, int?sector, string query, int page = 1, SortStateCheck sortOrder = SortStateCheck.FailCountAsc) { int pageSize = 10; IQueryable <Check> checks = db.Check.Include(c => c.RegWorkerNavigation) .Include(c => c.RegWorkerNavigation.Sector) .Include(c => c.RegWorkerNavigation.Sector.Subunit) .Include(c => c.Sector) .Include(c => c.Sector.Subunit) .Include(c => c.Events); checks = checks.Where(c => c.IsActive && c.IsCorrect); if (User.IsInRole("REG") && !User.IsInRole("CHECK_DETAIL") && !User.IsInRole("CONTROL")) { Worker worker = await _userManager.FindByNameAsync(User.Identity.Name); if (worker != null) { checks = checks.Where(c => c.RegWorker == worker.Id); } } else if (User.IsInRole("CHECK_DETAIL") && !User.IsInRole("CONTROL")) { Worker worker = await _userManager.FindByNameAsync(User.Identity.Name); if (worker != null) { db.Entry(worker).Reference(w => w.Sector).Load(); checks = checks.Where(c => c.Sector.SubunitId == worker.Sector.SubunitId || c.RegWorker == worker.Id); } } if (subunit != null && subunit != 0) { checks = checks.Where(c => c.Sector.SubunitId == subunit); if (sector != null && sector != 0) { checks = checks.Where(c => c.SectorId == sector); } } if (!String.IsNullOrEmpty(query)) { checks = checks.Where(c => c.FailCount.ToUpper().Contains(query.ToUpper()) || c.RegWorkerNavigation.Family.ToUpper().Contains(query.ToUpper()) || c.ControlIndicator.ToUpper().Contains(query.ToUpper()) || c.FailDescription.ToUpper().Contains(query.ToUpper()) || c.RegWorkerNavigation.Sector.Subunit.Name.ToUpper().Contains(query.ToUpper()) ); } checks = sortOrder switch { SortStateCheck.FailCountDesc => checks.OrderByDescending(c => c.FailCount), SortStateCheck.CheckSubunitAsc => checks.OrderBy(c => c.Sector.Subunit.Name), SortStateCheck.CheckSubunitDesc => checks.OrderByDescending(c => c.Sector.Subunit.Name), SortStateCheck.CheckDateAsc => checks.OrderBy(c => c.CheckDate), SortStateCheck.CheckDateDesc => checks.OrderByDescending(c => c.CheckDate), SortStateCheck.SectorAsc => checks.OrderBy(c => c.Sector.SectorName), SortStateCheck.SectorDesc => checks.OrderByDescending(c => c.Sector.SectorName), SortStateCheck.RegWorkerAsc => checks.OrderBy(c => c.RegWorkerNavigation.Family), SortStateCheck.RegWorkerDesc => checks.OrderByDescending(c => c.RegWorkerNavigation.Family), SortStateCheck.ControlIndicatorAsc => checks.OrderBy(c => c.ControlIndicator), SortStateCheck.ControlIndicatorDesc => checks.OrderByDescending(c => c.ControlIndicator), SortStateCheck.FailDescriptionAsc => checks.OrderBy(c => c.FailDescription), SortStateCheck.FailDescriptionDesc => checks.OrderByDescending(c => c.FailDescription), SortStateCheck.RegSubunitAsc => checks.OrderBy(c => c.RegWorkerNavigation.Sector.Subunit.Name), SortStateCheck.RegSubunitDesc => checks.OrderByDescending(c => c.RegWorkerNavigation.Sector.Subunit.Name), _ => checks.OrderBy(c => c.FailCount), }; var count = await checks.CountAsync(); var items = await checks.Skip((page - 1) *pageSize).Take(pageSize).ToListAsync(); CheckListViewModel model = new CheckListViewModel { PageViewModel = new PageViewModel(count, page, pageSize), SortViewModel = new SortCheckViewModel(sortOrder), FilterViewModel = new FilterCheckViewModel(db.Subunits.ToList(), db.Sectors.ToList(), subunit, sector, query), Checks = items }; return(View(model)); }
public CheckListPage() { InitializeComponent(); BindingContext = new CheckListViewModel(); }
public CheckListSource(CheckListViewModel vm, UITableView tableView, string nibName, string cellIdentifier = null) : base(tableView, nibName, cellIdentifier) { _vm = vm; }
public async Task <IActionResult> CheckList(int?subunit, int?sector, int?deleted, string query, int page = 1, SortStateCheck sortOrder = SortStateCheck.FailCountAsc) { int pageSize = 10; IQueryable <Check> checks = db.Check.Include(c => c.RegWorkerNavigation) .Include(c => c.RegWorkerNavigation.Sector) .Include(c => c.RegWorkerNavigation.Sector.Subunit) .Include(c => c.Sector) .Include(c => c.Sector.Subunit) .Include(c => c.Events); if (subunit != null && subunit != 0) { checks = checks.Where(c => c.Sector.SubunitId == subunit); if (sector != null && sector != 0) { checks = checks.Where(c => c.SectorId == sector); } } switch (deleted) { case 1: checks = checks.Where(c => c.IsActive && c.IsCorrect); break; case 2: checks = checks.Where(c => !c.IsActive); break; case 3: checks = checks.Where(c => !c.IsCorrect); break; } if (!String.IsNullOrEmpty(query)) { checks = checks.Where(c => c.FailCount.ToUpper().Contains(query.ToUpper()) || c.RegWorkerNavigation.Family.ToUpper().Contains(query.ToUpper()) || c.ControlIndicator.ToUpper().Contains(query.ToUpper()) || c.FailDescription.ToUpper().Contains(query.ToUpper()) || c.RegWorkerNavigation.Sector.Subunit.Name.ToUpper().Contains(query.ToUpper()) ); } switch (sortOrder) { case SortStateCheck.FailCountDesc: checks = checks.OrderByDescending(c => c.FailCount); break; case SortStateCheck.CheckSubunitAsc: checks = checks.OrderBy(c => c.Sector.Subunit.Name); break; case SortStateCheck.CheckSubunitDesc: checks = checks.OrderByDescending(c => c.Sector.Subunit.Name); break; case SortStateCheck.CheckDateAsc: checks = checks.OrderBy(c => c.CheckDate); break; case SortStateCheck.CheckDateDesc: checks = checks.OrderByDescending(c => c.CheckDate); break; case SortStateCheck.SectorAsc: checks = checks.OrderBy(c => c.Sector.SectorName); break; case SortStateCheck.SectorDesc: checks = checks.OrderByDescending(c => c.Sector.SectorName); break; case SortStateCheck.RegWorkerAsc: checks = checks.OrderBy(c => c.RegWorkerNavigation.Family); break; case SortStateCheck.RegWorkerDesc: checks = checks.OrderByDescending(c => c.RegWorkerNavigation.Family); break; case SortStateCheck.ControlIndicatorAsc: checks = checks.OrderBy(c => c.ControlIndicator); break; case SortStateCheck.ControlIndicatorDesc: checks = checks.OrderByDescending(c => c.ControlIndicator); break; case SortStateCheck.FailDescriptionAsc: checks = checks.OrderBy(c => c.FailDescription); break; case SortStateCheck.FailDescriptionDesc: checks = checks.OrderByDescending(c => c.FailDescription); break; case SortStateCheck.RegSubunitAsc: checks = checks.OrderBy(c => c.RegWorkerNavigation.Sector.Subunit.Name); break; case SortStateCheck.RegSubunitDesc: checks = checks.OrderByDescending(c => c.RegWorkerNavigation.Sector.Subunit.Name); break; case SortStateCheck.DeleteReasonAsc: checks = checks.OrderBy(c => c.IsActive).OrderBy(c => c.IsCorrect); break; case SortStateCheck.DeleteReasonDesc: checks = checks.OrderByDescending(c => c.IsActive).OrderByDescending(c => c.IsCorrect); break; default: checks = checks.OrderBy(c => c.FailCount); break; } var count = await checks.CountAsync(); var items = await checks.Skip((page - 1) *pageSize).Take(pageSize).ToListAsync(); CheckListViewModel model = new CheckListViewModel { PageViewModel = new PageViewModel(count, page, pageSize), SortViewModel = new SortCheckViewModel(sortOrder), FilterViewModel = new FilterCheckViewModel(db.Subunits.ToList(), db.Sectors.ToList(), subunit, sector, query, deleted), Checks = items }; return(View(model)); }