public ActionResult DeleteConfirmed(int id)
        {
            ChangeQualityPlan changeQualityPlan = Mapper.Map <ChangeQualityPlan>(changeQualityPlanService.Get(id));

            changeQualityPlan.IsDeleted = true;
            changeQualityPlanService.Update(changeQualityPlan);
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "Id,QualityPlanId,MaterialId,CriterionId,IsDynamic,IsDetailed,UnitId,CertificateId,Level,Contrafactor,AQL,ProductionEquipmentName,NominalSize,MaxSize,MinSize,PurchasingControl,ProductionControl,Description,CreatedBy,CreatedAt,UpdatedBy,UpdatedAt,IsDeleted,DeletedBy,DeletedAt,IsActive,IpAddress,UserAgent,Location")] ChangeQualityPlan changeQualityPlan)
 {
     if (ModelState.IsValid)
     {
         var entity = Mapper.Map <ChangeQualityPlan>(changeQualityPlan);
         changeQualityPlanService.Update(entity);
         return(RedirectToAction("Index"));
     }
     ViewBag.CertificateId         = new SelectList(certificateService.GetAll(), "Id", "Name", changeQualityPlan.CertificateId);
     ViewBag.CriterionId           = new SelectList(certificateService.GetAll(), "Id", "Name", changeQualityPlan.CriterionId);
     ViewBag.MaterialId            = new SelectList(materialService.GetAll(), "Id", "Name", changeQualityPlan.MaterialId);
     ViewBag.QualityPlanId         = new SelectList(qualityPlanService.GetAll(), "Id", "Description", changeQualityPlan.QualityPlanId);
     ViewBag.UnitId                = new SelectList(unitService.GetAll(), "Id", "Name", changeQualityPlan.UnitId);
     ViewBag.ProductionEquipmentId = new SelectList(productionEquipmentService.GetAll(), "Id", "Name", changeQualityPlan.ProductionEquipmentId);
     return(View(changeQualityPlan));
 }
예제 #3
0
 public void Update(ChangeQualityPlan changeQualityPlan)
 {
     changeQualityPlanRepository.Update(changeQualityPlan);
     unitOfWork.SaveChanges();
 }
예제 #4
0
 public void Insert(ChangeQualityPlan changeQualityPlan)
 {
     changeQualityPlanRepository.Insert(changeQualityPlan);
     unitOfWork.SaveChanges();
 }