예제 #1
0
        /// <summary>
        /// get the selected message details
        /// </summary>
        /// <param name="msgCode"></param>
        /// <returns>returns the selected message details in the form of json </returns>
        public string GetSelectedMsgDetails(string msgCode, string TargetAddress)
        {
            DataControl.CurrentInfo   objCurInfo = new DataControl.CurrentInfo();
            DataControl.BLMessaging   objMsg     = new DataControl.BLMessaging();
            DataControl.JSONConverter objJson    = new DataControl.JSONConverter();
            DataControl.Repository.AzureBlobUpload objAzureUpload = new DataControl.Repository.AzureBlobUpload();
            DataControl.Abstraction.IFileProvider  objPathProv    = new DataControl.Impl.FileSystemProvider();
            string accKey  = objPathProv.GetConfigValue("NBFILES");
            string blobURL = accKey + objCurInfo.GetCompanyCode().ToLower();

            return(objJson.Serialize(objMsg.GetSelectedMsgDetails(objCurInfo.GetCompanyCode(), msgCode, TargetAddress)) + "~" + blobURL);
        }
예제 #2
0
        public LargeJsonResult GetMessageToCCDetail(string msgCode)
        {
            try
            {
                List <MVCModels.MessagingModel> lstAllMsg = new List <MVCModels.MessagingModel>();
                List <MVCModels.MessagingModel> lstMsg    = new List <MVCModels.MessagingModel>();
                StringBuilder sbTbl = new StringBuilder();

                DataControl.BLMessaging objMsg = new DataControl.BLMessaging();
                lstAllMsg = (List <MVCModels.MessagingModel>)objMsg.GetSelectedMsgDetails(objCurr.GetCompanyCode(), msgCode, objCurr.GetUserCode()).ToList();
                List <MVCModels.HiDoctor_Master.UserModel> lstUser = new List <MVCModels.HiDoctor_Master.UserModel>();
                lstUser = (List <MVCModels.HiDoctor_Master.UserModel>)objMsg.GetUsersForMessaging(objCurr.GetCompanyCode(), objCurr.GetUserCode());

                foreach (MVCModels.MessagingModel userMsg in lstAllMsg)
                {
                    IEnumerable <MVCModels.HiDoctor_Master.UserModel> lstModel = lstUser.Where(c => c.User_Code == userMsg.Target_Address);
                    if (lstModel.ToList().Count > 0)
                    {
                        lstMsg.Add(userMsg);
                    }
                }
                //var a = (from msgUser in lstAllMsg
                //         join user in lstUser on msgUser.Target_Address equals user.User_Code
                //         where msgUser.Target_Address != user.User_Code
                //         select (msgUser));

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