コード例 #1
0
 public OperatorEditVM(Oper oper, List <Shift> shift, List <Certification> certification, OperatorCertifications operatorCertifications)
 {
     Oper                   = oper;
     Shift                  = shift;
     Certification          = certification;
     OperatorCertifications = operatorCertifications;
 }
コード例 #2
0
        //Add Certification to Operator
        public IActionResult AddCertToOper(Oper oper, OperatorCertifications operatorCertifications)
        {
            var newOperatorCertifications = new OperatorCertifications();

            newOperatorCertifications.OperatorId      = oper.OperatorId;
            newOperatorCertifications.CertificationId = operatorCertifications.CertificationId;
            db.OperatorCertifications.Add(newOperatorCertifications);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #3
0
        //Edit Operator GET
        public IActionResult Edit(int id)
        {
            var                    thisOperator           = db.Operators.FirstOrDefault(x => x.OperatorId == id);
            List <Shift>           shifts                 = db.Shifts.ToList();
            List <Certification>   certifications         = db.Certifications.ToList();
            OperatorCertifications operatorCertifications = new OperatorCertifications();
            OperatorEditVM         VM = new OperatorEditVM(thisOperator, shifts, certifications, operatorCertifications);

            return(View(VM));
        }