0
:更新ユーザーフィールド毎月、管理役割およびサブスクリプション
public class Subscriptions
{
public int SubscriptionId {Get;Set;}
public DateTime CreateTime {Get;set;}
public int SubscriptionType{get;set;}//fk
public bool IsActive {get;set;}
}
は今ここに私を混乱させている部分があります
if(_profileStatus == ProfileStatus.ACTIVEPROFILE)
{
// I also have a LastPaymentDate from API here...
var lastPaymentDate = _profileStatus.LastPaymentDate.AddMonths(1);
// this is to ensure we can compare it against the current date
if(currentDate>LastPaymentDate)
{
// Should signal that the field in user table can be reset
}
}
0:ユーザーのサブスクリプションは、彼がこのようにログインするたびにアクティブであるかどうか、私がチェックを行うので
Public class Users
{
// some properties...
public int HitViews {get;set;}
}
:私のユーザーテーブルに配置され、ユーザーのフィールドをリセットする方法私たちは次のような状況を想像している場合、ここで
問題は、次のとおりです。
- ユーザーは、サブスクリプションが更新された日にログインしていない場合、私は私のAPIからlastPaymentDateを受信したとき、このように、それが最新であるもの日付、およびステートメントは、フィールドをリセットする場合、私は第二には履行を持っていません....
私は私のサブスクリプションテーブルにLastPaymentDateを格納することによって、これを修正し、このように、それに対してチェックを実行する想像:
if(_profileStatus == ProfileStatus.ACTIVEPROFILE)
{
if(currentDate>myDBLastPaymentDate)
{
// now I should check whether the db last payment date and API last payment date are different, if they are, then I simply swipe the DB value with API value ?
}
}
ここで私の質問は、これを有効にする正しい方法ですか、そうでない場合は、私はこれを改善できるようにあなたの人の提案は何ですか?
誰かが私を助けることができますか?
はい、正しい方法です。別の方法は、Compareメソッドを使用することです。 – Chirag
比較される変数名は大文字ですか、それはタイプミスですか、その行の直前で定義された変数以外のものを比較していますか? (行:if(currentDate> LastPaymentDate)) –
@RamazanBinarbasi typo、私はスタック上にこのコードを書いています。 – User987