コード例 #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 }));
        }
コード例 #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 }));
        }
コード例 #3
0
        public ActionResult Profile(string id)
        {
            var user = _userService.GetByIdWithRoles(HashidsHelper.Decrypt(id));
            var vm   = user.MapTo <UserVm>();

            return(View(vm));
        }
コード例 #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
     });
 }
コード例 #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
     });
 }
コード例 #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));
        }
コード例 #7
0
 public ActionResult Delete(string id)
 {
     _contactService.DeleteById(HashidsHelper.Decrypt(id));
     return(Json(new { success = true, message = C.Message.Success }));
 }