public ActionResult ContactDetails(ContactDetailsViewModel data, string prevBtn, string nextBtn)
        {
            if (prevBtn != null)
            {
                return(RedirectToAction("AddressDetails"));
            }

            if (nextBtn != null)
            {
                if (ModelState.IsValid)
                {
                    var customer = GetCustomer();

                    customer.ContactName = data.ContactName;
                    customer.Phone       = data.Phone;
                    customer.Fax         = data.Fax;

                    SaveCustomer(customer);

                    // Save to db

                    RemoveCustomer();

                    return(RedirectToAction("Success"));
                }
            }

            return(View());
        }
        public ContactDetails(ContactDetailsViewModel viewmodel)
        {
            InitializeComponent();
            BindingContext = viewmodel;
            vm             = viewmodel;
            emailImg.GestureRecognizers.Add(new TapGestureRecognizer
            {
                NumberOfTapsRequired = 1,
                Command = vm.startEmailCommand
            });
            var position = new Position(vm.person.Latitude, vm.person.Longitude);
            var map      = new Map(MapSpan.FromCenterAndRadius(position, Distance.FromKilometers(0.3)))
            {
                IsShowingUser   = true,
                HeightRequest   = 300,
                WidthRequest    = 960,
                VerticalOptions = LayoutOptions.FillAndExpand
            };

            var pin = new Pin
            {
                Type     = PinType.Place,
                Position = position,
                Label    = "Endereço de " + vm.person.FullName,
                Address  = vm.person.Address
            };

            map.Pins.Add(pin);

            mapStackLayout.Children.Add(map);
        }
Example #3
0
        //Updating
        public string updateContactDetails(string IDNum, ContactDetailsViewModel model)
        {
            string feedback = "Request unsuccessfull";

            using (var Holder = new PolicyHolderRepository())
            {
                var          rb     = new RegisterBusiness();
                PolicyHolder member = Holder.Find(x => x.IDNumber == IDNum).FirstOrDefault();
                if (member != null)
                {
                    member.contactNumber   = model.contactNumber;
                    member.physicalAddress = rb.renderPhysicalAddressSave(model.streetAddress, model.suburb, model.city, model.postalCode.ToString());
                    member.postalAddress   = rb.renderPostalAddressSave(model.postalOffice, model.town, model.boxpostalCode);
                    Holder.Update(member);
                    try
                    {
                        using (var eventLog = new ProfileActivityLogRepository())
                        {
                            ProfileActivityLog pal = new ProfileActivityLog()
                            {
                                IDNumber  = IDNum,
                                EventDate = DateTime.Now,
                                Activity  = "Contact Information was updated"
                            };
                            eventLog.Insert(pal);
                        }
                    }
                    catch (Exception ex) { feedback += ex; }
                    feedback = "Contact Information changed";
                }
            }
            return(feedback);
        }
Example #4
0
        public ViewResult ContactDetails(ContactDetailsViewModel viewModel)
        {
            if (!ModelState.IsValid)
            {
                return(View(viewModel));
            }

            var contactDetails = GetContactDetails();

            contactDetails.Title                    = viewModel.Title;
            contactDetails.Forename                 = viewModel.Forename;
            contactDetails.Surname                  = viewModel.Surname;
            contactDetails.RelationToChild          = viewModel.RelationToChild;
            contactDetails.Address                  = viewModel.Address;
            contactDetails.Postcode                 = viewModel.Postcode;
            contactDetails.TelephoneNumber1         = viewModel.TelephoneNumber1;
            contactDetails.TelephoneNumber2         = viewModel.TelephoneNumber2;
            contactDetails.TelephoneNumber3         = viewModel.TelephoneNumber3;
            contactDetails.Email                    = viewModel.Email;
            contactDetails.CorrespondencePreference = viewModel.CorrespondencePreference.ToString();
            contactDetails.IsToBeKeptInformed       = contactDetails.IsToBeKeptInformed;

            if (viewModel.SingleParentStatus != SingleParentStatus.NotSpecified)
            {
                contactDetails.IsSingleParent = viewModel.SingleParentStatus == SingleParentStatus.Yes;
            }

            _context.SaveChanges();

            return(View(viewModel));
        }
