public List <CommunicationHistry> DashboardCustometMessagesCount(CommunicationHistoryReq Mobj)
 {
     return(this.IDashboardRequest.GetCustometMessagesCount(Mobj));
 }
예제 #2
0
 public List <CommunicationHistry> GetCustometMessagesCount(CommunicationHistoryReq Mobj)
 {
     return(dashboard.GetCustometMessagesCount(Mobj, "[dbo].[usp_GetCustMessageHistory]"));
 }
예제 #3
0
        public List <CommunicationHistry> GetCustometMessagesCount(CommunicationHistoryReq Mobj, string spName)
        {
            SqlParameter[]             parm = new SqlParameter[7];
            SqlDataReader              reader;
            List <CommunicationHistry> arrayList = new List <CommunicationHistry>();
            Int64?        intNUll    = null;
            int?          intnull    = null;
            bool?         iboolean   = null;
            SqlConnection connection = new SqlConnection();

            connection = SQLHelper.GetSQLConnection();
            connection.Open();
            try
            {
                parm[0]       = new SqlParameter("@CustID", SqlDbType.BigInt);
                parm[0].Value = Mobj.CustID;
                parm[1]       = new SqlParameter("@i_MessageStatusId", SqlDbType.Int);
                parm[1].Value = Mobj.MessageStatusID;
                parm[2]       = new SqlParameter("@i_MessageLinkId", SqlDbType.BigInt);
                parm[2].Value = Mobj.MessageLinkId;
                parm[3]       = new SqlParameter("@i_PageSize", SqlDbType.Int);
                parm[3].Value = Mobj.i_PageSize;
                parm[4]       = new SqlParameter("@i_PageNumber", SqlDbType.Int);
                parm[4].Value = Mobj.i_PageNumber;
                parm[5]       = new SqlParameter("@i_StartIndex", SqlDbType.Int);
                parm[5].Value = Mobj.i_StartIndex;
                parm[6]       = new SqlParameter("@i_EndIndex", SqlDbType.Int);
                parm[6].Value = Mobj.i_EndIndex;
                reader        = SQLHelper.ExecuteReader(connection, CommandType.StoredProcedure, spName, parm);
                if (reader.HasRows)
                {
                    while (reader.Read())
                    {
                        CommunicationHistry communicationHistory = new CommunicationHistry();
                        {
                            communicationHistory.Sender              = reader["Sender"] != DBNull.Value ? reader.GetInt64(reader.GetOrdinal("Sender")) : intNUll;
                            communicationHistory.Receiver            = reader["Receiver"] != DBNull.Value ? reader.GetInt64(reader.GetOrdinal("Receiver")) : intNUll;
                            communicationHistory.SenderName          = reader["SenderName"] != DBNull.Value ? reader.GetString(reader.GetOrdinal("SenderName")) : null;
                            communicationHistory.ReceiverName        = reader["ReceiverName"] != DBNull.Value ? reader.GetString(reader.GetOrdinal("ReceiverName")) : null;
                            communicationHistory.Body                = reader["Body"] != DBNull.Value ? reader.GetString(reader.GetOrdinal("Body")) : null;
                            communicationHistory.RequestDate         = reader["RequestDate"] != DBNull.Value ? reader.GetString(reader.GetOrdinal("RequestDate")) : null;
                            communicationHistory.IsReviewd           = reader["IsReviewd"] != DBNull.Value ? reader.GetBoolean(reader.GetOrdinal("IsReviewd")) : iboolean;
                            communicationHistory.Cust_MessageLink_Id = reader["Cust_MessageLink_Id"] != DBNull.Value ? reader.GetInt64(reader.GetOrdinal("Cust_MessageLink_Id")) : intNUll;
                            communicationHistory.MessageStatusID     = reader["MessageStatusID"] != DBNull.Value ? reader.GetInt32(reader.GetOrdinal("MessageStatusID")) : intnull;
                            communicationHistory.loginCustid         = reader["loginCustid"] != DBNull.Value ? reader.GetInt64(reader.GetOrdinal("loginCustid")) : intNUll;
                        }
                        arrayList.Add(communicationHistory);
                    }
                }
            }
            catch (Exception EX)
            {
                Commonclass.ApplicationErrorLog(spName, Convert.ToString(EX.Message), Mobj.CustID, null, null);
            }
            finally
            {
                connection.Close();
                //SqlConnection.ClearPool(connection);
                //SqlConnection.ClearAllPools();
            }
            return(arrayList);
        }