public ActionResult GetCallAsJson(string id) { var call = _callService.GetById(HashidsHelper.Decrypt(id)); var vm = call.MapTo <CallVm>(); return(Json(new { success = true, data = vm })); }
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)); }
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 }); }
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 }); }
public ActionResult GetContactAsJson(string id) { var vm = _contactService.GetById(HashidsHelper.Decrypt(id)).MapTo <ContactVm>(); return(Json(new { success = true, data = vm }, JsonRequestBehavior.AllowGet)); }
public ActionResult Delete(string id) { _contactService.DeleteById(HashidsHelper.Decrypt(id)); return(Json(new { success = true, message = C.Message.Success })); }