예제 #1
0
 public ActionResult Delete(ViewModel input)
 {
     var material = _repository.Find<Material>(input.EntityId);
     _repository.HardDelete(material);
     _repository.UnitOfWork.Commit();
     return null;
 }
예제 #2
0
 public ActionResult Delete(ViewModel input)
 {
     var weather = _repository.Find<Weather>(input.EntityId);
     _repository.HardDelete(weather);
     _repository.UnitOfWork.Commit();
     return null;
 }
예제 #3
0
 public ActionResult Delete(ViewModel input)
 {
     var document = _repository.Find<Document>(input.EntityId);
     _repository.HardDelete(document);
     _repository.UnitOfWork.Commit();
     return null;
 }
예제 #4
0
 public ActionResult Delete(ViewModel input)
 {
     var photo = _repository.Find<Photo>(input.EntityId);
     _repository.HardDelete(photo);
     _repository.UnitOfWork.Commit();
     return null;
 }
예제 #5
0
        public ActionResult AddEdit(ViewModel input)
        {
            var vendor = input.EntityId > 0 ? _repository.Find<Vendor>(input.EntityId) : new Vendor();
            var availableChemicals = _repository.FindAll<Chemical>().Select(x => new TokenInputDto { id = x.EntityId, name = x.Name });
            var selectedChemicals = vendor.GetAllProductsOfType("Chemical").Select(x => new TokenInputDto { id = x.EntityId, name = x.Name });
            var availableFertilizers = _repository.FindAll<Fertilizer>().Select(x => new TokenInputDto { id = x.EntityId, name = x.Name });
            var selectedFertilizers = vendor.GetAllProductsOfType("Fertilizer").Select(x => new TokenInputDto { id = x.EntityId, name = x.Name });
            var availableMaterials = _repository.FindAll<Material>().Select(x => new TokenInputDto { id = x.EntityId, name = x.Name });
            var selectedMaterials = vendor.GetAllProductsOfType("Material").Select(x => new TokenInputDto { id = x.EntityId, name = x.Name });
            var availableSeeds = _repository.FindAll<Seed>().Select(x => new TokenInputDto { id = x.EntityId, name = x.Name });
            var selectedSeeds = vendor.GetAllProductsOfType("Seed").Select(x => new TokenInputDto { id = x.EntityId, name = x.Name });

            var model = new VendorViewModel
            {
                Vendor = vendor,
                AvailableChemicals = availableChemicals,
                SelectedChemicals = selectedChemicals,
                AvailableFertilizers = availableFertilizers,
                SelectedFertilizers = selectedFertilizers,
                AvailableMaterials = availableMaterials,
                SelectedMaterials = selectedMaterials,
                AvailableSeeds = availableSeeds,
                SelectedSeeds = selectedSeeds
            };
            return PartialView("VendorAddUpdate", model);
        }
 public ActionResult Delete(ViewModel input)
 {
     var vendorContact = _repository.Find<VendorContact>(input.EntityId);
     _repository.HardDelete(vendorContact);
     _repository.UnitOfWork.Commit();
     return null;
 }
예제 #7
0
 public ActionResult Delete(ViewModel input)
 {
     var seed = _repository.Find<Seed>(input.EntityId);
     _repository.HardDelete(seed);
     _repository.UnitOfWork.Commit();
     return null;
 }
 public ActionResult Delete(ViewModel input)
 {
     var emailTemplate = _repository.Find<EmailTemplate>(input.EntityId);
     _repository.HardDelete(emailTemplate);
     _repository.UnitOfWork.Commit();
     return null;
 }
예제 #9
0
 public ActionResult Delete(ViewModel input)
 {
     //TODO needs rule engine
     var _event = _repository.Find<Event>(input.EntityId);
     _repository.HardDelete(_event);
     _repository.UnitOfWork.Commit();
     return null;
 }
예제 #10
0
 public ActionResult AddEdit(ViewModel input)
 {
     var chemical = input.EntityId > 0 ? _repository.Find<Chemical>(input.EntityId) : new Chemical();
     var model = new ChemicalViewModel
     {
         Chemical = chemical
     };
     return PartialView("ChemicalAddUpdate", model);
 }
