예제 #1
0
        // GET: Partnership/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Partnership partnership = _partnershipService.GetById(id.Value);

            if (partnership == null)
            {
                return(HttpNotFound());
            }
            var user = _userContext.Users.FirstOrDefault(x => x.Id == partnership.UserID);
            var partnershipViewModel = new PartnershipViewModel()
            {
                ID                  = partnership.ID,
                UserName            = user != null ? user.UserName : "",
                VendorName          = partnership.Vendor.Name,
                CustomerIDQualifier = partnership.CustomerIDQualifier,
                CustomerEdiID       = partnership.CustomerEdiID,
                VendorIDQualifier   = partnership.VendorIDQualifier,
                VendorEdiID         = partnership.VendorEdiID
            };

            return(View(partnershipViewModel));
        }
예제 #2
0
        public ActionResult DeleteConfirmed(int id)
        {
            Partnership partnership = _partnershipService.GetById(id);

            _partnershipService.Delete(partnership);
            return(RedirectToAction("Index"));
        }
예제 #3
0
        public async Task <ProducerBusiness> SetProducerBusiness(producerBusinessType producerBusiness)
        {
            object          item = producerBusiness.Item;
            ProducerContact correspondentForNoticeContact = null;

            if (producerBusiness.correspondentForNotices.contactDetails != null)
            {
                correspondentForNoticeContact =
                    await GetProducerContact(producerBusiness.correspondentForNotices.contactDetails);
            }

            Company     company     = null;
            Partnership partnership = null;

            if (item is companyType)
            {
                companyType     companyitem = (companyType)item;
                ProducerContact contact     = await GetProducerContact(companyitem.registeredOffice.contactDetails);

                company = new Company(companyitem.companyName, companyitem.companyNumber, contact);
            }
            else if (item is partnershipType)
            {
                partnershipType partnershipItem = (partnershipType)item;
                string          partnershipName = partnershipItem.partnershipName;

                List <string>   partnersList = partnershipItem.partnershipList.ToList();
                List <Partner>  partners     = partnersList.Select(name => new Partner(name)).ToList();
                ProducerContact contact      = await GetProducerContact(partnershipItem.principalPlaceOfBusiness.contactDetails);

                partnership = new Partnership(partnershipName, contact, partners);
            }

            return(new ProducerBusiness(company, partnership, correspondentForNoticeContact));
        }
        public bool AddPartnership(HiringCompany hc, OutsourcingCompany oc)
        {
            using (var access = new AccessDB())
            {
                Partnership pr = access.PrartnershipAction.FirstOrDefault(f => f.HiringCompany.CompanyIdThr.Equals(hc.CompanyIdThr) && f.OutsourcingCompany.Id.Equals(oc.Id));

                if (pr == null)
                {
                    Partnership partnership = new Partnership();
                    partnership.HiringCompany      = hc;
                    partnership.OutsourcingCompany = oc;

                    access.HcActions.Attach(partnership.HiringCompany);
                    access.OcActions.Attach(partnership.OutsourcingCompany);
                    access.PrartnershipAction.Add(partnership);

                    int i = access.SaveChanges();

                    if (i > 0)
                    {
                        Log.Info("Successfully added partnership.");
                        return(true);
                    }

                    Log.Warn("Failed to add partnership");
                    return(false);
                }
                else
                {
                    Log.Warn("Partnership already exists.");
                    return(false);
                }
            }
        }
예제 #5
0
            public static ProducerBusiness WithPartnership(Partnership partnership)
            {
                var builder = new ProducerBusinessBuilder();

                builder.partnership = partnership;

                return(builder.Build());
            }
        public IActionResult DeletePartnership(int id)
        {
            Partnership partnership = _repo.Partnership.GetPartnership(id);

            partnership.ManagedCareOrganization         = _repo.ManagedCareOrganization.GetAllManagedCareOrganizations().Where(m => m.Id == partnership.ManagedCareOrganizationId).FirstOrDefault();
            partnership.ManagedCareOrganization.Address = _repo.Address.GetAddressById(partnership.ManagedCareOrganization.AddressId.Value);
            return(View(partnership));
        }
예제 #7
0
 public PartnershipsComponent()
 {
     mifnexsoEntities                  = new MIFNEXSOEntities();
     partnership                       = new Partnership();
     partnership.OrganizationId        = Guid.Empty;
     partnership.OrganizationPartnerId = Guid.Empty;
     mifnexsoEntities.Partnerships.AddObject(partnership);
 }