Example #5
0
        // GET: Contact/Details
        public ActionResult Details(int contactId)
        {
            Contact contactModel = _db.Contacts.Find(contactId);

            if (contactModel == null)
            {
                return(HttpNotFound());
            }

            var deliveryDetails = (from d in _db.DeliveryDetails
                                   where d.Contact == (contactModel.ContactFirstName + " " + contactModel.ContactLastName)
                                   select d).AsEnumerable();

            var contactDetails = new ContactDetailsViewModel
            {
                ContactId         = contactModel.ContactId,
                ContactFirstName  = contactModel.ContactFirstName,
                ContactLastName   = contactModel.ContactLastName,
                Title             = contactModel.Title,
                TelephoneNumber   = contactModel.TelephoneNumber,
                MobilePhoneNumber = contactModel.MobilePhoneNumber,
                Email             = contactModel.Email,
                User            = contactModel.User,
                InsertDate      = contactModel.InsertDate,
                UpdateDate      = contactModel.UpdateDate,
                ContactType     = contactModel.ContactType,
                DeliveryDetails = deliveryDetails
            };

            return(View(contactDetails));
        }
Example #6
0
        public ContactMapView(ContactDetailsViewModel vm)
        {
            this.Title = "Map";
            this.Icon  = "map.png";

            this.BindingContext = vm;


            ViewModel.PropertyChanged += (sender, args) =>
            {
                if (args.PropertyName == "Contact")
                {
                    MakeMap();
                }
            };


            map = new Map()
            {
                IsShowingUser = true
            };

            this.MakeMap();

            var stack = new StackLayout {
                Spacing = 0
            };

            map.VerticalOptions = LayoutOptions.FillAndExpand;
            map.HeightRequest   = 100;
            map.WidthRequest    = 960;

            stack.Children.Add(map);
            Content = stack;
        }
Example #7
0
        /// <summary>
        /// contacts automapper
        /// </summary>
        /// <param name="contactVm"></param>
        /// <param name="contactDb"></param>
        /// <returns>mapped contact instance</returns>
        public static Contacts AutomapperContacts(ContactDetailsViewModel contactViewModel, Contacts contactDatabase, string LoggedInUserName)
        {
            var contactMapped = AutoMapper.Mapper.Map <Contacts>(contactViewModel);

            ResolveRemainingParamters(contactMapped, contactDatabase, LoggedInUserName);
            return(contactMapped);
        }
Example #8
0
 public ContactDetailsPage(Contact contact)
 {
     InitializeComponent();
     Title          = contact.DisplayName;
     BindingContext = new ContactDetailsViewModel()
     {
         ContactToUpdate = contact, Id = contact.Id, DisplayName = contact.DisplayName
     };
 }
Example #9
0
        public ContactDetailsView(ContactDetailsViewModel viewModel)
        {
            InitializeComponent();

            SetBinding(Page.TitleProperty, new Binding("Title"));
            SetBinding(Page.IconProperty, new Binding("Icon"));

            this.BindingContext = viewModel;
        } //end ctor
