예제 #1
0
        /// <summary>
        /// Get the all type message count
        /// </summary>
        /// <returns>retuns the unread, drafted and trash count</returns>
        public string GetMsgCount()
        {
            string unreadCount  = string.Empty;
            string draftedCount = string.Empty;
            string trashCount   = string.Empty;

            DataControl.CurrentInfo objCurInfo = new DataControl.CurrentInfo();
            DataControl.BLMessaging objMsg     = new DataControl.BLMessaging();
            try
            {
                DataSet ds = new DataSet();
                ds = objMsg.GetMessageCount(objCurInfo.GetCompanyCode(), objCurInfo.GetUserCode());
                if (ds.Tables.Count > 0)
                {
                    unreadCount = Convert.ToString(ds.Tables[0].Rows[0][0]);
                    if (ds.Tables.Count > 1)
                    {
                        draftedCount = Convert.ToString(ds.Tables[1].Rows[0][0]);
                        if (ds.Tables.Count > 2)
                        {
                            trashCount = Convert.ToString(ds.Tables[2].Rows[0][0]);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                DataControl.Impl.ExceptionHandler.WriteLog(ex, null);
            }
            return(unreadCount + "~" + draftedCount + "~" + trashCount);
        }