本文整理匯總了C#中SocioBoard.Model.UserRepository.UpdateUserExpiryDateById方法的典型用法代碼示例。如果您正苦於以下問題:C# UserRepository.UpdateUserExpiryDateById方法的具體用法?C# UserRepository.UpdateUserExpiryDateById怎麽用?C# UserRepository.UpdateUserExpiryDateById使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類SocioBoard.Model.UserRepository
的用法示例。
在下文中一共展示了UserRepository.UpdateUserExpiryDateById方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: IsUserReferenceActivated
/// <summary>
/// to check user reference and update user expiry , userrefrencerelation status
/// created by Abhay Kr 5-3-2014
/// </summary>
/// <param name="RefereeId"></param>
/// <returns></returns>
public bool IsUserReferenceActivated(string RefereeId)
{
//testing
Console.WriteLine("Inside " + RefereeId);
bool ret = false;
try
{
User objUser = new User();
Package objPackage=new Package ();
UserPackageRelation objUserPackageRelation=new UserPackageRelation ();
UserRepository objUserRepository = new UserRepository();
UserPackageRelationRepository objUserPackageRelationRepository = new UserPackageRelationRepository();
UserRefRelation objUserRefRelation = new UserRefRelation();
UserRefRelationRepository objUserRefRelationRepository = new UserRefRelationRepository();
PackageRepository objPackageRepository = new PackageRepository();
objUserRefRelation.ReferenceUserId = (Guid.Parse(RefereeId));
//testing
List<UserRefRelation> check =objUserRefRelationRepository.GetUserRefRelationInfo();
//testing
List<UserRefRelation> lstUserRefRelation = objUserRefRelationRepository.GetUserRefRelationInfoByRefreeId(objUserRefRelation);
if (lstUserRefRelation.Count > 0)
{
if (lstUserRefRelation[0].Status == "0")
{
objUserRefRelation = lstUserRefRelation[0];
objUserRefRelation.Status = "1";
objUser = objUserRepository.getUsersById(lstUserRefRelation[0].ReferenceUserId);
objUser.ExpiryDate = objUser.ExpiryDate.AddDays(30);
objUser.AccountType = "Premium";
objPackage = objPackageRepository.getPackageDetails("Premium");
objUserPackageRelation.Id=Guid.NewGuid();
objUserPackageRelation.UserId=objUser.Id;
objUserPackageRelation.PackageId=objPackage.Id;
objUserPackageRelation.ModifiedDate=DateTime.Now;
objUserPackageRelation.PackageStatus=true;
objUserPackageRelationRepository.AddUserPackageRelation(objUserPackageRelation);
int objUserRepositoryresponse = objUserRepository.UpdateUserExpiryDateById(objUser);
int objUserRefRelationRepositoryresponse = objUserRefRelationRepository.UpdateStatusById(objUserRefRelation);
}
}
}
catch (Exception ex)
{
logger.Error(ex.Message);
}
return ret;
}
示例2: IsUserReferenceActivated
/// <summary>
/// to check user reference and update user expiry , userrefrencerelation status
/// created by Abhay Kr 5-3-2014
/// </summary>
/// <param name="RefereeId"></param>
/// <returns></returns>
public bool IsUserReferenceActivated(string RefereeId)
{
bool ret = false;
try
{
User objUser = new User();
UserRepository objUserRepository = new UserRepository();
UserRefRelation objUserRefRelation = new UserRefRelation();
UserRefRelationRepository objUserRefRelationRepository = new UserRefRelationRepository();
objUserRefRelation.ReferenceUserId = (Guid.Parse(RefereeId));
List<UserRefRelation> lstUserRefRelation = objUserRefRelationRepository.GetUserRefRelationInfoById(objUserRefRelation);
if (lstUserRefRelation.Count > 0)
{
if (lstUserRefRelation[0].Status == "0")
{
objUserRefRelation = lstUserRefRelation[0];
objUserRefRelation.Status = "1";
objUser = objUserRepository.getUsersById(lstUserRefRelation[0].ReferenceUserId);
objUser.ExpiryDate = objUser.ExpiryDate.AddDays(30);
int objUserRepositoryresponse = objUserRepository.UpdateUserExpiryDateById(objUser);
int objUserRefRelationRepositoryresponse = objUserRefRelationRepository.UpdateStatusById(objUserRefRelation);
}
}
}
catch (Exception ex)
{
logger.Error(ex.Message);
}
return ret;
}