本文整理汇总了C#中Member类的典型用法代码示例。如果您正苦于以下问题:C# Member类的具体用法?C# Member怎么用?C# Member使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Member类属于命名空间,在下文中一共展示了Member类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Map
public void Map(ClassMappingBase classMap, Member member)
{
if (!(classMap is ClassMapping)) return;
var version = new VersionMapping
{
ContainingEntityType = classMap.Type,
};
version.Set(x => x.Name, Layer.Defaults, member.Name);
version.Set(x => x.Type, Layer.Defaults, GetDefaultType(member));
var columnMapping = new ColumnMapping();
columnMapping.Set(x => x.Name, Layer.Defaults, member.Name);
version.AddColumn(Layer.Defaults, columnMapping);
SetDefaultAccess(member, version);
if (IsSqlTimestamp(member))
{
version.Columns.Each(column =>
{
column.Set(x => x.SqlType, Layer.Defaults, "timestamp");
column.Set(x => x.NotNull, Layer.Defaults, true);
});
version.Set(x => x.UnsavedValue, Layer.Defaults, null);
}
((ClassMapping)classMap).Set(x => x.Version, Layer.Defaults, version);
}
示例2: btnActivat_Click
protected void btnActivat_Click(object sender, EventArgs e)
{
string msg = string.Empty;
if (bll.ActivatMember(Int32.Parse(HidMemberID.Value), txtActivat.Text, ref msg))
{
lbMsg1.Text = "激活成功,请登录";
lbMsg2.Text = "";
lbMsg3.Text = "";
lbMsg1.DataBind();
//激活成功后直接登录
Member modelMember = new Member();
if (bll.LoginMember(Int32.Parse(HidMemberID.Value), ref msg, ref modelMember))
{
//设置session
Session["MemberInfo"] = modelMember;
//跳转登录
Response.Redirect("MemberInfo.aspx");
}
else
{
lbMsg1.Text = msg;
lbMsg2.Text = "";
lbMsg3.Text = "";
}
}
else
{
lbMsg1.Text = msg;
lbMsg2.Text = "";
lbMsg3.Text = "";
}
}
示例3: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
MemberService service = new MemberService();
_userlogin = (Member)Session[SessionKey.USERLOGIN];
string nowip;
nowip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
if (nowip == null)
{
nowip = Request.ServerVariables["REMOTE_ADDR"];
}
if (!Page.IsPostBack)
{
ViewWebSite v = new ViewWebSite();
v.IP = nowip;
v.Page = "aboutus.aspx";
if (_userlogin == null)
{
v.User = "ผู้ใช้ทั่วไป";
}
else
{
v.User = _userlogin.UserName;
}
if (service.CreateViewWebSite(v))
{
Console.WriteLine("save view complate");
}
}
}
示例4: ShouldMap
public bool ShouldMap(Member member)
{
var shouldMap = _defaultManyToManyStep.ShouldMap(member) || member.MemberInfo.IsDefined(typeof(HasManyToManyAttribute), true);
return shouldMap;
//modify this statement to check for other attributes or conventions
}
示例5: UpdateMember
public virtual void UpdateMember(Member member)
{
_memberDataContext.Members.Attach(member);
DbEntityEntry<Member> dbEntry = _memberDataContext.Entry(member);
dbEntry.State = EntityState.Modified;
_memberDataContext.SaveChanges();
}
示例6: GetKeyName
protected override string GetKeyName(Member property, Type type)
{
if (property == null)
return type.Name + "Id"; // many-to-many, one-to-many, join
return property.Name + "Id"; // many-to-one
}
示例7: GetKeyName
protected override string GetKeyName(Member property, Type type)
{
if (property == null)
return string.Format("{0}Id", type.Name);
return string.Format("{0}Id", property.Name);
}
示例8: GetAccessStrategyForReadOnlyProperty
public virtual Access GetAccessStrategyForReadOnlyProperty(Member member)
{
if (member.IsAutoProperty)
return Access.BackField;
return Access.ReadOnlyPropertyThroughCamelCaseField();
}
示例9: GetCustomAttributes
public static AttributeList GetCustomAttributes( Member member, TypeNode attrType ) {
AttributeList result = null;
if (member == null)
return null;
AttributeList attrs = member.Attributes;
if( attrs != null ) {
for( int i = 0; i < attrs.Count; i++ ) {
AttributeNode an = attrs[i];
if (an == null) continue;
MemberBinding mb = an.Constructor as MemberBinding;
if( mb != null && mb.BoundMember != null && mb.BoundMember.DeclaringType == attrType ) {
if( result == null ) {
result = new AttributeList();
}
result.Add(an);
}
}
}
if (result == null) {
TypeNode tn = member as TypeNode;
if (tn != null) return MetadataHelper.GetCustomAttributes(tn.BaseType, attrType);
Property p = MetadataHelper.GetPropertyForMethod(member);
if (p != null) return MetadataHelper.GetCustomAttributes(p, attrType);
}
return result;
}
示例10: ModBttn_Click
private void ModBttn_Click(object sender, EventArgs e)
{
try
{
InitValues();
}
catch (Exception exc)
{
MessageBox.Show("Registration of member has failed. Please check your inputs and try again.\n\nError Code: " + exc.Message);
return;
}
SqlCommand command = new Member(this).UpdateIntoSQL();
command.Connection = con;
Console.WriteLine(con.ConnectionString);
con.Open();
try
{
Console.WriteLine(command.ExecuteNonQuery());
}
catch(Exception exc)
{
MessageBox.Show("It broke.\n\nMessage:" + exc.Message);
return;
}
con.Close();
MessageBox.Show("Update Successful.");
parent.PullData();
Close();
}
示例11: InsertNew
public int InsertNew(string mFBID, string mName)
{
NokatEntities entities = new NokatEntities();
Member _Mem = new Member()
{
FBID = mFBID,
Name = mName
};
Member MemVar = null;
try
{
MemVar = entities.Members.First(p => p.FBID == mFBID);
}
catch
{
entities.Members.AddObject(_Mem);
entities.SaveChanges();
return _Mem.ID;
}
if (MemVar != null)
{
return MemVar.ID;
}
else
{
entities.Members.AddObject(_Mem);
entities.SaveChanges();
return _Mem.ID;
}
}
示例12: GetKeyName
protected override string GetKeyName(Member member, Type type)
{
if (member == null)
return "Id" + type.Name; // many-to-many, one-to-many, join
return "Id" + type.Name; // many-to-one
}
示例13: IsSet
public bool IsSet(Member property)
{
var mappedProperty = propertyMappings.Get(property);
return mapping.Columns.Any(x => x.IsSpecified(mappedProperty)) ||
mapping.IsSpecified(mappedProperty);
}
示例14: AddMember
public Member AddMember()
{
Console.WriteLine("Write the member name: ");
Member v_member = new Member(Console.ReadLine());
if (v_member.name == "")
{
ErrorMessege();
return null;
}
Console.WriteLine("The format of personal number is xxxxxxxxxx\nExample: 9101049121");
Console.WriteLine("Write the member personal number: ");
v_member.personalNumber = Console.ReadLine();
if (v_member.personalNumber == "")
{ return null; }
foreach (char c in v_member.personalNumber)
{
if (c < '0' || c > '9')
{
ErrorMessege();
return null;
}
}
if (v_member.personalNumber.Length != 10)
{
ErrorMessege();
return null;
}
v_member.boatlist = new List<Boat>();
return v_member;
}
示例15: GetDefaultType
private TypeReference GetDefaultType(Member property)
{
if (IsSqlTimestamp(property))
return new TypeReference("BinaryBlob");
return new TypeReference(property.PropertyType);
}