예제 #11
0
 public ActionResult AddEdit(ViewModel input)
 {
     var material = input.EntityId > 0 ? _repository.Find<Material>(input.EntityId) : new Material();
     var model = new MaterialViewModel
     {
         Material = material
     };
     return PartialView("MaterialAddUpdate", model);
 }
예제 #12
0
 public ActionResult AddEdit(ViewModel input)
 {
     var seed = input.EntityId > 0 ? _repository.Find<Seed>(input.EntityId) : new Seed();
     var model = new SeedViewModel
     {
         Seed = seed
     };
     return PartialView("SeedAddUpdate", model);
 }
예제 #13
0
 public ActionResult AddEdit(ViewModel input)
 {
     var weather = input.EntityId > 0 ? _repository.Find<Weather>(input.EntityId) : new Weather();
     var model = new WeatherViewModel
     {
         Weather = weather,
     };
     return PartialView("WeatherAddUpdate", model);
 }
예제 #14
0
 public ActionResult AddEdit(ViewModel input)
 {
     var equipment = input.EntityId > 0 ? _repository.Find<Equipment>(input.EntityId) : new Equipment();
     var model = new EquipmentViewModel
     {
         Equipment = equipment
     };
     return PartialView("EquipmentAddUpdate", model);
 }
 public ActionResult AddEdit(ViewModel input)
 {
     var emailTemplate = input.EntityId > 0 ? _repository.Find<EmailTemplate>(input.EntityId) : new EmailTemplate();
     var model = new EmailTemplateViewModel
     {
         EmailTemplate = emailTemplate,
     };
     return PartialView("EmailTemplateAddUpdate", model);
 }
예제 #16
0
 public ActionResult Display(ViewModel input)
 {
     var material = _repository.Find<Material>(input.EntityId);
     var model = new MaterialViewModel
                     {
                         Material = material,
                         AddEditUrl = UrlContext.GetUrlForAction<MaterialController>(x => x.AddEdit(null)) + "/" + material.EntityId
                     };
     return PartialView("MaterialView", model);
 }
예제 #17
0
 public ActionResult Display(ViewModel input)
 {
     var _event = _repository.Find<Event>(input.EntityId);
     var model = new EventViewModel
                     {
                         Event = _event,
                         AddEditUrl = UrlContext.GetUrlForAction<EventController>(x => x.AddEdit(null)) + "/" + _event.EntityId
     };
     return PartialView("EventView", model);
 }
예제 #18
0
 public ActionResult AddEdit(ViewModel input)
 {
     var field = input.EntityId > 0 ? _repository.Find<Field>(input.EntityId) : new Field();
     var model = new FieldViewModel
     {
         Field = field,
         AddEditUrl = UrlContext.GetUrlForAction<FieldController>(x => x.AddEdit(null)) + "/" + field.EntityId,
     };
     return PartialView("FieldAddUpdate", model);
 }
 public ActionResult Display(ViewModel input)
 {
     var emailTemplate = _repository.Find<EmailTemplate>(input.EntityId);
     var model = new EmailTemplateViewModel
                     {
                         EmailTemplate = emailTemplate,
                         AddEditUrl = UrlContext.GetUrlForAction<EmailTemplateController>(x => x.AddEdit(null)) + "/" + emailTemplate.EntityId
                     };
     return PartialView("EmailTemplateView", model);
 }
 public ActionResult ClosePurchaseOrder(ViewModel input)
 {
     var purchaseOrder = _repository.Find<PurchaseOrder>(input.EntityId);
     purchaseOrder.Completed = true;
     purchaseOrder.GetLineItems().Where(x => !x.Completed).Each(x => x.Completed = true);
     var crudManager = _saveEntityService.ProcessSave(purchaseOrder);
     var notification = crudManager.Finish();
     notification.RedirectUrl = UrlContext.GetUrlForAction<PurchaseOrderListController>(x => x.PurchaseOrderList());
     return Json(notification, JsonRequestBehavior.AllowGet);
 }
 public ActionResult AddEdit(ViewModel input)
 {
     var vendorContact = input.EntityId > 0 ? _repository.Find<VendorContact>(input.EntityId) : new VendorContact();
     var model = new VendorContactViewModel
                     {
                         ParentId = input.ParentId > 0 ? input.ParentId : vendorContact.Vendor.EntityId,
                         VendorContact = vendorContact,
                     };
     return PartialView("VendorContactAddUpdate", model);
 }
 public ActionResult Display(ViewModel input)
 {
     var vendorContact = _repository.Find<VendorContact>(input.EntityId);
     var model = new VendorContactViewModel
                     {
                         VendorContact = vendorContact,
                         AddEditUrl = UrlContext.GetUrlForAction<VendorContactController>(x => x.AddEdit(null)) + "/" + vendorContact.EntityId
                     };
     return PartialView("VendorContactView", model);
 }
