Exemplo n.º 1
0
        public ActionResult GetCallAsJson(string id)
        {
            var call = _callService.GetById(HashidsHelper.Decrypt(id));
            var vm   = call.MapTo <CallVm>();

            return(Json(new { success = true, data = vm }));
        }
Exemplo n.º 2
0
        public ActionResult GetCallsAsJson(string contactId)
        {
            var calls = _callService.GetAllByContactIdWithUsers(HashidsHelper.Decrypt(contactId));
            var vm    = calls.Select(x => x.MapTo <CallVm>());

            return(Json(new { success = true, data = vm }));
        }
        public ActionResult Profile(string id)
        {
            var user = _userService.GetByIdWithRoles(HashidsHelper.Decrypt(id));
            var vm   = user.MapTo <UserVm>();

            return(View(vm));
        }
Exemplo n.º 4
0
 public Call MapToCall(CallVm vm)
 {
     return(vm == null ? null : new Call {
         Id = HashidsHelper.Decrypt(vm.Id), ContactId = HashidsHelper.Decrypt(vm.ContactId), Date = vm.Date, IsAccess = vm.IsAccess
     });
 }
Exemplo n.º 5
0
 public Contact MapToContact(ContactVm vm)
 {
     return(vm == null ? null : new Contact {
         Id = HashidsHelper.Decrypt(vm.Id), Phone = vm.Phone, CallReason = vm.CallReason, CallResult = vm.CallResult, Date = vm.Date
     });
 }
Exemplo n.º 6
0
        public ActionResult GetContactAsJson(string id)
        {
            var vm = _contactService.GetById(HashidsHelper.Decrypt(id)).MapTo <ContactVm>();

            return(Json(new { success = true, data = vm }, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 7
0
 public ActionResult Delete(string id)
 {
     _contactService.DeleteById(HashidsHelper.Decrypt(id));
     return(Json(new { success = true, message = C.Message.Success }));
 }