Example #1
0
 public ContentResult GetCallAgrees(int callId)
 {
     try
     {
         var callsBL = new CallsBusinessLogic();
         var agrees  = callsBL.GetCallAgrees(callId);
         return(Content(JsonConvert.SerializeObject(new { agrees }), "application/json"));
     }
     catch (Exception ex)
     {
         return(Content(ex.Message, "application/json"));
     }
 }
Example #2
0
        public ContentResult GetCallsList(int pageNumber = 0, string phoneInner = null, int pageSize = 10)
        {
            try
            {
                var callsBL = new CallsBusinessLogic();
                var isChangeInternalPhone = UserDao.Instance.IsUserModuleGrant("CLAIM", "CHANGE_INTERNAL_PHONE", CurrentUser.ClientId);
                if (string.IsNullOrEmpty(phoneInner) || !isChangeInternalPhone)
                {
                    phoneInner = AgreeDao.Instance.ClientVisitContactInnerPhone(CurrentUser.ClientId);
                }
                var result = callsBL.GetCallList(phoneInner, new PageRequest()
                {
                    PageNumber = pageNumber, PageSize = pageSize
                });
                var calls      = result.Data;
                var totalCount = result.TotalCount;

                return(Content(JsonConvert.SerializeObject(new { calls, totalCount, pageNumber, pageSize }), "application/json"));
            }
            catch (Exception ex)
            {
                return(Content(ex.Message, "application/json"));
            }
        }