예제 #23
0
 public ActionResult Display(ViewModel input)
 {
     var document = _repository.Find<Document>(input.EntityId);
     var model = new DocumentViewModel
                     {
                         Document = document,
                         AddEditUrl = UrlContext.GetUrlForAction<DocumentController>(x => x.AddUpdate(null)) + "/" + document.EntityId
                     };
     return View(model);
 }
예제 #24
0
 public ActionResult Display(ViewModel input)
 {
     var photo = _repository.Find<Photo>(input.EntityId);
     var model = new PhotoViewModel
                     {
                         Photo = photo,
                         AddEditUrl = UrlContext.GetUrlForAction<PhotoController>(x => x.AddUpdate(null)) + "/" + photo.EntityId
                     };
     return View(model);
 }
예제 #25
0
 public ActionResult Display(ViewModel input)
 {
     var seed = _repository.Find<Seed>(input.EntityId);
     var model = new SeedViewModel
     {
         Seed = seed,
         AddEditUrl = UrlContext.GetUrlForAction<SeedController>(x => x.AddEdit(null)) + "/" + seed.EntityId
     };
     return PartialView("SeedView", model);
 }
예제 #26
0
 public ActionResult Display(ViewModel input)
 {
     var weather = _repository.Find<Weather>(input.EntityId);
     var model = new WeatherViewModel
                     {
                         Weather = weather,
                         AddEditUrl = UrlContext.GetUrlForAction<WeatherController>(x => x.AddEdit(null)) + "/" + weather.EntityId
                     };
     return PartialView("WeatherView", model);
 }
예제 #27
0
 public ActionResult AddUpdate(ViewModel input)
 {
     var photo = input.EntityId > 0 ? _repository.Find<Photo>(input.EntityId) : new Photo();
     var categoryItems = _selectListItemService.CreateList<PhotoCategory>(x=>x.Name,x=>x.EntityId,true);
     var model = new PhotoViewModel
     {
         Photo = photo,
         PhotoCategoryList =categoryItems
     };
     return View(model);
 }
예제 #28
0
 public ActionResult AddUpdate(ViewModel input)
 {
     var document = input.EntityId > 0 ? _repository.Find<Document>(input.EntityId) : new Document();
     var categoryItems = _selectListItemService.CreateList<DocumentCategory>(x=>x.Name,x=>x.EntityId,true);
     var model = new DocumentViewModel
     {
         Document = document,
         DocumentCategoryList =categoryItems
     };
     return View(model);
 }
예제 #29
0
        public ActionResult AddEdit(ViewModel input)
        {
            var employee = input.EntityId > 0 ? _repository.Find<Employee>(input.EntityId) : new Employee();
            SelectBoxPickerDto selectorDto = _selectBoxPickerService.GetPickerDto<UserRole>(employee.UserRoles.IsNotEmpty()?employee.UserRoles.Split(','):new string[0]);

            var model = new EmployeeViewModel
            {
                Employee = employee,
                UserRoleSelectBoxPickerDto = selectorDto
            };
            return PartialView("EmployeeAddUpdate", model);
        }
 public ActionResult PurchaseOrderCommit(ViewModel input)
 {
     var purchaseOrder = _repository.Find<PurchaseOrder>(input.ParentId);
     var url = UrlContext.GetUrlForAction<PurchaseOrderCommitController>(x => x.PurchaseOrderLineItems(null))+"?EntityId="+input.ParentId;
     POCommitViewModel model = new POCommitViewModel()
     {
         ClosePOUrl = UrlContext.GetUrlForAction<PurchaseOrderCommitController>(x=>x.ClosePurchaseOrder(null)),
         PurchaseOrder = purchaseOrder,
         ListDefinition = _receivePurchaseOrderLineItemGrid.GetGridDefinition(url)
     };
     return View("PurchaseOrderCommit",model);
 }