private void FillPod() { IPodRepository podRepository = new PodRepository(); var pods = podRepository.GetUnallocatedPods(); PodCheckboxList.DataSource = pods; PodCheckboxList.DataTextField = "Name"; PodCheckboxList.DataValueField = "Id"; PodCheckboxList.DataBind(); }
public long CreateFranchisee(FranchiseeEditModel model) { var organizationId = Create(model); if (model.AllocatedPods != null) { var podRepository = new PodRepository(); podRepository.AssignGivenPodstoaFranchisee(model.AllocatedPods.Select(pod => pod.Id).ToArray(), organizationId); } return(organizationId); }
public FranchiseeEditModel GetFranchiseeCreateModel(long id) { var franchiseeModel = new FranchiseeEditModel(); AddressEditModel billingAddress, businessAddress; File teamImage, logoImage; Organization organization = GetDomainforOrganizationCreateModel(id, out billingAddress, out businessAddress, out teamImage, out logoImage); var binder = new OrganizationCreateModelBinder(); franchiseeModel = binder.ToModel(franchiseeModel, organization, billingAddress, businessAddress, logoImage, teamImage) as FranchiseeEditModel; var podReposirotry = new PodRepository(); var pods = podReposirotry.GetPodsAssignedToFranchisee(id); if (pods != null && pods.Count > 0) { franchiseeModel.AllocatedPods = pods.ToArray(); } return(franchiseeModel); }
public PodsController(PodRepository repo, IMapper mapper) { _mapper = mapper; _repo = repo; }