Ejemplo n.º 1
0
        public ActionResult Add(ContactView contactView)
        {
            //TODO: use auto-mapper
            var contact = new Contact();

            contact.ContactAddress     = contactView.ContactAddress;
            contact.ContactEmail       = contactView.ContactEmail;
            contact.ContactName        = contactView.ContactName;
            contact.ContactMidName     = contactView.ContactMidName;
            contact.ContactSurname     = contactView.ContactSurname;
            contact.ContactPhoneNumber = contactView.ContactPhoneNumber;

            var id = int.Parse(contactView.ContactTypeID);

            contact.ContactType = _contactTypeLogic.GetContactTypeById(id);

            //TODO: fix default login admin
            var authorId = WebSecurity.CurrentUserId;

            contact.User = _userLogic.GetUserById(authorId);

            _contactLogic.AddContact(contact);

            return(RedirectToAction("Index"));
        }
Ejemplo n.º 2
0
        public ActionResult Edit(int id)
        {
            var contactType = _contactTypeLogic.GetContactTypeById(id);

            return(View(contactType));
        }