Esempio n. 1
0
    private void FillPod()
    {
        IPodRepository podRepository = new PodRepository();
        var            pods          = podRepository.GetUnallocatedPods();

        PodCheckboxList.DataSource     = pods;
        PodCheckboxList.DataTextField  = "Name";
        PodCheckboxList.DataValueField = "Id";
        PodCheckboxList.DataBind();
    }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        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;
 }