/// <summary> /// Binds messages to Inbox repeater /// </summary> /// <param name="userId">logged in user</param> /// <param name="msgType">type of message to dislay</param> private void PopulateInbox(int userId, string msgType) { EFormsDa iDa = new EFormsDa(); DataSet iDs = iDa.GetEformsInbox(userId, msgType); if (iDs != null && iDs.Tables.Count > 0 && iDs.Tables[0].Rows.Count > 0) { rptInbox.DataSource = iDs.Tables[0].DefaultView; rptInbox.DataBind(); InboxMessagesBody.Attributes.Add("onload", "top.TaskContainer.setNumMessages('" + iDs.Tables[0].Rows.Count + "')"); } }
/// <summary> /// If user has eforms pending display icon to reminders inbox /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void SetInboxImage(object sender, EventArgs e) { string userName = new SecurityController().GetUserName(); UserDa uda = new UserDa(); DataSet uDs = uda.GetByUserName(userName); int userId = int.Parse(uDs.Tables[0].Rows[0]["UserId"].ToString()); EFormsDa iDa = new EFormsDa(); // string status = "'" + Caisis.UI.Core.Eforms.EformStatusManager.Status_DataEntryInProgress + "','" + Caisis.UI.Core.Eforms.EformStatusManager.Status_DataEntryReviewed + "'"; string status = "'" + EformStatusManager.Status_DataEntryInProgress + "'"; DataSet iDs = iDa.GetEformsInbox(userId, status); if (!(iDs != null && iDs.Tables.Count > 0 && iDs.Tables[0].Rows.Count > 0)) { //splashKioskInbox.Src="../../Images/splashOptionsYouHaveMessages.gif"; splashKioskInbox.Visible = false; } }
/// <summary> /// /// </summary> private void BuildRecentEforms() { // string datasetSql = CacheManager.GetDatasetSQL(Session[SessionKey.DatasetId]); UserController uc = new UserController(); EFormController ec = new EFormController(); EFormsDa da = new EFormsDa(); int userId = uc.GetUserId(); // System.Data.DataTable dt = da.GetUserRecentEforms(userId, datasetSql, null, null); string msgType = "'" + EformStatusManager.Status_DataEntryInProgress + "','" + EformStatusManager.Status_DataEntryComplete + "','" + EformStatusManager.Status_Narrated + "'"; System.Data.DataSet iDs = da.GetEformsInbox(userId, msgType); if (iDs != null && iDs.Tables.Count > 0 && iDs.Tables[0].Rows.Count > 0) { UserEformsRpt.DataSource = iDs.Tables[0].DefaultView; UserEformsRpt.DataBind(); NoEformsMessage.Visible = false; } }