Пример #1
0
        public ActionResult Owner(int?physicalEntityPK)
        {
            IPhysicalEntitiesRepository physicalEntitiesRepository = new PhysicalEntitiesRepository(db);

            if (physicalEntityPK != null)
            {
                PhysicalEntity physicalEntity = physicalEntitiesRepository.GetPhysicalEntityByPK((int)physicalEntityPK);

                physicalEntity.Owner = true;

                physicalEntitiesRepository.SaveChanges();
            }

            return(Redirect(Request.UrlReferrer.AbsoluteUri));
        }
Пример #2
0
        public ActionResult UnLegalRepresentative(int?physicalEntityPK)
        {
            IPhysicalEntitiesRepository physicalEntitiesRepository = new PhysicalEntitiesRepository(db);

            if (physicalEntityPK != null)
            {
                PhysicalEntity physicalEntity = physicalEntitiesRepository.GetPhysicalEntityByPK((int)physicalEntityPK);

                physicalEntity.LegalRepresentative = false;

                physicalEntitiesRepository.SaveChanges();
            }

            return(Redirect(Request.UrlReferrer.AbsoluteUri));
        }
Пример #3
0
        public ActionResult Delete(int?physicalEntityPK)
        {
            IPhysicalEntitiesRepository physicalEntitiesRepository = new PhysicalEntitiesRepository(db);

            if (physicalEntityPK != null)
            {
                PhysicalEntity physicalEntity = physicalEntitiesRepository.GetPhysicalEntityByPK((int)physicalEntityPK);

                physicalEntity.Deleted = true;

                physicalEntitiesRepository.SaveChanges();

                TempData["message"] = LayoutHelper.GetMessage("DELETE", physicalEntity.PhysicalEntityPK);
            }

            return(Redirect(Request.UrlReferrer.AbsoluteUri));
        }
Пример #4
0
        public ActionResult Edit(PhysicalEntityView physicalEntityView, FormCollection form)
        {
            if (ModelState.IsValid)
            {
                IPhysicalEntitiesRepository physicalEntitiesRepository = new PhysicalEntitiesRepository(db);
                PhysicalEntity physicalEntity = physicalEntitiesRepository.GetPhysicalEntityByPK((int)physicalEntityView.PhysicalEntityPK);
                physicalEntityView.ConvertTo(physicalEntityView, physicalEntity);

                physicalEntitiesRepository.SaveChanges();

                TempData["message"] = LayoutHelper.GetMessage("UPDATE", physicalEntity.PhysicalEntityPK);

                return(RedirectToAction("Index", "PhysicalEntity"));
            }
            else
            {
                physicalEntityView.BindDDLs(physicalEntityView, db);

                return(View(physicalEntityView));
            }
        }