public static MessageBL getDataByUserShopIdAndType(Int32 iUserId, Int32 iShopId, Int32 iType) { SummitDS.MessageDataTable thisTable = getAdapter().GetDataByUserShopIdAndType(iUserId, iShopId, iType); if (thisTable != null && thisTable.Rows.Count > 0) { return(BuildFromRow(thisTable.Rows[0])); } return(null); }
public static List <MessageBL> getUnreadMessages(Int32 iShopID, Int32 iMessageType) { SummitDS.MessageDataTable thisTable = getAdapter().GetUnreadMessages(iShopID, iMessageType); if (thisTable != null && thisTable.Rows.Count > 0) { return(BuildFromTable(thisTable)); } return(null); }
public static MessageBL getDataById(Int32 iMessageId) { SummitDS.MessageDataTable thisTable = getAdapter().GetDataById(iMessageId); if (thisTable != null && thisTable.Rows.Count > 0) { return(BuildFromRow(thisTable.Rows[0])); } return(null); }
public static Int32 getCountUnreadMessages(Int32 iShopID, Int32 iMessageType) { SummitDS.MessageDataTable thisTable = getAdapter().GetUnreadMessages(iShopID, iMessageType); if (thisTable != null && thisTable.Rows.Count > 0) { return(thisTable.Rows.Count); } return(0); }
protected override void SaveToRow() { SummitDS.MessageDataTable _thisTable = new SummitDS.MessageDataTable(); if (_rowToSave == null) { _rowToSave = _thisTable.NewMessageRow(); } SummitDS.MessageRow _dataRow = _rowToSave as SummitDS.MessageRow; if (_dataRow != null) { if (IsExisting()) { if (!m_dtMessageTime.HasValue) { if (!_dataRow.IsmessageTimeNull()) { _dataRow.SetmessageTimeNull(); } } else if (_dataRow.IsmessageTimeNull() ? true : _dataRow.messageTime != m_dtMessageTime.Value) { _dataRow.messageTime = m_dtMessageTime.Value; } if (String.IsNullOrEmpty(m_strMessage)) { if (!_dataRow.IsmessageNull()) { _dataRow.SetmessageNull(); } } else if (_dataRow.IsmessageNull() ? true : _dataRow.message != m_strMessage) { _dataRow.message = m_strMessage; } if (String.IsNullOrEmpty(m_strAttachment)) { if (!_dataRow.IsattachemetNull()) { _dataRow.SetattachemetNull(); } } else if (_dataRow.IsattachemetNull() ? true : _dataRow.attachemet != m_strAttachment) { _dataRow.attachemet = m_strAttachment; } if (iType.HasValue) { _dataRow.type = iType.Value; } else { _dataRow.SettypeNull(); } if (iShopID.HasValue) { _dataRow.shop_id = iShopID.Value; } else { _dataRow.Setshop_idNull(); } if (_dataRow.phoneUser_id != m_iPhoneUserID) { _dataRow.phoneUser_id = Convert.ToInt32(m_iPhoneUserID); } if (String.IsNullOrEmpty(m_strLocationLink)) { if (!_dataRow.IslocationLinkNull()) { _dataRow.SetlocationLinkNull(); } } else if (_dataRow.IslocationLinkNull() ? true : _dataRow.locationLink != m_strLocationLink) { _dataRow.locationLink = m_strLocationLink; } if (bIsRead.HasValue) { _dataRow.is_read = bIsRead.Value; } else { _dataRow.Setis_readNull(); } if (fLatitude.HasValue) { _dataRow.latitude = fLatitude.Value; } else { _dataRow.SetlatitudeNull(); } if (fLongitude.HasValue) { _dataRow.longitude = fLongitude.Value; } else { _dataRow.SetlongitudeNull(); } if (m_iPrivateLabelID.HasValue) { _dataRow.private_label_id = iPrivateLabelID.Value; } else { _dataRow.Setprivate_label_idNull(); } } else { if (dtMessageTime.HasValue) { _dataRow.messageTime = dtMessageTime.Value; } else { _dataRow.SetmessageTimeNull(); } if (String.IsNullOrEmpty(strMessage)) { _dataRow.SetmessageNull(); } else { _dataRow.message = strMessage; } if (String.IsNullOrEmpty(strAttachment)) { _dataRow.SetattachemetNull(); } else { _dataRow.attachemet = strAttachment; } if (iType.HasValue) { _dataRow.type = iType.Value; } else { _dataRow.SettypeNull(); } if (iShopID.HasValue) { _dataRow.shop_id = iShopID.Value; } else { _dataRow.Setshop_idNull(); } if (iPhoneUserID.HasValue) { _dataRow.phoneUser_id = iPhoneUserID.Value; } else { _dataRow.SetphoneUser_idNull(); } if (String.IsNullOrEmpty(strLocationLink)) { _dataRow.SetlocationLinkNull(); } else { _dataRow.locationLink = strLocationLink; } if (bIsRead.HasValue) { _dataRow.is_read = bIsRead.Value; } else { _dataRow.Setis_readNull(); } if (fLatitude.HasValue) { _dataRow.latitude = fLatitude.Value; } else { _dataRow.SetlatitudeNull(); } if (fLongitude.HasValue) { _dataRow.longitude = fLongitude.Value; } else { _dataRow.SetlongitudeNull(); } if (m_iPrivateLabelID.HasValue) { _dataRow.private_label_id = iPrivateLabelID.Value; } else { _dataRow.Setprivate_label_idNull(); } _thisTable.AddMessageRow(_dataRow); } } }