Exemple #1
0
        public JsonResult GetNoticeBoardIsRead()
        {
            DataControl.CurrentInfo objCur = new DataControl.CurrentInfo();
            string companyCode             = objCur.GetCompanyCode();
            string userCode = objCur.GetUserCode();

            try
            {
                StringBuilder sbTableContent = new StringBuilder();
                DataControl.HiDoctor_ActivityFactoryClasses.BL_NoticeBoard _objBlActivity = new DataControl.HiDoctor_ActivityFactoryClasses.BL_NoticeBoard();
                DataControl.CurrentInfo _objCurrentInfo = new DataControl.CurrentInfo();
                IEnumerable <MVCModels.NoticeBoardContentModel> lstdata = null;
                lstdata = _objBlActivity.GetNoticeBoarddetail(companyCode, userCode);
                return(Json(lstdata, JsonRequestBehavior.AllowGet));
            }


            catch (Exception ex)
            {
                Dictionary <string, string> dicContext = new Dictionary <string, string>();
                dicContext.Add("Filter:CompanyCode", companyCode);
                dicContext.Add("Filter:UserCode", userCode);
                DataControl.Impl.ExceptionHandler.WriteLog(ex, dicContext);
                throw new Exception("Sorry an error occurred. Please try again later");

                throw ex;
            }
        }
Exemple #2
0
        public string GetAllNoticeMandatoryDetail()
        {
            DataControl.CurrentInfo objCur = new DataControl.CurrentInfo();
            string companyCode             = objCur.GetCompanyCode();
            string userCode = objCur.GetUserCode();

            try
            {
                StringBuilder sbTableContent = new StringBuilder();
                DataControl.HiDoctor_ActivityFactoryClasses.BL_NoticeBoard _objBlActivity = new DataControl.HiDoctor_ActivityFactoryClasses.BL_NoticeBoard();
                DataControl.CurrentInfo _objCurrentInfo = new DataControl.CurrentInfo();
                IEnumerable <MVCModels.NoticeBoardContentModel> lstdata = null;
                lstdata = _objBlActivity.GetNoticeBoarddetail(companyCode, userCode);
                sbTableContent.Append("</div>");
                sbTableContent.Append("<table id='NoticeBoardRead' class='table table-striped' style='width:100% !important;padding:4px !important;'>");
                sbTableContent.Append("<thead class='active'>");
                sbTableContent.Append("<tr><td>Title</td>");
                sbTableContent.Append("<td>ActiveFrom</td>");
                sbTableContent.Append("<td>ActiveTo</td>");
                sbTableContent.Append("<td>Author</td>");
                sbTableContent.Append("<td>IsRead</td></tr>");
                sbTableContent.Append("</thead>");
                if (lstdata.ToList().Count > 0)
                {
                    foreach (var item in lstdata)
                    {
                        if (item.Is_Read.ToString() == "No")
                        {
                            sbTableContent.Append("<tr style='font-weight:bold;font-style:italic;color:rgb(52, 172, 52)'><td><span   onclick=\"GetNoticepopup('" + item.Msg_Code + "')\" style='text-decoration:underline;cursor:pointer'>" + item.Title + "</span></td>");
                            sbTableContent.Append("<td>" + item.Active_From + "</td>");
                            sbTableContent.Append("<td>" + item.Active_To + "</td>");
                            sbTableContent.Append("<td>" + item.Employee_Name + "(" + item.Author + ")</td>");
                            sbTableContent.Append("<td>" + item.Is_Read + "</td></tr>");
                        }
                    }
                }
                else
                {
                    sbTableContent.Append("No records found");
                }
                return(sbTableContent.ToString());
            }


            catch (Exception ex)
            {
                Dictionary <string, string> dicContext = new Dictionary <string, string>();
                dicContext.Add("Filter:CompanyCode", companyCode);
                dicContext.Add("Filter:UserCode", userCode);
                DataControl.Impl.ExceptionHandler.WriteLog(ex, dicContext);
                throw new Exception("Sorry an error occurred. Please try again later");

                throw ex;
            }
        }