public async Task <IActionResult> Edit(int id, [Bind("JobAssignmentsId,JobCode,Id,AssignemtDate")] JobAssignments jobAssignments)
        {
            if (id != jobAssignments.JobAssignmentsId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(jobAssignments);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!JobAssignmentsExists(jobAssignments.JobAssignmentsId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["Id"]      = new SelectList(_context.Employees, "Id", "Email", jobAssignments.Id);
            ViewData["JobCode"] = new SelectList(_context.Jobs, "JobCode", "JobCode", jobAssignments.JobCode);
            return(View(jobAssignments));
        }
예제 #2
0
        public void ProcessMachinesPermutation()
        {
            //PrintJobAssignments();
            _utils = new JobsProcessingUtils(X.Length)
            {
                jobsPermutation = X,
                jobAssignments  = JobAssignments
            };
            var cMax = _utils.FindCMax();

            var jobs = new Neighbor
            {
                Cmax            = cMax,
                JobsPermutation = X.ClonedInstance(),
                JobsAssignment  = JobAssignments.ClonedInstance()
            };

            if (ResultCmax > cMax)
            {
                ResultCmax           = cMax;
                ResultJobAssignments = JobAssignments.ClonedInstance();
                ResultJobPermutation = X.ClonedInstance();


                Results = new List <Neighbor>(); // clear list alternative results
            }
            else if (ResultCmax == cMax)
            {
                Results.Add(jobs); // add same job config for optimal Cmax
            }
        }
        public async Task <IActionResult> Create([Bind("JobAssignmentsId,JobCode,Id,AssignemtDate")] JobAssignments jobAssignments)
        {
            if (ModelState.IsValid)
            {
                _context.Add(jobAssignments);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["Id"]      = new SelectList(_context.Employees, "Id", "Email", jobAssignments.Id);
            ViewData["JobCode"] = new SelectList(_context.Jobs, "JobCode", "JobCode", jobAssignments.JobCode);
            return(View(jobAssignments));
        }
예제 #4
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }

            if (obj == this)
            {
                return(true);
            }

            return(obj is WageSetting other &&
                   ((TeamMemberId == null && other.TeamMemberId == null) || (TeamMemberId?.Equals(other.TeamMemberId) == true)) &&
                   ((JobAssignments == null && other.JobAssignments == null) || (JobAssignments?.Equals(other.JobAssignments) == true)) &&
                   ((IsOvertimeExempt == null && other.IsOvertimeExempt == null) || (IsOvertimeExempt?.Equals(other.IsOvertimeExempt) == true)) &&
                   ((Version == null && other.Version == null) || (Version?.Equals(other.Version) == true)) &&
                   ((CreatedAt == null && other.CreatedAt == null) || (CreatedAt?.Equals(other.CreatedAt) == true)) &&
                   ((UpdatedAt == null && other.UpdatedAt == null) || (UpdatedAt?.Equals(other.UpdatedAt) == true)));
        }
예제 #5
0
        public override int GetHashCode()
        {
            int hashCode = -742786902;

            if (TeamMemberId != null)
            {
                hashCode += TeamMemberId.GetHashCode();
            }

            if (JobAssignments != null)
            {
                hashCode += JobAssignments.GetHashCode();
            }

            if (IsOvertimeExempt != null)
            {
                hashCode += IsOvertimeExempt.GetHashCode();
            }

            if (Version != null)
            {
                hashCode += Version.GetHashCode();
            }

            if (CreatedAt != null)
            {
                hashCode += CreatedAt.GetHashCode();
            }

            if (UpdatedAt != null)
            {
                hashCode += UpdatedAt.GetHashCode();
            }

            return(hashCode);
        }