示例#1
0
        public IList <LeaveWord> SelectLeaveWordByAll(string msgTypeId, string msgState, string meetingBeginTime)
        {
            IMessageType messageType = new MessageTypeService();
            int          msgType;
            int          sender;
            int          receiver;
            string       sql = "usp_GetAllLeaveWordMessage";

            SqlParameter[] para = new SqlParameter[]
            {
                new SqlParameter("@MsgType", msgTypeId == null?"":msgTypeId),
                new SqlParameter("@MsgState", msgState == null?"":msgState),
                new SqlParameter("@day", meetingBeginTime == null?"":meetingBeginTime)
            };
            IList <LeaveWord> list      = new List <LeaveWord>();
            LeaveWord         leaveword = null;

            using (DataTable table = DBHelper.GetDataTableProc(sql, para))
            {
                foreach (DataRow row in table.Rows)
                {
                    leaveword                  = new LeaveWord();
                    leaveword.Id               = (int)row["ID"];
                    leaveword.MsgTitle         = (string)row["MsgTitle"];
                    leaveword.MsgContent       = (string)row["MsgContent"];
                    leaveword.MsgSendTime      = (DateTime)row["MsgSendTime"];
                    leaveword.MsgState         = (string)row["MsgState"];
                    leaveword.MeetingAddr      = (string)row["MeetingAddr"];
                    leaveword.ChargeMan        = (string)row["ChargeMan"];
                    leaveword.MeetingBeginTime = (DateTime)row["MeetingBeginTime"];
                    leaveword.MeetingType      = (string)row["MeetingType"];
                    leaveword.IsAgree          = (string)row["IsAgree"];
                    leaveword.Remark           = (string)row["Remark"];
                    msgType             = (int)row["MsgTypeId"];
                    leaveword.MsgTypeId = messageType.GetMessageTypeById(msgType);
                    sender = (int)row["SenderUser"];
                    leaveword.SenderUser   = userInfo.GetAllUserById(sender);
                    receiver               = (int)row["ReceiverUser"];
                    leaveword.ReceiverUser = userInfo.GetAllUserById(receiver);
                    list.Add(leaveword);
                }
                return(list);
            }
        }
示例#2
0
        public LeaveWord GetLeaveWordMsgTypeId(int msgTypeId)
        {
            IUserInfoService userInfo    = new UserInfoService();
            IMessageType     messageType = new MessageTypeService();
            int       msgType;
            int       sender;
            int       receiver;
            string    sql       = "usp_SelectLeaveWordMsgTypeId";
            LeaveWord leaveword = null;

            using (SqlDataReader row = DBHelper.ExecuteReaderProc(sql, new SqlParameter("@MsgTypeId", msgTypeId)))
            {
                while (row.Read())
                {
                    leaveword                  = new LeaveWord();
                    leaveword.Id               = (int)row["ID"];
                    leaveword.MsgTitle         = (string)row["MsgTitle"];
                    leaveword.MsgContent       = (string)row["MsgContent"];
                    leaveword.MsgSendTime      = (DateTime)row["MsgSendTime"];
                    leaveword.MsgState         = (string)row["MsgState"];
                    leaveword.MeetingAddr      = (string)row["MeetingAddr"];
                    leaveword.ChargeMan        = (string)row["ChargeMan"];
                    leaveword.MeetingBeginTime = (DateTime)row["MeetingBeginTime"];
                    leaveword.MeetingType      = (string)row["MeetingType"];
                    leaveword.IsAgree          = (string)row["IsAgree"];
                    leaveword.Remark           = (string)row["Remark"];
                    msgType             = (int)row["MsgTypeId"];
                    leaveword.MsgTypeId = messageType.GetMessageTypeById(msgType);
                    sender = (int)row["SenderUser"];
                    leaveword.SenderUser   = userInfo.GetAllUserById(sender);
                    receiver               = (int)row["ReceiverUser"];
                    leaveword.ReceiverUser = userInfo.GetAllUserById(receiver);
                }
            }
            return(leaveword);
        }
示例#3
0
 public IList <LeaveWord> GetAllLeaveWord()
 {
     IMessageType      messageType = new MessageTypeService();
     int               msgType;
     int               sender;
     int               receiver;
     string            sql       = "usp_selectLeaveWord";
     IList <LeaveWord> list      = new List <LeaveWord>();
     LeaveWord         leaveword = null;
     DataTable         table     = DBHelper.GetDataTableProc(sql, null);
     {
         foreach (DataRow row in table.Rows)
         {
             leaveword                  = new LeaveWord();
             leaveword.Id               = (int)row["ID"];
             leaveword.MsgTitle         = (string)row["MsgTitle"];
             leaveword.MsgContent       = (string)row["MsgContent"];
             leaveword.MsgSendTime      = (DateTime)row["MsgSendTime"];
             leaveword.MsgState         = (string)row["MsgState"];
             leaveword.MeetingAddr      = (string)row["MeetingAddr"];
             leaveword.ChargeMan        = (string)row["ChargeMan"];
             leaveword.MeetingBeginTime = (DateTime)row["MeetingBeginTime"];
             leaveword.MeetingType      = (string)row["MeetingType"];
             leaveword.IsAgree          = (string)row["IsAgree"];
             leaveword.Remark           = (string)row["Remark"];
             msgType             = (int)row["MsgTypeId"];
             leaveword.MsgTypeId = messageType.GetMessageTypeById(msgType);
             sender = (int)row["SenderUser"];
             leaveword.SenderUser   = userInfo.GetAllUserById(sender);
             receiver               = (int)row["ReceiverUser"];
             leaveword.ReceiverUser = userInfo.GetAllUserById(receiver);
             list.Add(leaveword);
         }
         return(list);
     }
 }