Example #10
0
        /// <summary>
        /// Maps Contract listing details to contact listing view model
        /// </summary>
        /// <param name="contractData">contractData</param>
        /// <returns>contact listing view model</returns>
        public static BaseResult <List <ContractListingViewModel> > MapContractListingResponse(BaseResult <List <ContractOverview> > contractData)
        {
            BaseResult <List <ContractListingViewModel> > result = new BaseResult <List <ContractListingViewModel> >();
            List <ContractListingViewModel> contracts            = new List <ContractListingViewModel>();

            foreach (var item in contractData.Result)
            {
                if (item.ParentContractId == null)
                {
                    ContractListingViewModel contract = new ContractListingViewModel
                    {
                        Id           = item.Id,
                        Name         = item.Name,
                        StartDate    = item.StartDate,
                        EndDate      = item.EndDate,
                        Status       = item.Status,
                        HotelName    = item.HotelName,
                        Location     = item.HotelLocation,
                        Designation  = item.Designation,
                        ContractType = item.ContractType
                    };

                    ContactDetailsViewModel contact = new ContactDetailsViewModel
                    {
                        ContactPerson = item.ContactPerson,
                        ContactNumber = item.ContactNumber,
                        EmailAddress  = item.EmailAddress
                    };

                    contract.Contacts.Add(contact);
                    contracts.Add(contract);
                }
                else
                {
                    ContractListingViewModel promo = contracts.Where(x => x.Id == item.ParentContractId).FirstOrDefault();
                    if (promo != null)
                    {
                        promo.PromoContracts.Add
                        (
                            new PromoContractsViewModel
                        {
                            Id           = item.Id,
                            Name         = item.Name,
                            StartDate    = item.StartDate,
                            EndDate      = item.EndDate,
                            Status       = item.Status,
                            ContractType = item.ContractType
                        }
                        );
                    }
                }
            }

            result.Result = contracts;
            return(result);
        }
        // GET: ContactsController/Details/5
        public ViewResult Details(int id)
        {
            ContactDetailsViewModel contactDetailsViewModel = new ContactDetailsViewModel()
            {
                Contact   = _contactsRepository.GetContact(id),
                PageTitle = "Contact Details"
            };

            return(View(contactDetailsViewModel));
        }
Example #12
0
        public async Task <IActionResult> Details(int id)
        {
            var model = new ContactDetailsViewModel
            {
                Contact = await _ContactsService.GetContactByIdAsync(id)
            };

            ViewData["Title"] = "Contact Details";
            return(View(model));
        }
 public ActionResult EditContactDetails(ContactDetailsViewModel model)
 {
     if (ModelState.IsValid)
     {
         ProfileBusiness pb = new ProfileBusiness();
         ViewBag.Feedback = pb.updateContactDetails(HttpContext.User.Identity.Name, model);
         return(RedirectToAction("ContactDetails"));
     }
     return(View(model));
 }
Example #14
0
        public static ContractContact MapToContractContactModel(ContactDetailsViewModel source, string userName, int contractId, int hotelId)
        {
            var dest = AutoMapper.Mapper.Map <ContractContact>(source);

            dest.ContractId  = contractId;
            dest.HotelId     = hotelId;
            dest.UpdatedBy   = dest.CreatedBy = userName;
            dest.UpdatedDate = dest.CreatedDate = DateTime.Now.JakartaOffset();
            return(dest);
        }
        public ActionResult Create(ContactDetailsViewModel contactDetailsViewModel)
        {
            if (ModelState.IsValid)
            {
                _contactDetailsManager.IsRegister(contactDetailsViewModel);
                return(RedirectToAction("Create", "BankDetails"));
            }

            return(View(contactDetailsViewModel));
        }
Example #16
0
        public void OnSalvaClick(object sender, EventArgs e)
        {
            ContactDetailsViewModel bindingContext = (ContactDetailsViewModel)BindingContext;

            if (!bindingContext.DisplayName.Equals(bindingContext.ContactToUpdate.DisplayName))
            {
                bindingContext.ContactToUpdate.DisplayName = bindingContext.DisplayName;
            }
            Navigation.PopAsync();
        }
