Пример #1
0
        public ActionResult PopupNotification()
        {
            LoginUserDetails objLoginUserDetails = (LoginUserDetails)InsiderTrading.Common.Common.GetSessionValue((string)ConstEnum.SessionValue.UserDetails);

            NotificationModel objNotificationModel = new NotificationModel();

            objLoginUserDetails.ShowNotificationPopup = false;
            Common.Common.SetSessionValue(ConstEnum.SessionValue.UserDetails, objLoginUserDetails);
            //NotificationSL objNotificationSL = new NotificationSL();
            List <NotificationDTO> lstList = new List <NotificationDTO>();

            try
            {
                ViewBag.NoRecord = false;
                using (var objNotificationSL = new NotificationSL())
                {
                    lstList = objNotificationSL.GetNotificationAlertList(objLoginUserDetails.CompanyDBConnectionString, objLoginUserDetails.LoggedInUserID, "POPUP");
                }
                if (lstList.Count > 0)
                {
                    foreach (var objItem in lstList)
                    {
                        objItem.Contents = objItem.Contents.Replace("<br />", Environment.NewLine);
                    }
                    ViewBag.NotificationDictionary = lstList;
                    return(PartialView("PopupNotificationView"));
                }
                else
                {
                    ViewBag.NoRecord = true;
                    return(PartialView("PopupNotificationView"));
                }
            }
            catch (Exception exp)
            {
                //NotificationModel objNotificationModel = new NotificationModel();
                string sErrMessage = Common.Common.getResource(exp.InnerException.Data[0].ToString());
                ModelState.AddModelError("Error", sErrMessage);
                ViewBag.NoRecord = true;

                return(PartialView("PopupNotificationView"));
            }
            finally
            {
                objLoginUserDetails  = null;
                objNotificationModel = null;
                lstList = null;
            }
        }
Пример #2
0
        public ActionResult DisplayAlert()
        {
            LoginUserDetails objLoginUserDetails = (LoginUserDetails)InsiderTrading.Common.Common.GetSessionValue((string)ConstEnum.SessionValue.UserDetails);

            NotificationModel objNotificationModel = new NotificationModel();

            // NotificationSL objNotificationSL = new NotificationSL();
            List <NotificationDTO> lstList = new List <NotificationDTO>();

            try
            {
                ViewBag.NoRecord = true;
                using (var objNotificationSL = new NotificationSL())
                {
                    lstList = objNotificationSL.GetNotificationAlertList(objLoginUserDetails.CompanyDBConnectionString, objLoginUserDetails.LoggedInUserID, "ALERT");
                }
                if (lstList.Count > 0)
                {
                    foreach (var objItem in lstList)
                    {
                        objItem.Contents = objItem.Contents.Replace("<br />", Environment.NewLine);
                    }
                    ViewBag.NoRecord = false;
                }
                ViewBag.NotificationDictionary = lstList;

                //ViewBag.ModeCodeId = objNotificationDTO.ModeCodeId;
                //ViewBag.NotificationQueueId = NotificationId;
                //ViewBag.UserId = objLoginUserDetails.LoggedInUserID;

                //ViewBag.CommunicationMode_id = objCommunicationRuleMasterModel.CommunicationModeCodeId;
                return(PartialView("PartialCreate"));
            }
            catch (Exception exp)
            {
                //NotificationModel objNotificationModel = new NotificationModel();
                string sErrMessage = Common.Common.getResource(exp.InnerException.Data[0].ToString());
                ModelState.AddModelError("Error", sErrMessage);
                return(View("View", objNotificationModel));
            }
            finally
            {
                objLoginUserDetails  = null;
                objNotificationModel = null;
                lstList = null;
            }
        }
Пример #3
0
        public ActionResult NotificationCount()
        {
            LoginUserDetails objLoginUserDetails = (LoginUserDetails)InsiderTrading.Common.Common.GetSessionValue((string)ConstEnum.SessionValue.UserDetails);

            NotificationModel objNotificationModel = new NotificationModel();

            //NotificationSL objNotificationSL = new NotificationSL();
            List <NotificationDTO> lstList = new List <NotificationDTO>();

            try
            {
                ViewBag.NoRecord = true;
                using (var objNotificationSL = new NotificationSL())
                {
                    lstList = objNotificationSL.GetNotificationAlertList(objLoginUserDetails.CompanyDBConnectionString, objLoginUserDetails.LoggedInUserID, "ALERTCOUNT");
                }
                if (lstList.Count > 0)
                {
                    foreach (var objItem in lstList)
                    {
                        if (objItem.AlertCount > 0)
                        {
                            ViewBag.AlertCount = objItem.AlertCount;
                            ViewBag.NoRecord   = false;
                            break;
                        }
                    }
                }
                return(PartialView("NotificationCountView"));
            }
            catch (Exception exp)
            {
                //NotificationModel objNotificationModel = new NotificationModel();
                string sErrMessage = Common.Common.getResource(exp.InnerException.Data[0].ToString());
                ModelState.AddModelError("Error", sErrMessage);
                ViewBag.AlertCount = 0;
                ViewBag.NoRecord   = true;
                return(PartialView("NotificationCountView"));
            }
            finally
            {
                objLoginUserDetails  = null;
                objNotificationModel = null;
                lstList = null;
            }
        }