예제 #8
0
        public void IsDivorcedFrom_ReturnsTrueForExWife()
        {
            var p1          = new FamilyMember("Tom", Gender.Male);
            var p2          = new FamilyMember("Nancy", Gender.Female);
            var partnership = new Partnership(p1, p2);

            partnership.IsDivorced = true;

            Assert.IsTrue(p1.IsDivorcedFrom(p2));
        }
예제 #9
0
 public ActionResult Edit([Bind(Include = "ID,UserID,VendorID,CustomerIDQualifier,CustomerEdiID,VendorIDQualifier,VendorEdiID")] Partnership partnership)
 {
     if (ModelState.IsValid)
     {
         _partnershipService.Update(partnership);
         return(RedirectToAction("Index"));
     }
     ViewBag.UserID   = new SelectList(_userContext.Users, "Id", "UserName", partnership.UserID);
     ViewBag.VendorID = new SelectList(_vendorService.GetAll(), "ID", "Name", partnership.VendorID);
     return(View(partnership));
 }
 public IActionResult DeletePartnership(Partnership partnership)
 {
     try
     {
         _repo.Partnership.Delete(partnership);
         _repo.Save();
         return(RedirectToAction(nameof(DisplayPartnerships)));
     }
     catch
     {
         return(View());
     }
 }
        private async Task fillPartnershipTree(Partnership p, bool fetchNewFiles)
        {
            //get fromPartnership
            Dictionary <String, Link> partnershipLinks = OAuthWorkFlow.linksFrom(p);
            Link fromPartnerShipLink = partnershipLinks["fromPartnership"];
            Link toPartnerShipLink   = partnershipLinks["toPartnership"];

            //only try to fetch partner details if not a mailto link
            if (fromPartnerShipLink.uri.ToLower().IndexOf("mailto:") < 0)
            {
                if (!fromPartnerShipLink.uri.ToLower().StartsWith("mailto:"))
                {
                    p.FromOrg = await getOrganization(fromPartnerShipLink, true);
                }

                if (!toPartnerShipLink.uri.ToLower().StartsWith("mailto:"))
                {
                    p.ToOrg = await getOrganization(toPartnerShipLink, true);
                }

                if (partnershipLinks.ContainsKey("contactInvitation"))
                {
                    p.ContactInvite = await getResourceFromCache(partnershipLinks["contactInvitation"].uri);
                }



                if (p.FromOrg != null && !string.IsNullOrEmpty(p.FromOrg.id)) //ADDED MB
                {
                    var orgLinks = OAuthWorkFlow.linksFrom(p.FromOrg);
                    if (orgLinks.ContainsKey("self"))
                    {
                        string filesLink = orgLinks["self"].uri.TrimEnd("/".ToCharArray()) + "/files";

                        if (fetchNewFiles) //only fetch files when we are wanting to download
                        {
                            p.SharedFiles = await getPartnerFileLinks(filesLink, p.FromOrg.id, fetchNewFiles);

                            if (p.SharedFiles != null)
                            {
                                p.TotalFileCount = p.SharedFiles.Count();
                            }
                        }
                        else
                        {
                            p.TotalFileCount = await getCount <DataContracts.File>(filesLink);
                        }
                    }
                }
            }
        }
        // GET: /BackOffice/Parthnership/Details/5
        public async Task <ActionResult> Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Partnership partnership = await db.GetByIdAsync(id);

            if (partnership == null)
            {
                return(HttpNotFound());
            }
            return(View(partnership));
        }
예제 #13
0
        // GET: Partnership/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Partnership partnership = _partnershipService.GetById(id.Value);

            if (partnership == null)
            {
                return(HttpNotFound());
            }
            return(View(partnership));
        }
예제 #14
0
        /// <summary>
        ///   Gets the score for the <see cref="Partnership"/>.
        /// </summary>
        /// <param name="partnership"></param>
        /// <returns>
        ///   The score for the <paramref name="partnership"/>
        /// </returns>
        public int PartnershipScore(Partnership partnership)
        {
            bool isDeclaror;

            if (partnership == Partnership.NorthSouth)
            {
                isDeclaror = Contract.Declaror == Seat.North || Contract.Declaror == Seat.South;
            }
            else
            {
                isDeclaror = Contract.Declaror == Seat.East || Contract.Declaror == Seat.West;
            }

            return(isDeclaror ? Score : -Score);
        }
예제 #15
0
        private async Task <PartnershipDto> MapPartnershipToPartnershipDto(Partnership partnership)
        {
            var user = await _userInformationRepo.GetOne(partnership.PartnerId);

            var conversation = await _conversationRepo.GetOneByCondition(c => c.OwnerId == partnership.OwnerId && c.CreatorId == partnership.PartnerId);

            var partnershipDto = _mapper.Map <PartnershipDto>(partnership)
                                 .Map(user, _mapper);

            if (conversation != null)
            {
                partnershipDto.ConversationId = conversation.Id;
            }
            return(partnershipDto);
        }
