public virtual ActionResult DelaysEdit(string operationNumber) // GET: /Delays/Edit/ { var model = ClientDelayArchievementRepository.LoadEditDelays(operationNumber, Language.EN); var ListDelaysType = ClientDelayArchievementRepository.GetTypesDelay(Language.EN); var ListOutputs = ClientDelayArchievementRepository.GetListOutputs(operationNumber); var ListOutcomes = ClientDelayArchievementRepository.GetListOutComes(operationNumber); var ListCycles = ClientDelayArchievementRepository.GetCycles(Language.EN, operationNumber); var ListNoNameDelays = new Dictionary <int, string>(); var ListIsSolved = new Dictionary <bool, string>(); ListIsSolved.Add(true, Localization.GetText("Yes")); ListIsSolved.Add(false, Localization.GetText("No")); ListNoNameDelays.Add(0, "No data fount"); if (ListDelaysType.Count > 0) { ViewBag.NoData = true; } ViewBag.ListDelaysType = new SelectList(ListDelaysType, "ConvergenceMasterDataID", "Name"); ViewBag.ListIsSolved = new SelectList(ListIsSolved, "key", "value"); ViewBag.ListNoNameDelays = new SelectList(ListNoNameDelays, "key", "value"); ViewBag.ListOutputs = new SelectList(ListOutputs, "value", "value"); ViewBag.ListOutcomes = new SelectList(ListOutcomes, "value", "value"); ViewBag.ListCycles = new SelectList(ListCycles, "ItemId", "Name"); return(View(model)); }
public virtual JsonResult LoadOutputsDelays(DelaysEditModel ModelDelay) { var ListOutputsDelays = ClientDelayArchievementRepository.GetListOutputs(ModelDelay.OperationNumber).ToList(); return(new JsonResult() { Data = ListOutputsDelays }); }
public virtual JsonResult GetOutputsDelays(string operationNumber) { var outputsDelays = ClientDelayArchievementRepository .GetListOutputs(operationNumber); var data = outputsDelays.Select(x => new { ConvergenceMasterDataId = x.Key, NameEn = x.Value }); return(new JsonResult() { Data = data }); }
public virtual ActionResult DetailsDelays(string operationNumber, int State = 0, string Type = "0", string Name = "Name", string Solved = "null", string cycleIdList = null) //DETAILS: /Delays { if (cycleIdList == "null") { cycleIdList = null; } var ModelDelaysArchitecture = ClientDelayArchievementRepository.GetDelays(operationNumber, Language.EN, Type, Name, Solved, cycleIdList); var ListCycles = ClientDelayArchievementRepository.GetCycles(Language.EN, operationNumber); ViewBag.IsCurrentCycleTableOne = true; ViewBag.IsCurrentCycleTableTwo = true; foreach (var itemAchievementDelays in ModelDelaysArchitecture.AchievementDelays) { itemAchievementDelays.StateIsSolved = itemAchievementDelays.IsSolved == true?Localization.GetText("Yes") : Localization.GetText("No"); ViewBag.IsCurrentCycleTableOne = itemAchievementDelays.IsCurrentCycle; } foreach (var itemOtherDelays in ModelDelaysArchitecture.OtherDelays) { itemOtherDelays.StateIsSolved = itemOtherDelays.IsSolved == true?Localization.GetText("Yes") : Localization.GetText("No"); ViewBag.IsCurrentCycleTableTwo = itemOtherDelays.IsCurrentCycle; } if (State != 0) { MessageConfiguration message = MessageHandler.setMessageFindingDelays(State, false, 2); ViewData["message"] = message; } /*FILTER ELEMENTS*/ var ListDelaysType = ClientDelayArchievementRepository.GetTypesDelay(Language.EN); Dictionary <int, string> ListOutputs = new Dictionary <int, string>(); Dictionary <int, string> ListOutcomes = new Dictionary <int, string>(); ListOutputs.Add(0, Localization.GetText("Name")); ListOutcomes.Add(0, Localization.GetText("Name")); var ResultOP = ClientDelayArchievementRepository.GetListOutputs(operationNumber); var ResultOC = ClientDelayArchievementRepository.GetListOutComes(operationNumber); foreach (var data in ResultOP) { if (data.Key != 0) { ListOutputs.Add(data.Key, data.Value); } } foreach (var data in ResultOC) { if (data.Key != 0) { ListOutcomes.Add(data.Key, data.Value); } } var ListIsSolved = new Dictionary <string, string>(); Dictionary <int, string> ListOutputsss = new Dictionary <int, string>(); ListDelaysType.Reverse(); ListDelaysType.Add(new MW.Domain.Models.Architecture.MasterDefinitions.ConvergenceMasterDataModel() { ParentConvergenceMasterDataId = -1, Name = @Localization.GetText("Type of delay") }); ListDelaysType.Reverse(); ListIsSolved.Add("null", Localization.GetText("Is the issue solved?")); ListIsSolved.Add(true.ToString(), Localization.GetText("Yes")); ListIsSolved.Add(false.ToString(), Localization.GetText("No")); ListCycles.Reverse(); ListCycles.RemoveAt(0); ListCycles.Reverse(); ListCycles.Add(new FilterItemModel { ItemId = int.MaxValue, Name = Localization.GetText("All Cycles") }); ListCycles.Add(new FilterItemModel { ItemId = 0, Name = Localization.GetText("Current Cycle") }); ListCycles.Reverse(); ViewBag.ListDelaysType = new SelectList(ListDelaysType, "ConvergenceMasterDataID", "Name"); ViewBag.ListIsSolved = new SelectList(ListIsSolved, "key", "value"); ViewBag.ListOutputs = new SelectList(ListOutputs, "value", "value"); ViewBag.ListOutcomes = new SelectList(ListOutcomes, "value", "value"); ViewBag.ListCycles = new SelectList(ListCycles, "ItemId", "Name"); /*FILTER ELEMENTS*/ ViewBag.isLessTaskFive = PCRHelpers.IsCurrentTaskLessThanFive( ReportsRepository, PCRWorkflowStatusRepository); ViewBag.RMAdministrator = IDBContext.Current.HasRole(Role.RM_ADMINISTRATOR); return(View(ModelDelaysArchitecture)); }