本文整理汇总了C#中SocioBoard.Domain.User类的典型用法代码示例。如果您正苦于以下问题:C# User类的具体用法?C# User怎么用?C# User使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
User类属于SocioBoard.Domain命名空间,在下文中一共展示了User类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Update
//public User GetById(int id)
//{
// using (ISession session = NHibernateHelper.OpenSession())
// {
// User user = session
// .CreateCriteria(typeof(User))
// .Add(Restrictions.Eq("UserId", id))
// .UniqueResult<User>();
// return user;
// }
//}
public static void Update(User user)
{
using (NHibernate.ISession session = SessionFactory.GetNewSession())
{
using (NHibernate.ITransaction transaction = session.BeginTransaction())
{
try
{
int i = session.CreateQuery("Update User set ProfileUrl =:profileurl, UserName =: username , EmailId=:emailid,UserStatus=:userstatus,ExpiryDate=:expirydate,TimeZone=:timezone where Id = :twtuserid")
.SetParameter("twtuserid", user.Id)
.SetParameter("profileurl", user.ProfileUrl)
.SetParameter("username", user.UserName)
.SetParameter("emailid", user.EmailId)
.SetParameter("userstatus", user.UserStatus)
.SetParameter("expirydate", user.ExpiryDate)
.SetParameter("timezone", user.TimeZone)
.ExecuteUpdate();
transaction.Commit();
}
catch (Exception ex)
{
Console.WriteLine(ex.StackTrace);
}
}
}
}
开发者ID:utkarshx,项目名称:socioboard,代码行数:39,代码来源:UserRepository.cs
示例2: getNewFollowing
public string getNewFollowing(User user, string profileId,int days)
{
string strTwtFollowing = string.Empty;
try
{
//SocioBoard.Domain.User user = (User)Session["LoggedUser"];
TwitterStatsRepository objtwtStatsRepo = new TwitterStatsRepository();
ArrayList arrTwtStats = objtwtStatsRepo.getTwitterStatsByIdDay(user.Id, profileId, days);
string str = string.Empty;
foreach (var item in arrTwtStats)
{
Array temp = (Array)item;
strTwtFollowing += (temp.GetValue(3).ToString()) + ",";
}
if (arrTwtStats.Count < 7)
{
for (int i = 0; i < 7 - arrTwtStats.Count; i++)
{
str += "0,";
}
}
strTwtFollowing = str + strTwtFollowing;
strTwtFollowing = strTwtFollowing.Substring(0, strTwtFollowing.Length - 1);
// strTwtArray += "]";
}
catch (Exception Err)
{
Console.Write(Err.Message.ToString());
}
return strTwtFollowing;
}
开发者ID:NALSS,项目名称:socioboard,代码行数:32,代码来源:TwitterStatsHelper.cs
示例3: getAllUserPackageRelationByUserId
public List<UserPackageRelation> getAllUserPackageRelationByUserId(User objuser)
{
List<UserPackageRelation> alstFBAccounts = null;
try
{
using (NHibernate.ISession session = SessionFactory.GetNewSession())
{
using (NHibernate.ITransaction transaction = session.BeginTransaction())
{
try
{
alstFBAccounts = session.CreateQuery("from UserPackageRelation where UserId = : UserId")
.SetParameter("UserId", objuser.Id)
.List<UserPackageRelation>().ToList<UserPackageRelation>();
}
catch (Exception ex)
{
logger.Error("Error : " + ex.StackTrace);
Console.WriteLine("Error : " + ex.StackTrace);
}
}
}
}
catch (Exception ex)
{
logger.Error("Error : " + ex.StackTrace);
Console.WriteLine("Error : " + ex.StackTrace);
}
return alstFBAccounts;
}
开发者ID:NALSS,项目名称:socioboard,代码行数:31,代码来源:UserPackageRelationRepository.cs
示例4: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
try
{
User user = new User();
PackageRepository objPgeRepo = new PackageRepository();
ddlPackage.DataSource = objPgeRepo.getAllPackage();
ddlPackage.DataTextField = "PackageName";
ddlPackage.DataValueField = "PackageName";
ddlPackage.DataBind();
// ddlPackage.Items.Insert();
user = objUerRepo.getUsersById(Guid.Parse(Request.QueryString["id"].ToString()));
if (user != null)
{
txtName.Text = user.UserName;
txtEmail.Text = user.EmailId;
// txtdatepicker.Text = user.ExpiryDate.ToString();
datepicker.Text = user.ExpiryDate.ToString();
ddlPackage.SelectedValue = user.AccountType.ToString(); //user.PaymentStatus;
ddlStatus.SelectedValue = user.UserStatus.ToString();
}
}
catch (Exception ex)
{
logger.Error(ex.StackTrace);
}
}
}
开发者ID:utkarshx,项目名称:socioboard,代码行数:30,代码来源:EditUserDetail.aspx.cs
示例5: AddUserRefreeRelation
public void AddUserRefreeRelation(User objReferee, User objReference)
{
try
{
logger.Error("Entered AddUserRefreeRelation");
UserRefRelation objUserRefRelation = new UserRefRelation();
UserRefRelationRepository objUserRefRelationRepository = new UserRefRelationRepository();
objUserRefRelation.Id = Guid.NewGuid();
objUserRefRelation.RefereeUserId = objReferee.Id;
objUserRefRelation.ReferenceUserId = objReference.Id;
objUserRefRelation.ReferenceUserEmail = objReference.EmailId;
objUserRefRelation.RefereeUserEmail = objReferee.EmailId;
objUserRefRelation.EntryDate = DateTime.Now;
objUserRefRelation.Status = "0";
objUserRefRelationRepository.AddUserRefRelation(objUserRefRelation);
logger.Error("Coming out of AddUserRefreeRelation");
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
logger.Error(ex.Message);
}
}
开发者ID:rathika1,项目名称:socioboard,代码行数:27,代码来源:Registration.aspx.cs
示例6: Add
/// <summary>
/// Add a new student in the database.
/// </summary>
/// <param name="student">Student object</param>
public static void Add(User user)
{
using (NHibernate.ISession session = SessionFactory.GetNewSession())
{
using (NHibernate.ITransaction transaction = session.BeginTransaction())
{
session.Save(user);
transaction.Commit();
}
}
}
开发者ID:rathika1,项目名称:socioboard,代码行数:15,代码来源:UserRepository.cs
示例7: IsUserValid
/// <summary>
/// This function check Is User Exist or Not created by Abhay Kr 5-2-2014
/// </summary>
/// <param name="UserId"></param>
/// <returns>bool</returns>
public bool IsUserValid(string UserId, ref User user)
{
bool ret = false;
try
{
UserRepository objUserRepository = new UserRepository();
user = objUserRepository.getUsersById(Guid.Parse(UserId));
if (user != null)
ret = true;
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
logger.Error(ex.Message);
}
return ret;
}
开发者ID:rathika1,项目名称:socioboard,代码行数:23,代码来源:Registration.aspx.cs
示例8: btnSave_Click
protected void btnSave_Click(object sender, EventArgs e)
{
try
{
User user = new User();
user.Id =Guid.Parse(Request.QueryString["id"].ToString());
user.EmailId = txtEmail.Text;
user.ExpiryDate = Convert.ToDateTime(datepicker.Text);
user.UserName = txtName.Text;
user.UserStatus=1;
UserRepository.Update(user);
}
catch (Exception Err)
{
logger.Error(Err.Message);
Console.Write(Err.StackTrace);
}
}
开发者ID:utkarshx,项目名称:socioboard,代码行数:18,代码来源:EditUserDetail.aspx.cs
示例9: SetPaymentStatus
public int SetPaymentStatus(Guid guid)
{
int res = 0;
try
{
UserRepository objUserRepository = new UserRepository();
User user = new Domain.User();
user.Id = guid;
user.PaymentStatus = "paid";
res=objUserRepository.UpdatePaymentStatusByUserId(user);
}
catch (Exception ex)
{
Console.WriteLine("Error : " + ex.StackTrace);
}
return res;
}
开发者ID:JBNavadiya,项目名称:socioboard,代码行数:19,代码来源:SuccessPaypal.aspx.cs
示例10: Add
/// <summary>
/// Add a new student in the database.
/// </summary>
/// <param name="student">Student object</param>
public static void Add(User user)
{
using (NHibernate.ISession session = SessionFactory.GetNewSession())
{
using (NHibernate.ITransaction transaction = session.BeginTransaction())
{
try
{
session.Save(user);
transaction.Commit();
}
catch (Exception ex)
{
Console.WriteLine(ex.StackTrace);
}
}
}
}
开发者ID:utkarshx,项目名称:socioboard,代码行数:24,代码来源:UserRepository.cs
示例11: Register
public string Register(string EmailId, string Password, string AccountType, string FirstName, string LastName)
{
try
{
UserRepository userrepo = new UserRepository();
if (!userrepo.IsUserExist(EmailId))
{
Registration regObject = new Registration();
User user = new User();
user.AccountType = AccountType;
user.EmailId = EmailId;
user.CreateDate = DateTime.Now;
user.ExpiryDate = DateTime.Now.AddMonths(1);
user.Password = regObject.MD5Hash(Password);
user.PaymentStatus = "unpaid";
user.ProfileUrl = string.Empty;
user.TimeZone = string.Empty;
user.UserName = FirstName + " " + LastName;
user.UserStatus = 1;
user.Id = Guid.NewGuid();
UserRepository.Add(user);
MailSender.SendEMail(user.UserName,Password, EmailId);
return new JavaScriptSerializer().Serialize(user);
}
else
{
return "Email Already Exists";
}
}
catch (Exception ex)
{
Console.WriteLine(ex.StackTrace);
return "Something Went Wrong";
}
}
开发者ID:JBNavadiya,项目名称:socioboard,代码行数:40,代码来源:UserService.asmx.cs
示例12: GetFollowersAgeWise
public string GetFollowersAgeWise(User user,int days)
{
string strTwtAgeArray = string.Empty;
try
{
TwitterStatsRepository objtwtStatsRepo = new TwitterStatsRepository();
object arrTwtStats = objtwtStatsRepo.getFollowersAgeCount(user.Id,days);
string[] arr = ((IEnumerable)arrTwtStats).Cast<object>().Select(x => x.ToString()).ToArray();
strTwtAgeArray="0,";
for (int i = 0; i < arr.Count(); i++)
{
strTwtAgeArray += arr[i] + ",";
}
strTwtAgeArray = strTwtAgeArray.Substring(0, strTwtAgeArray.Length - 1) ;
//strTwtArray += "]";
}
catch (Exception Err)
{
Console.Write(Err.Message.ToString());
}
return strTwtAgeArray;
}
开发者ID:NALSS,项目名称:socioboard,代码行数:22,代码来源:TwitterStatsHelper.cs
示例13: ChangePassword
public string ChangePassword(string EmailId, string Password, string NewPassword)
{
try
{
User user = new User();
UserRepository userrepo = new UserRepository();
int i = userrepo.ChangePassword(NewPassword, Password, EmailId);
if (i == 1)
{
return "Password Changed Successfully";
}
else
{
return "Invalid EmailId";
}
}
catch (Exception ex)
{
Console.WriteLine(ex.StackTrace);
return "Please Try Again";
}
}
开发者ID:utkarshx,项目名称:socioboard,代码行数:23,代码来源:UserService.asmx.cs
示例14: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
string ret = string.Empty;
try
{
User objUser = new User();
UserRepository objUserRepository = new UserRepository();
scheduling objscheduling = new scheduling();
ScheduledMessage objScheduledMessage = new ScheduledMessage();
ScheduledMessageRepository objScheduledMessageRepository = new ScheduledMessageRepository();
List<ScheduledTracker> lstScheduledTracker = objScheduledMessageRepository.GetAllScheduledDetails();
foreach (ScheduledTracker item in lstScheduledTracker)
{
try
{
//List<ScheduledMessage> lstScheduledMessage = objScheduledMessageRepository.getAllMessagesOfUser(Guid.Parse(item._Id));
List<ScheduledMessage> lstUnsentScheduledMessage = objScheduledMessageRepository.getAllIUnSentMessagesOfUser(Guid.Parse(item._Id));
objUser = objUserRepository.getUsersById(Guid.Parse(item._Id));
ret += "<tr class=\"gradeX\"><td><a href=\"ScheduledMessageDetail.aspx?id=" + objUser.Id + "\">" + objUser.UserName + "</a></td><td>" + item._count + "</td><td>" + (item._count - lstUnsentScheduledMessage.Count()) + "</td><td>" + lstUnsentScheduledMessage.Count() + "</td></tr>";
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
Response.Write(ret);
}
开发者ID:JBNavadiya,项目名称:socioboard,代码行数:36,代码来源:Ajaxscheduled.aspx.cs
示例15: btnSignup_Click
protected void btnSignup_Click(object sender, ImageClickEventArgs e)
{
User user = new User();
UserRepository userrepo = new UserRepository();
try
{
if (txtPassword.Text == txtConfirmPassword.Text)
{
user.AccountType = "free";
user.CreateDate = DateTime.Now;
user.ExpiryDate = DateTime.Now.AddMonths(1);
user.Id = Guid.NewGuid();
user.UserName = txtUserName.Text;
user.Password = this.MD5Hash(txtPassword.Text);
user.EmailId = txtEmail.Text;
user.UserStatus = 1;
if (!userrepo.IsUserExist(user.EmailId))
{
UserRepository.Add(user);
MailSender.SendEMail(txtUserName.Text, txtPassword.Text, txtEmail.Text);
lblerror.Text = "registered successfully !" + "<a href=\"login.aspx\">login</a>";
}
else
{
lblerror.Text = "email already exists " + "<a href=\"login.aspx\">login</a>";
}
}
}
catch (Exception ex)
{
lblerror.Text = "Please Insert Correct Information";
Console.WriteLine(ex.StackTrace);
}
}
开发者ID:utkarshx,项目名称:socioboard,代码行数:36,代码来源:Registration.aspx.cs
示例16: UpdateReferenceUserByUserId
public int UpdateReferenceUserByUserId(User user)
{
int i = 0;
try
{
using (NHibernate.ISession session = SessionFactory.GetNewSession())
{
using (NHibernate.ITransaction transaction = session.BeginTransaction())
{
try
{
i = session.CreateQuery("Update User set ReferenceStatus =:referenceStatus where Id = :id")
.SetParameter("referenceStatus", user.ReferenceStatus)
.SetParameter("id", user.Id)
.ExecuteUpdate();
transaction.Commit();
}
catch (Exception ex)
{
Console.WriteLine(ex.StackTrace);
}
}
}
}
catch (Exception ex)
{
Console.WriteLine(ex.StackTrace);
}
return i;
}
开发者ID:NALSS,项目名称:socioboard,代码行数:36,代码来源:UserRepository.cs
示例17: getTwitterUserProfile
/// <summary>
///
/// </summary>
private void getTwitterUserProfile()
{
var requestToken = (String)Request.QueryString["oauth_token"];
var requestSecret = (String)Session["requestSecret"];
var requestVerifier = (String)Request.QueryString["oauth_verifier"];
OAuth.AccessToken = requestToken;
OAuth.AccessTokenSecret = requestVerifier;
OAuth.AccessTokenGet(requestToken, requestVerifier);
JArray profile = userinfo.Get_Users_LookUp_ByScreenName(OAuth, OAuth.TwitterScreenName);
User user = (User)Session["LoggedUser"];
SocialProfilesRepository socioprofilerepo = new SocialProfilesRepository();
SocialProfile socioprofile = new SocialProfile();
#region for managing referrals
ManageReferrals(OAuth);
#endregion
foreach (var item in profile)
{
try
{
twitterAccount.FollowingCount = Convert.ToInt32(item["friends_count"].ToString());
}
catch (Exception ex)
{
Console.WriteLine(ex.StackTrace);
}
try
{
twitterAccount.FollowersCount = Convert.ToInt32(item["followers_count"].ToString());
}
catch (Exception ex)
{
Console.WriteLine(ex.StackTrace);
}
twitterAccount.Id = Guid.NewGuid();
twitterAccount.IsActive = true;
twitterAccount.OAuthSecret = OAuth.AccessTokenSecret;
twitterAccount.OAuthToken = OAuth.AccessToken;
try
{
twitterAccount.ProfileImageUrl = item["profile_image_url"].ToString().TrimStart('"').TrimEnd('"');
}
catch (Exception ex)
{
Console.WriteLine(ex.StackTrace);
}
try
{
twitterAccount.ProfileUrl = string.Empty;
}
catch (Exception ex)
{
Console.WriteLine(ex.StackTrace);
}
try
{
twitterAccount.TwitterUserId = item["id_str"].ToString().TrimStart('"').TrimEnd('"');
}
catch (Exception er)
{
try
{
twitterAccount.TwitterUserId = item["id"].ToString().TrimStart('"').TrimEnd('"');
}
catch (Exception err)
{
Console.WriteLine(err.StackTrace);
}
Console.WriteLine(er.StackTrace);
}
try
{
twitterAccount.TwitterScreenName = item["screen_name"].ToString().TrimStart('"').TrimEnd('"');
}
catch (Exception ex)
{
Console.WriteLine(ex.StackTrace);
}
twitterAccount.UserId = user.Id;
socioprofile.Id = Guid.NewGuid();
socioprofile.ProfileDate = DateTime.Now;
socioprofile.ProfileId = twitterAccount.TwitterUserId;
socioprofile.ProfileType = "twitter";
socioprofile.UserId = user.Id;
if (HttpContext.Current.Session["login"] != null)
{
//.........这里部分代码省略.........
开发者ID:NALSS,项目名称:socioboard,代码行数:101,代码来源:TwitterManager.aspx.cs
示例18: btnRegister_Click
protected void btnRegister_Click(object sender, ImageClickEventArgs e)
{
User user = new User();
UserRepository userrepo = new UserRepository();
SocioBoard.Helper.SessionFactory.configfilepath = Server.MapPath("~/hibernate.cfg.xml");
try
{
if (txtPassword.Text == txtConfirmPassword.Text)
{
user.PaymentStatus = "unpaid";
user.AccountType = Request.QueryString["type"];
if (user.AccountType == string.Empty)
{
user.AccountType = AccountType.Deluxe.ToString();
}
user.CreateDate = DateTime.Now;
user.ExpiryDate = DateTime.Now.AddMonths(1);
user.Id = Guid.NewGuid();
user.UserName = txtFirstName.Text + " " + txtLastName.Text;
user.Password = this.MD5Hash(txtPassword.Text);
user.EmailId = txtEmail.Text;
user.UserStatus = 1;
if (!userrepo.IsUserExist(user.EmailId))
{
UserRepository.Add(user);
SocialSuitePro.Helper.MailSender.SendEMail(txtFirstName.Text + " " + txtLastName.Text, txtPassword.Text, txtEmail.Text);
TeamRepository teamRepo = new TeamRepository();
Team team = teamRepo.getTeamByEmailId(txtEmail.Text);
if (team != null)
{
Guid teamid = Guid.Parse(Request.QueryString["tid"]);
teamRepo.updateTeamStatus(teamid);
TeamMemberProfileRepository teamMemRepo = new TeamMemberProfileRepository();
List<TeamMemberProfile> lstteammember = teamMemRepo.getAllTeamMemberProfilesOfTeam(team.Id);
foreach (TeamMemberProfile item in lstteammember)
{
try
{
SocialProfilesRepository socialRepo = new SocialProfilesRepository();
SocialProfile socioprofile = new SocialProfile();
socioprofile.Id = Guid.NewGuid();
socioprofile.ProfileDate = DateTime.Now;
socioprofile.ProfileId = item.ProfileId;
socioprofile.ProfileType = item.ProfileType;
socioprofile.UserId = user.Id;
socialRepo.addNewProfileForUser(socioprofile);
if (item.ProfileType == "facebook")
{
try
{
FacebookAccount fbAccount = new FacebookAccount();
FacebookAccountRepository fbAccountRepo = new FacebookAccountRepository();
FacebookAccount userAccount = fbAccountRepo.getUserDetails(item.ProfileId);
fbAccount.AccessToken = userAccount.AccessToken;
fbAccount.EmailId = userAccount.EmailId;
fbAccount.FbUserId = item.ProfileId;
fbAccount.FbUserName = userAccount.FbUserName;
fbAccount.Friends = userAccount.Friends;
fbAccount.Id = Guid.NewGuid();
fbAccount.IsActive = true;
fbAccount.ProfileUrl = userAccount.ProfileUrl;
fbAccount.Type = userAccount.Type;
fbAccount.UserId = user.Id;
fbAccountRepo.addFacebookUser(fbAccount);
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
logger.Error(ex.Message);
}
}
else if (item.ProfileType == "twitter")
{
try
{
TwitterAccount twtAccount = new TwitterAccount();
TwitterAccountRepository twtAccRepo = new TwitterAccountRepository();
TwitterAccount twtAcc = twtAccRepo.getUserInfo(item.ProfileId);
twtAccount.FollowersCount = twtAcc.FollowersCount;
twtAccount.FollowingCount = twtAcc.FollowingCount;
twtAccount.Id = Guid.NewGuid();
twtAccount.IsActive = true;
twtAccount.OAuthSecret = twtAcc.OAuthSecret;
twtAccount.OAuthToken = twtAcc.OAuthToken;
twtAccount.ProfileImageUrl = twtAcc.ProfileImageUrl;
twtAccount.ProfileUrl = twtAcc.ProfileUrl;
twtAccount.TwitterName = twtAcc.TwitterName;
twtAccount.TwitterScreenName = twtAcc.TwitterScreenName;
twtAccount.TwitterUserId = twtAcc.TwitterUserId;
twtAccount.UserId = user.Id;
twtAccRepo.addTwitterkUser(twtAccount);
}
catch (Exception ex)
{
Console.WriteLine(ex.StackTrace);
//.........这里部分代码省略.........
开发者ID:utkarshx,项目名称:socioboard,代码行数:101,代码来源:SocialRegisterPage.aspx.cs
示例19: getInfluence
public string getInfluence(User user, string profileId,int days)
{
string strArray = string.Empty;
try
{
TwitterStatsRepository objtwtstatsRepo = new TwitterStatsRepository();
ArrayList alstTwt = objtwtstatsRepo.getTwitterStatsById(user.Id, profileId,days);
// strArray = "[";
int cnt = 0;
string str = string.Empty;
if (alstTwt.Count > 0)
{
foreach(var itemInf in alstTwt)
{
Array temp = (Array)itemInf;
strArray = strArray + temp.GetValue(8).ToString() + ",";
cnt++;
}
}
if (cnt < 7)
{
for (int j = 0; j < 7 - cnt; j++)
{
str=str + "0,";
}
}
strArray = str + strArray.Substring(0,strArray.Length-1);
}
catch (Exception Err)
{
Console.Write(Err.StackTrace);
}
return strArray;
}
开发者ID:NALSS,项目名称:socioboard,代码行数:34,代码来源:TwitterStatsHelper.cs
示例20: btnRegister_Click
protected void btnRegister_Click(object sender, ImageClickEventArgs e)
{
User user = new User();
UserRepository userrepo = new UserRepository();
UserActivation objUserActivation = new UserActivation();
Coupon objCoupon = new Coupon();
CouponRepository objCouponRepository = new CouponRepository();
SocioBoard.Helper.SessionFactory.configfilepath = Server.MapPath("~/hibernate.cfg.xml");
try
{
if (DropDownList1.SelectedValue == "Basic" || DropDownList1.SelectedValue == "Standard" || DropDownList1.SelectedValue == "Deluxe" || DropDownList1.SelectedValue == "Premium")
{
if (TextBox1.Text.Trim() != "")
{
string resp = SBUtils.GetCouponStatus(TextBox1.Text).ToString();
if (resp != "valid")
{
// ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert(Not valid);", true);
ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('" + resp + "');", true);
return;
}
}
if (txtPassword.Text == txtConfirmPassword.Text)
{
user.PaymentStatus = "unpaid";
//user.AccountType = Request.QueryString["type"];
user.AccountType = DropDownList1.SelectedValue.ToString();
if (string.IsNullOrEmpty(user.AccountType))
{
user.AccountType = AccountType.Free.ToString();
}
user.CreateDate = DateTime.Now;
user.ExpiryDate = DateTime.Now.AddMonths(1);
user.Id = Guid.NewGuid();
user.UserName = txtFirstName.Text + " " + txtLastName.Text;
user.Password = this.MD5Hash(txtPassword.Text);
user.EmailId = txtEmail.Text;
user.UserStatus = 1;
user.ActivationStatus = "0";
if (TextBox1.Text.Trim() != "")
{
user.CouponCode = TextBox1.Text.Trim().ToString();
}
if (!userrepo.IsUserExist(user.EmailId))
{
UserRepository.Add(user);
if (TextBox1.Text.Trim() != "")
{
objCoupon.CouponCode = TextBox1.Text.Trim();
List<Coupon> lstCoupon = objCouponRepository.GetCouponByCouponCode(objCoupon);
objCoupon.Id = lstCoupon[0].Id;
objCoupon.EntryCouponDate = lstCoupon[0].EntryCouponDate;
objCoupon.ExpCouponDate = lstCoupon[0].ExpCouponDate;
objCoupon.Status = "1";
objCouponRepository.SetCouponById(objCoupon);
}
Session["LoggedUser"] = user;
objUserActivation.Id = Guid.NewGuid();
objUserActivation.UserId = user.Id;
objUserActivation.ActivationStatus = "0";
UserActivationRepository.Add(objUserActivation);
//add package start
UserPackageRelation objUserPackageRelation = new UserPackageRelation();
UserPackageRelationRepository objUserPackageRelationRepository = new UserPackageRelationRepository();
PackageRepository objPackageRepository = new PackageRepository();
Package objPackage = objPackageRepository.getPackageDetails(user.AccountType);
objUserPackageRelation.Id = new Guid();
objUserPackageRelation.PackageId = objPackage.Id;
objUserPackageRelation.UserId = user.Id;
objUserPackageRelation.ModifiedDate = DateTime.Now;
objUserPackageRelation.PackageStatus = true;
objUserPackageRelationRepository.AddUserPackageRelation(objUserPackageRelation);
//end package
SocioBoard.Helper.MailSender.SendEMail(txtFirstName.Text, txtPassword.Text, txtEmail.Text, user.AccountType.ToString(),user.Id.ToString());
TeamRepository teamRepo = new TeamRepository();
Team team = teamRepo.getTeamByEmailId(txtEmail.Text);
if (team != null)
{
Guid teamid = Guid.Parse(Request.QueryString["tid"]);
teamRepo.updateTeamStatus(teamid);
TeamMemberProfileRepository teamMemRepo = new TeamMemberProfileRepository();
List<TeamMemberProfile> lstteammember = teamMemRepo.getAllTeamMemberProfilesOfTeam(team.Id);
foreach (TeamMemberProfile item in lstteammember)
{
try
{
SocialProfilesRepository socialRepo = new SocialProfilesRepository();
SocialProfile socioprofile = new SocialProfile();
//.........这里部分代码省略.........
开发者ID:Kiranub313,项目名称:socioboard,代码行数:101,代码来源:RegisterPage.aspx.cs
注:本文中的SocioBoard.Domain.User类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论