public ActionResult Index()
        {
            List <Person> persons = new List <Person>();

            persons = _person.GetList();
            return(View(Automapper.GetGeneric <List <Person>, List <PersonModelView> >(persons)));
        }
예제 #2
0
        public ActionResult Index(int id)
        {
            ViewBag.PersonID = id;

            List <EmailAddress> oListaEmailAddress = new List <EmailAddress>();

            oListaEmailAddress = _emailAddress.GetEmailAddressByPersonId(id);
            return(View(Automapper.GetGeneric <List <EmailAddress>, List <EmailAddressModelView> >(oListaEmailAddress)));
        }
        public ActionResult Index(int id)
        {
            List <PersonPhoneModelView> objListPersonPhoneModelView       = new List <PersonPhoneModelView>();
            PersonPhoneModelView        objPersonPhoneModelViewResult     = new PersonPhoneModelView();
            List <PersonPhoneModelView> objListPersonPhoneModelViewResult = new List <PersonPhoneModelView>();

            objListPersonPhoneModelView = Automapper.GetGeneric <List <PersonPhone>, List <PersonPhoneModelView> >(_personPhone.GetPersonPhoneByPersonId(id));
            foreach (var item in objListPersonPhoneModelView)
            {
                objPersonPhoneModelViewResult = item;
                objPersonPhoneModelViewResult.PhoneNumberTypeDesc = _phoneNumberType.GetPhoneNumberTypeById(item.PhoneNumberTypeID).Name;
                objListPersonPhoneModelViewResult.Add(objPersonPhoneModelViewResult);
            }
            ViewBag.PersonID = id;
            return(View(objListPersonPhoneModelViewResult));
        }
예제 #4
0
        public ActionResult Delete(int id)
        {
            EmailAddressModelView objEmailAddress = new EmailAddressModelView();
            string error = "";

            try
            {
                objEmailAddress = Automapper.GetGeneric <EmailAddress, EmailAddressModelView>(_emailAddress.GetEmailAddressById(id));
                _emailAddress.Delete(Automapper.GetGenericDinamyc <EmailAddressModelView, EmailAddress>(objEmailAddress));
            }
            catch (Exception ex)
            {
                error = ex.Message;
            }
            return(RedirectToAction("Index", new { id = objEmailAddress.BusinessEntityID }));
        }
 public ActionResult Edit(string id)
 {
     string[] ids = id.Split('X');
     LoadDropDown(Convert.ToInt32(ids[0]));
     return(View(Automapper.GetGeneric <PersonPhone, PersonPhoneModelView>(_personPhone.GetPersonPhoneById(Convert.ToInt32(ids[0]), ids[1], Convert.ToInt32(ids[2])))));
 }
예제 #6
0
 public ActionResult Edit(int id)
 {
     return(View(Automapper.GetGeneric <Password, PasswordModelView>(_password.GetPasswordById(id))));
 }
예제 #7
0
 public ActionResult Index(int id)
 {
     ViewBag.PersonID = id;
     return(View(Automapper.GetGeneric <Password, PasswordModelView>(_password.GetPasswordById(id))));
 }
예제 #8
0
 public ActionResult Edit(int id)
 {
     return(View(Automapper.GetGeneric <EmailAddress, EmailAddressModelView>(_emailAddress.GetEmailAddressById(id))));
 }
 public ActionResult Detail(int id)
 {
     return(View(Automapper.GetGeneric <Person, PersonModelView>(_person.GetPersonById(id))));
 }