Example #17
0
        public Task <ContactDetailsViewModel> GetContactDetailsPage(CreateOrderFlowContext context, SubmitProductSelectionCommand command)
        {
            var viewModel = new ContactDetailsViewModel
            {
                FlowContext = context,
                Email       = context.Email,
            };

            return(Task.FromResult(viewModel));
        }
        public ContactDetailsViewModel Map(ContactViewModel model)
        {
            var viewModel = new ContactDetailsViewModel();

            _allCapsContactService.CapsAllProperties(model);
            viewModel.Name         = model.Name;
            viewModel.PhoneNumber  = model.PhoneNumber;
            viewModel.EmailAddress = model.EmailAddress;
            return(viewModel);
        }
        public ContactDetailsView()
        {
            NavigationPage.SetHasNavigationBar(this, false);
            contactDetailsViewModel = new ContactDetailsViewModel(Navigation);

            BindingContext = contactDetailsViewModel;

            InitComp();

            BackgroundColor = Color.Black;
        }
Example #20
0
        public ActionResult ContactDetails()
        {
            var customer = GetCustomer();

            var viewModel = new ContactDetailsViewModel
            {
                ContactName = customer.ContactName,
                Fax         = customer.Fax,
                Phone       = customer.Phone
            };

            return(View(viewModel));
        }
        public ViewResult Delete(int id)
        {
            ContactDetailsViewModel contactDetailsViewModel = new ContactDetailsViewModel()
            {
                Contact   = _contactsRepository.GetContact(id),
                PageTitle = "Delete Contact"
            };

            return(View(contactDetailsViewModel));

            //Contact contact = _contactsRepository.Delete(id);
            //return RedirectToAction("contacts");
        }
        public void TestGetAllContracts_Success_OKResponse()
        {
            //Arrange
            ContactDetailsViewModel contact = new ContactDetailsViewModel
            {
                ContactPerson = "John Adams",
                ContactNumber = "8541236",
                EmailAddress  = "*****@*****.**"
            };

            PromoContractsViewModel promo = new PromoContractsViewModel
            {
                Id        = 1015,
                Name      = "Main Promo1",
                StartDate = DateTime.Now,
                EndDate   = DateTime.Now,
                Status    = "ACTIVE"
            };

            var dataRow = new ContractListingViewModel
            {
                Id          = 1007,
                Name        = "Main Contract",
                StartDate   = DateTime.Now,
                EndDate     = DateTime.Now,
                Status      = "ACTIVE",
                HotelName   = "View images T24 Residency",
                Location    = "Mumbai,India",
                Designation = "Group Sales Manager",
            };

            dataRow.Contacts.Add(contact);
            dataRow.PromoContracts.Add(promo);

            contractsRepositoryMock.Setup(x => x.GetAllContracts()).Returns(Task.FromResult(new BaseResult <List <ContractListingViewModel> >()
            {
                Result = new List <ContractListingViewModel>()
                {
                    dataRow
                }
            })).Verifiable();

            //Act
            var result = contractsController.GetAllContracts();

            //Assert
            contractsRepositoryMock.Verify();
            Assert.IsTrue(result.Result is OkObjectResult);
            Assert.AreEqual(((OkObjectResult)result.Result).StatusCode, 200);
        }
Example #23
0
        public ContactDetailsPage()
        {
            _contactDetailsViewModel = new ContactDetailsViewModel(App.MegaSdk, App.AppInformation);
            this.DataContext         = _contactDetailsViewModel;

            InitializeComponent();
            InitializePage(MainDrawerLayout, LstHamburgerMenu, HamburgerMenuItemType.Contacts);

            SetApplicationBarData();

            _contactDetailsViewModel.IsInSharedItemsRootListView = true;

            InSharesBreadCrumb.BreadCrumbTap += BreadCrumbControlOnOnBreadCrumbTap;
            InSharesBreadCrumb.HomeTap       += BreadCrumbControlOnOnHomeTap;
        }
Example #24
0
 public static ContactDomainModel mapToDomain(ContactDetailsViewModel source)
 {
     return(new ContactDomainModel
     {
         ContactId = source.ContactId,
         firstName = source.firstName,
         lastName = source.lastName,
         emailAddress = source.emailAddress,
         city = source.city,
         street = source.street,
         postCode = source.postCode,
         SkillId = source.SkillId == 0 ? null : source.SkillId,
         Skill = source.Skill,
         WorkExperiences = source.WorkExperiences
     });
 }