예제 #16
0
        // GET: Partnership/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Partnership partnership = _partnershipService.GetById(id.Value);

            if (partnership == null)
            {
                return(HttpNotFound());
            }
            ViewBag.UserID   = new SelectList(_userContext.Users, "Id", "UserName", partnership.UserID);
            ViewBag.VendorID = new SelectList(_vendorService.GetAll(), "ID", "Name", partnership.VendorID);
            return(View(partnership));
        }
예제 #17
0
        public ActionResult Create(Partnership partnership)
        {
            if (ModelState.IsValid)
            {
                var partnershipDetail = new PartnershipDetail()
                {
                    Profile     = CurrentAccount.Profile,
                    Type        = "Owner",
                    Partnership = partnership
                };
                _workUnit.PartnershipDetailRepository.InsertEntity(partnershipDetail);
                _workUnit.saveChanges();
                //notifications
                var notification = new Notification {
                    Account      = CurrentAccount,
                    Category     = "New Partnership Profile Created",
                    Header       = "Thank you for creating a Partnership Profile on EARN MD CONNECT!",
                    Message      = @"You are now the Administrator of your Partnership Profile. 
As the Administrator, you are the only user able 1) to control the Partnership Profile’s membership, 2) 
to invite other organizations to join your Partnership Profile, and 3) 
to decide whether to approve users who request to join your Partnership Profile.

If you are the appropriate Administrator for your partnership’s EARN MD CONNECT Partnership Profile, you’re ready to get started!
You may also designate additional Administrators of your Partnership Profile. To do so, click on the “Partners” tab on the bottom 
left of your Partnership Profile detail page. Select the desired Partner Organization, and click the “Make Admin” button to assign 
Administrator Privileges. You may also remove your organization as an Administrator if there exists one or more other Administrators. 
To do so, simply click the “Remove Admin” button next to your own Organization’s profile within the “Partners” tab of your Partnership Profile page.
",
                    Message2     = @"Next, please visit your EARN MD CONNECT Partnership Profile and invite 
your partners to join the Partnership Profile on EARN MD CONNECT, communicate with your partners, 
and search for any other Partnership Profiles that may be of interest to you.",
                    Message3     = @"Please note: 1) to become a member of an EARN MD CONNECT Partnership Profile, 
a user must first have, or create an Organizational Profile; 2) the Partnership Profile’s Title, 
Description, Target Industry, region, and membership will be visible to other EARN MD CONNECT users; 3) 
full Partnership Profiles, including the communication function, are only accessible to that Partnership 
Profile’s members, and 4) the communication feature is meant to support communication between partners, 
but should not be used to share proprietary or sensitive content.",
                    LinkToAction = Url.Action("Detail", new { partnership.PartnershipID })
                };
                _workUnit.NotificationRepository.InsertEntity(notification);
                _workUnit.saveChanges();
                return(RedirectToAction("Detail", new { partnership.PartnershipID }));
            }
            //error
            return(View(partnership));
        }
