本文整理汇总了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;
}