예제 #1
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 Create(PersonPhoneModelView objPersonPhone)
        {
            string error = "";

            try
            {
                if (ModelState.IsValid)
                {
                    objPersonPhone.ModifiedDate = DateTime.Now;
                    _personPhone.Add(Automapper.GetGenericDinamyc <PersonPhoneModelView, PersonPhone>(objPersonPhone));
                }
            }
            catch (Exception ex)
            {
                error = ex.Message;
            }
            return(RedirectToAction("Index", new { id = objPersonPhone.BusinessEntityID }));
        }
예제 #3
0
        public ActionResult Edit(EmailAddressModelView objEmailAddress)
        {
            string error = "";

            try
            {
                if (ModelState.IsValid)
                {
                    objEmailAddress.ModifiedDate = DateTime.Now;
                    _emailAddress.Update(Automapper.GetGenericDinamyc <EmailAddressModelView, EmailAddress>(objEmailAddress));
                }
            }
            catch (Exception ex)
            {
                error = ex.Message;
            }
            return(View(objEmailAddress));
        }
예제 #4
0
        public ActionResult Create(EmailAddressModelView objEmailAddress)
        {
            string error = "";

            try
            {
                if (ModelState.IsValid)
                {
                    objEmailAddress.ModifiedDate = DateTime.Now;
                    _emailAddress.Add(Automapper.GetGenericDinamyc <EmailAddressModelView, EmailAddress>(objEmailAddress));
                }
            }
            catch (Exception ex)
            {
                error = ex.Message;
            }
            return(RedirectToAction("Index", new { id = objEmailAddress.BusinessEntityID }));
        }
        public ActionResult Edit(PersonPhoneModelView objPersonPhone)
        {
            string error = "";

            try
            {
                if (ModelState.IsValid)
                {
                    objPersonPhone.ModifiedDate = DateTime.Now;
                    _personPhone.Update(Automapper.GetGenericDinamyc <PersonPhoneModelView, PersonPhone>(objPersonPhone));
                    LoadDropDown(objPersonPhone.PhoneNumberTypeID);
                }
            }
            catch (Exception ex)
            {
                error = ex.Message;
            }
            return(View());
        }
예제 #6
0
        public ActionResult Edit(PasswordModelView objPassword)
        {
            string error = "";

            try
            {
                if (ModelState.IsValid)
                {
                    objPassword.ModifiedDate = DateTime.Now;
                    objPassword.PasswordSalt = Util.Util.getSalt().Substring(0, 10);
                    objPassword.PasswordHash = Util.Util.CreatePasswordHash(objPassword.PasswordHash, objPassword.PasswordSalt);
                    _password.Update(Automapper.GetGenericDinamyc <PasswordModelView, Password>(objPassword));
                }
            }
            catch (Exception ex)
            {
                error = ex.Message;
            }
            return(View(objPassword));
        }
예제 #7
0
        public ActionResult Create(PasswordModelView objPassword)
        {
            string error = "";

            try
            {
                if (ModelState.IsValid)
                {
                    objPassword.ModifiedDate = DateTime.Now;
                    objPassword.PasswordSalt = Util.Util.getSalt().Substring(0, 10);
                    objPassword.PasswordHash = Util.Util.CreatePasswordHash(objPassword.PasswordHash, objPassword.PasswordSalt);
                    _password.Add(Automapper.GetGenericDinamyc <PasswordModelView, Password>(objPassword));
                }
            }
            catch (Exception ex)
            {
                error = ex.Message;
            }
            return(RedirectToAction("Index", new { id = objPassword.BusinessEntityID }));
        }