예제 #18
0
        public static ProducerBusiness Create(ISettings settings, bool noCompany)
        {
            ProducerBusiness producerBusiness = new ProducerBusiness();

            producerBusiness.CorrespondentForNotices = CorrespondentForNotices.Create(settings);

            if (noCompany || RandomHelper.OneIn(2))
            {
                producerBusiness.Partnership = Partnership.Create(settings);
            }
            else
            {
                producerBusiness.Company = Company.Create(settings);
            }

            return(producerBusiness);
        }
        public IActionResult EditPartnership(PartnershipViewModel partnershipViewModel)
        {
            string userId     = this.User.FindFirstValue(ClaimTypes.NameIdentifier);
            int    providerId = _repo.Provider.GetProviderByUserId(userId).Id;
            ManagedCareOrganization managedCareOrganization = _repo.ManagedCareOrganization.GetAllManagedCareOrganizations().Where(m => m.Id == partnershipViewModel.ManagedCareOrganizationSelectionId).FirstOrDefault();
            Partnership             partnership             = new Partnership()
            {
                Id         = partnershipViewModel.PartnershipId,
                ProviderId = providerId,
                Provider   = _repo.Provider.GetProvider(providerId),
                ManagedCareOrganizationId = managedCareOrganization.Id,
                ManagedCareOrganization   = managedCareOrganization
            };

            _repo.Partnership.Update(partnership);
            _repo.Save();
            return(RedirectToAction(nameof(DisplayPartnerships)));
        }
        public async Task <ActionResult> DeleteConfirmed(int id)
        {
            Partnership partnership = await db.GetByIdAsync(id);

            db.Remove(partnership);

            if (partnership.LogoFileName != null)
            {
                var fullPath = Server.MapPath("~/Public/Partnerships/" + partnership.LogoFileName);

                // Remove file from the disk.
                if (System.IO.File.Exists(fullPath))
                {
                    System.IO.File.Delete(fullPath);
                }
            }

            await db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
예제 #21
0
 public PartnershipsComponent(Guid guid)
 {
     mifnexsoEntities = new MIFNEXSOEntities();
     try
     {
         if (guid != Guid.Empty)
         {
             partnership = mifnexsoEntities.Partnerships.FirstOrDefault(a => a.OrganizationId == guid);
         }
         else
         {
             partnership.OrganizationId        = Guid.Empty;
             partnership.OrganizationPartnerId = Guid.Empty;
             mifnexsoEntities.Partnerships.AddObject(partnership);
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
예제 #22
0
        public async Task <PartnershipDto> AddOne(string userId, string partnerId)
        {
            var partnershipForAccepter = new Partnership()
            {
                CreatedDate = DateTime.UtcNow,
                PartnerId   = partnerId,
                OwnerId     = userId,
            };
            var partnershipForSender = new Partnership()
            {
                CreatedDate = DateTime.UtcNow,
                PartnerId   = userId,
                OwnerId     = partnerId,
            };
            await _partnershipRepo.Add(partnershipForAccepter);

            await _partnershipRepo.Add(partnershipForSender);

            await _unitOfWork.Commit();

            return(await MapPartnershipToPartnershipDto(partnershipForAccepter));
        }
            public static ProducerBusiness WithPartnership(Partnership partnership)
            {
                var builder = new ProducerBusinessBuilder();
                builder.partnership = partnership;

                return builder.Build();
            }
예제 #24
0
 public async Task DeleteAsync(Partnership entity)
 {
     _unitOfWork.PartnershipRepository.Delete(entity);
     await _unitOfWork.CommitAsync();
 }
예제 #25
0
 public async Task UpdateAsync(Partnership entity)
 {
     _unitOfWork.PartnershipRepository.Edit(entity);
     await _unitOfWork.CommitAsync();
 }
예제 #26
0
 public async Task CreateAsync(Partnership entity)
 {
     _unitOfWork.PartnershipRepository.Add(entity);
     await _unitOfWork.CommitAsync();
 }
예제 #27
0
 public void Delete(Partnership entity)
 {
     _unitOfWork.PartnershipRepository.Delete(entity);
     _unitOfWork.Commit();
 }
예제 #28
0
 public void Update(Partnership entity)
 {
     _unitOfWork.PartnershipRepository.Edit(entity);
     _unitOfWork.Commit();
 }
예제 #29
0
 public void Create(Partnership entity)
 {
     _unitOfWork.PartnershipRepository.Add(entity);
     _unitOfWork.Commit();
 }
예제 #30
0
        public async Task<ProducerBusiness> SetProducerBusiness(producerBusinessType producerBusiness)
        {
            object item = producerBusiness.Item;
            ProducerContact correspondentForNoticeContact = null;
            if (producerBusiness.correspondentForNotices.contactDetails != null)
            {
                correspondentForNoticeContact =
                    await GetProducerContact(producerBusiness.correspondentForNotices.contactDetails);
            }

            Company company = null;
            Partnership partnership = null;
            if (item is companyType)
            {
                companyType companyitem = (companyType)item;
                ProducerContact contact = await GetProducerContact(companyitem.registeredOffice.contactDetails);
                company = new Company(companyitem.companyName, companyitem.companyNumber, contact);
            }
            else if (item is partnershipType)
            {
                partnershipType partnershipItem = (partnershipType)item;
                string partnershipName = partnershipItem.partnershipName;

                List<string> partnersList = partnershipItem.partnershipList.ToList();
                List<Partner> partners = partnersList.Select(name => new Partner(name)).ToList();
                ProducerContact contact = await GetProducerContact(partnershipItem.principalPlaceOfBusiness.contactDetails);
                partnership = new Partnership(partnershipName, contact, partners);
            }

            return new ProducerBusiness(company, partnership, correspondentForNoticeContact);
        }
 //[TestFixtureSetUp]
 public void SetupTest()
 {
     this.prUnderTest   = new Partnership();
     hiringCompany      = new HiringCompany();
     outsourcingCompany = new OutsourcingCompany();
 }
예제 #32
0
 public override bool Equals(Partnership other)
 {
     return(false);
 }
 public override bool Equals(Partnership other)
 {
     return false;
 }