📄 accountui.ascx.cs
字号:
namespace NPetshop.Web.UserControls.Accounts
{
using System;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using NPetshop.Domain.Accounts;
using NPetshop.Domain.Catalog;
/// <summary>
/// Description r閟um閑 de Account.
/// </summary>
public partial class AccountUI : System.Web.UI.UserControl
{
public NPetshop.Domain.Accounts.Account Account
{
get
{
NPetshop.Domain.Accounts.Account account = new NPetshop.Domain.Accounts.Account();
account.Login = textboxLogin.Text;
account.Password = textboxPassword.Text;
account.Email = textboxEmail.Text;
account.Address = ucAddress.Address ;
account.Profile.FavoriteLanguage = listLanguage.SelectedItem.Value ;
account.Profile.FavouriteCategory = new Category();
account.Profile.FavouriteCategory.Id = listCategory.SelectedItem.Value;
account.Profile.IsShowFavorites = chkShowFavorites.Checked;
account.Profile.IsShowBanners = chkShowBanners.Checked;
return account;
}
set
{
textboxLogin.Text = value.Login;
textboxPassword.Text = value.Password;
textboxEmail.Text = value.Email;
ucAddress.Address = value.Address;
SetSelectedItem(listLanguage, value.Profile.FavoriteLanguage);
SetSelectedItem(listCategory, value.Profile.FavouriteCategory.Id);
chkShowFavorites.Checked = value.Profile.IsShowFavorites;
chkShowBanners.Checked = value.Profile.IsShowBanners;
}
}
private void SetSelectedItem(DropDownList list, string value)
{
ListItem item = list.Items.FindByValue(value);
if (item != null)
{
item.Selected = true;
}
}
protected void Page_Load(object sender, System.EventArgs e)
{
// Placer ici le code utilisateur pour initialiser la page
}
#region Code g閚閞?par le Concepteur Web Form
override protected void OnInit(EventArgs e)
{
//
// CODEGEN? Cet appel est requis par le Concepteur Web Form ASP.NET.
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// M閠hode requise pour la prise en charge du concepteur - ne modifiez pas
/// le contenu de cette m閠hode avec l'閐iteur de code.
/// </summary>
private void InitializeComponent()
{
}
#endregion
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -