Esempio n. 1
0
        public LargeJsonResult GetMessageFullDetail(string msgCode)
        {
            try
            {
                List <MVCModels.MessagingModel> lstAllMsg          = new List <MVCModels.MessagingModel>();
                List <MVCModels.MessagingModel> lstPreviousNextMsg = new List <MVCModels.MessagingModel>();
                StringBuilder sbTbl = new StringBuilder();

                DataControl.BLMessaging objMsg = new DataControl.BLMessaging();
                lstAllMsg          = (List <MVCModels.MessagingModel>)objMsg.GetSelectedMessageDetails(objCurr.GetCompanyCode(), msgCode, objCurr.GetUserCode()).ToList();
                lstPreviousNextMsg = (List <MVCModels.MessagingModel>)objMsg.GetPreviousAndNextMsgCode(objCurr.GetCompanyCode(), objCurr.GetUserCode(), msgCode).ToList();

                List <JsonResult> lst = new List <JsonResult> {
                    Json(lstAllMsg, JsonRequestBehavior.AllowGet),
                    Json(lstPreviousNextMsg, JsonRequestBehavior.AllowGet)
                };

                return(new LargeJsonResult
                {
                    MaxJsonLength = Int32.MaxValue,
                    JsonRequestBehavior = JsonRequestBehavior.AllowGet,
                    Data = new
                    {
                        total = lstAllMsg.Count + lstPreviousNextMsg.Count,
                        data = lst
                    }
                });
            }
            catch (Exception ex)
            {
                Dictionary <string, string> dicObj = new Dictionary <string, string>();
                dicObj.Add("msgCode", msgCode);
                ExceptionHandler.WriteLog(ex: ex, dic: dicObj);
                return(null);
            }
        }