本文整理匯總了C#中SocioBoard.Model.UserRepository.SetUserByUserId方法的典型用法代碼示例。如果您正苦於以下問題:C# UserRepository.SetUserByUserId方法的具體用法?C# UserRepository.SetUserByUserId怎麽用?C# UserRepository.SetUserByUserId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類SocioBoard.Model.UserRepository
的用法示例。
在下文中一共展示了UserRepository.SetUserByUserId方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: btnRegister_Click
protected void btnRegister_Click(object sender, ImageClickEventArgs e)
{
Groups groups = new Groups();
GroupRepository objGroupRepository = new GroupRepository();
Team teams = new Team();
TeamRepository objTeamRepository = new TeamRepository();
try
{
Session["login"] = null;
Registration regpage = new Registration();
User user = (User)Session["LoggedUser"];
if (DropDownList1.SelectedValue == "Free" || 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 (user != null)
{
user.EmailId = txtEmail.Text;
user.UserName = txtFirstName.Text + " " + txtLastName.Text;
UserActivation objUserActivation = new UserActivation();
UserRepository userrepo = new UserRepository();
Coupon objCoupon = new Coupon();
CouponRepository objCouponRepository = new CouponRepository();
if (userrepo.IsUserExist(user.EmailId))
{
try
{
string acctype = string.Empty;
if (Request.QueryString["type"] != null)
{
if (Request.QueryString["type"] == "INDIVIDUAL" || Request.QueryString["type"] == "CORPORATION" || Request.QueryString["type"] == "SMALL BUSINESS")
{
acctype = Request.QueryString["type"];
}
else
{
acctype = "INDIVIDUAL";
}
}
else
{
acctype = "INDIVIDUAL";
}
user.AccountType = Request.QueryString["type"];
}
catch (Exception ex)
{
logger.Error(ex.StackTrace);
Console.WriteLine(ex.StackTrace);
}
user.AccountType = DropDownList1.SelectedValue.ToString();
if (string.IsNullOrEmpty(user.AccountType))
{
user.AccountType = AccountType.Free.ToString();
}
if (string.IsNullOrEmpty(user.Password))
{
user.Password = regpage.MD5Hash(txtPassword.Text);
// userrepo.UpdatePassword(user.EmailId, user.Password, user.Id, user.UserName, user.AccountType);
string couponcode = TextBox1.Text.Trim();
userrepo.SetUserByUserId(user.EmailId, user.Password, user.Id, user.UserName, user.AccountType, couponcode);
try
{
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);
}
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
logger.Error("Error : " + ex.Message);
logger.Error("Error : " + ex.StackTrace);
}
//add userActivation
//.........這裏部分代碼省略.........
示例2: btnRegister_Click
protected void btnRegister_Click(object sender, ImageClickEventArgs e)
{
try
{
Session["login"] = null;
Registration regpage = new Registration();
User user = (User)Session["LoggedUser"];
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 (user != null)
{
user.EmailId = txtEmail.Text;
user.UserName = txtFirstName.Text + " " + txtLastName.Text;
UserActivation objUserActivation = new UserActivation();
UserRepository userrepo = new UserRepository();
Coupon objCoupon = new Coupon();
CouponRepository objCouponRepository = new CouponRepository();
if (userrepo.IsUserExist(user.EmailId))
{
try
{
string acctype = string.Empty;
if (Request.QueryString["type"] != null)
{
if (Request.QueryString["type"] == "INDIVIDUAL" || Request.QueryString["type"] == "CORPORATION" || Request.QueryString["type"] == "SMALL BUSINESS")
{
acctype = Request.QueryString["type"];
}
else
{
acctype = "INDIVIDUAL";
}
}
else
{
acctype = "INDIVIDUAL";
}
user.AccountType = Request.QueryString["type"];
}
catch (Exception ex)
{
logger.Error(ex.StackTrace);
Console.WriteLine(ex.StackTrace);
}
user.AccountType = DropDownList1.SelectedValue.ToString();
if (string.IsNullOrEmpty(user.AccountType))
{
user.AccountType = AccountType.Free.ToString();
}
if (string.IsNullOrEmpty(user.Password))
{
user.Password = regpage.MD5Hash(txtPassword.Text);
// userrepo.UpdatePassword(user.EmailId, user.Password, user.Id, user.UserName, user.AccountType);
string couponcode = TextBox1.Text.Trim();
userrepo.SetUserByUserId(user.EmailId, user.Password, user.Id, user.UserName, user.AccountType, couponcode);
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);
}
//add userActivation
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;
//.........這裏部分代碼省略.........