public static SmsBindTemp TosmsBindTempObject(IMessage message) { SmsBindTemp smsBindTemp = new SmsBindTemp(); String sn = message.Properties.GetString("sn"); String uuid = message.Properties.GetString("uuid"); String name = message.Properties.GetString("name"); String userMessageId = message.Properties.GetString("userMessageId"); String phone = message.Properties.GetString("phone"); String address = message.Properties.GetString("address"); String idNumber = message.Properties.GetString("idNumber"); String userId = message.Properties.GetString("userId"); String hostName = message.Properties.GetString("hostName"); smsBindTemp.setSn(sn); smsBindTemp.setUuid(uuid); smsBindTemp.setName(name); smsBindTemp.setUserId(userId); smsBindTemp.setUserMessageId(userMessageId); smsBindTemp.setPhone(phone); smsBindTemp.setAddress(address); smsBindTemp.setIdNumber(idNumber); smsBindTemp.setHostName(hostName); smsBindTemp.setCreateTime(DateTime.Now); return smsBindTemp; }
public static List<SmsBindTemp> TosmsBindTempObject(DataSet ds) { List<SmsBindTemp> smsList = new List<SmsBindTemp>(); if (ds.Tables.Count > 0) { DataTable dt = ds.Tables[0]; foreach (DataRow dr in dt.Rows) { SmsBindTemp obj = new SmsBindTemp(); obj.setSn(dr["sn"].ToString()); obj.setUuid(dr["uuid"].ToString()); obj.setName(dr["name"].ToString()); obj.setUserId(dr["userid"].ToString()); obj.setUserMessageId(dr["usermessageid"].ToString()); obj.setPhone(dr["phone"].ToString()); obj.setAddress(dr["address"].ToString()); obj.setIdNumber(dr["idnumber"].ToString()); obj.setHostName(dr["hostname"].ToString()); obj.setReceiveFlag(int.Parse(dr["receiveflag"].ToString())); obj.setCounter(int.Parse(dr["counter"].ToString())); obj.setCreateTime(DateTime.Parse(dr["createtime"].ToString())); obj.setId(long.Parse(dr["id"].ToString())); smsList.Add(obj); } } return smsList; }