Example #25
0
        public virtual async Task <ActionResult> Index(Guid organisationId, Guid aatfId, FacilityType facilityType)
        {
            using (var client = this.apiClient())
            {
                var aatf = await client.SendAsync(this.User.GetAccessToken(), new GetAatfByIdExternal(aatfId));

                var model = new ContactDetailsViewModel()
                {
                    OrganisationId = organisationId, AatfId = aatfId, Contact = aatf.Contact, AatfName = aatf.Name, FacilityType = facilityType
                };

                await this.SetBreadcrumb(aatf);

                return(this.View(model));
            }
        }
Example #26
0
        public ViewResult ContactDetails()
        {
            var contactDetails = GetContactDetails();

            var viewModel = new ContactDetailsViewModel
            {
                Title              = contactDetails.Title,
                Forename           = contactDetails.Forename,
                Surname            = contactDetails.Surname,
                RelationToChild    = contactDetails.RelationToChild,
                Address            = contactDetails.Address,
                Postcode           = contactDetails.Postcode,
                TelephoneNumber1   = contactDetails.TelephoneNumber1,
                TelephoneNumber2   = contactDetails.TelephoneNumber2,
                TelephoneNumber3   = contactDetails.TelephoneNumber3,
                Email              = contactDetails.Email,
                IsToBeKeptInformed = contactDetails.IsToBeKeptInformed
            };


            if (contactDetails.IsSingleParent == true)
            {
                viewModel.SingleParentStatus = SingleParentStatus.Yes;
            }
            else if (contactDetails.IsSingleParent == false)
            {
                viewModel.SingleParentStatus = SingleParentStatus.No;
            }
            else
            {
                viewModel.SingleParentStatus = SingleParentStatus.NotSpecified;
            }


            if (contactDetails.CorrespondencePreference == null)
            {
                viewModel.CorrespondencePreference = CorrespondencePreference.NoCorrespondence;
            }
            else
            {
                viewModel.CorrespondencePreference = Enum.Parse <CorrespondencePreference>(contactDetails.CorrespondencePreference);
            }


            return(View(viewModel));
        }
Example #27
0
        public ActionResult Payments(PaymentsViewModel model)
        {
            var movel = ModelState;

            //if (ModelState.IsValid)
            //{
            ModelState.AddModelError("", "Error occured in model");
            ViewModel.Intake.IntakeViewModel intakemodel = new ViewModel.Intake.IntakeViewModel();
            intakemodel.PaymentsViewModel            = new ViewModel.Payments.PaymentsViewModel();
            intakemodel.PharmacyViewModel            = new ViewModel.Pharmacy.PharmacyViewModel();
            intakemodel.PharmacyViewModel.Pharmacies = new List <Models.PharmacyDetails>();

            PharmacyDetails pd = new PharmacyDetails();

            pd.PharmacyAddress = "Karachi";
            pd.PharmacyID      = "1";
            pd.PharmacyName    = "CVS pharmacy";
            intakemodel.PharmacyViewModel.Pharmacies.Add(pd);

            CoreDTO.DTOContactDetails DTOCD = new CoreDTO.DTOContactDetails();
            DTOCD.Address1    = "ABC";
            DTOCD.Address2    = "BCD";
            DTOCD.Email       = "ASDDADS";
            DTOCD.CountryList = new List <CoreDTO.Country> {
                new CoreDTO.Country {
                    Name = "USA", Value = "US"
                }, new CoreDTO.Country {
                    Name = "Canada", Value = "US"
                }
            };
            DTOCD.StateList = new List <CoreDTO.State> {
                new CoreDTO.State {
                    Name = "NewYork", Value = "US"
                }, new CoreDTO.State {
                    Name = "Chicago", Value = "US"
                }
            };

            ContactDetailsViewModel CDVM = new ContactDetailsViewModel(DTOCD);

            intakemodel.ContactDetailsViewModel = CDVM;

            return(View("Index", intakemodel));
            //}
        }
Example #28
0
        /// <summary>
        /// Create contacts
        /// </summary>
        /// <param name="contactVm"></param>
        /// <param name="loggedInUserName"></param>
        /// <returns></returns>
        public Task <BaseResult <long> > CreateContacts(ContactDetailsViewModel contactVm, string loggedInUserName)
        {
            Contacts contact = new Contacts
            {
                HotelId       = contactVm.HotelId,
                ContactPerson = contactVm.ContactPerson,
                DesignationId = contactVm.DesignationId,
                EmailAddress  = contactVm.EmailAddress,
                IsPrimary     = contactVm.IsPrimary,
                ContactNumber = contactVm.ContactNumber,
                CreatedBy     = loggedInUserName,
                CreatedDate   = DateTime.Now.JakartaOffset(),
                UpdatedBy     = loggedInUserName,
                UpdatedDate   = DateTime.Now.JakartaOffset(),
            };

            return(iContact.InsertEntity(contact));
        }
Example #29
0
        public ContactDetailsTabView(Contact contact)
        {
            if (contact != null)
            {
                this.Title = contact.DisplayName;
            }
            else
            {
                this.Title = "New Contact";
            }


            viewModel = new ContactDetailsViewModel(contact)
            {
                Navigation = Navigation
            };

            this.Children.Add(new ContactDetailsView(viewModel)
            {
                Title = "Contact"
            });


            this.Children.Add(new ContactMapView(viewModel)
            {
                Title = "Map"
            });


            //ToolbarItems.Add(new ToolbarItem("Done", Device.OnPlatform<string>(null, null, "done.png"),  async () =>
            ToolbarItems.Add(new ToolbarItem("Done", "save.png", async() =>
            {
                var confirmed = await DisplayAlert("Unsaved Changes", "Save changes?", "Save", "Discard");
                if (confirmed)
                {
                    viewModel.SaveContactCommand.Execute(null);
                }
                else
                {
                    viewModel.GoBack();
                    System.Diagnostics.Debug.WriteLine("ContactDetailsTabView - cancel changes!");
                }
            }));
        } //end ctor
Example #30
0
        // GET: Intake
        public ActionResult Index()
        {
            ViewModel.Intake.IntakeViewModel intakemodel = new ViewModel.Intake.IntakeViewModel();
            intakemodel.PaymentsViewModel            = new ViewModel.Payments.PaymentsViewModel();
            intakemodel.PharmacyViewModel            = new ViewModel.Pharmacy.PharmacyViewModel();
            intakemodel.PharmacyViewModel.Pharmacies = new List <Models.PharmacyDetails>();



            PharmacyDetails pd = new PharmacyDetails();

            pd.PharmacyAddress = "Karachi";
            pd.PharmacyID      = "1";
            pd.PharmacyName    = "CVS pharmacy";
            intakemodel.PharmacyViewModel.Pharmacies.Add(pd);


            CoreDTO.DTOContactDetails DTOCD = new CoreDTO.DTOContactDetails();
            DTOCD.Address1    = "ABC";
            DTOCD.Address2    = "BCD";
            DTOCD.Email       = "ASDDADS";
            DTOCD.CountryList = new List <CoreDTO.Country> {
                new CoreDTO.Country {
                    Name = "USA", Value = "US"
                }, new CoreDTO.Country {
                    Name = "Canada", Value = "US"
                }
            };
            DTOCD.StateList = new List <CoreDTO.State> {
                new CoreDTO.State {
                    Name = "NewYork", Value = "US"
                }, new CoreDTO.State {
                    Name = "Chicago", Value = "US"
                }
            };

            ContactDetailsViewModel CDVM = new ContactDetailsViewModel(DTOCD);


            intakemodel.ContactDetailsViewModel = CDVM;


            return(View(intakemodel));
        }