当前位置: 首页>>代码示例>>C#>>正文


C# Member类代码示例

本文整理汇总了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);
        }
开发者ID:jjchoi,项目名称:fluent-nhibernate,代码行数:28,代码来源:VersionStep.cs

示例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 = "";
     }
 }
开发者ID:wgang10,项目名称:XTHospatal,代码行数:32,代码来源:ActivatMember.aspx.cs

示例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");
            }

        }
    }
开发者ID:marcpiulachs,项目名称:sttproject,代码行数:35,代码来源:aboutus.aspx.cs

示例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
        }
开发者ID:evgenyk,项目名称:Brick.FluentNHibernate.Conventions,代码行数:7,代码来源:ManyToManyConvention.cs

示例5: UpdateMember

 public virtual void UpdateMember(Member member)
 {
     _memberDataContext.Members.Attach(member);
     DbEntityEntry<Member> dbEntry = _memberDataContext.Entry(member);
     dbEntry.State = EntityState.Modified;
     _memberDataContext.SaveChanges();
 }
开发者ID:pateldhara,项目名称:MVCTestProject,代码行数:7,代码来源:MemberServices.cs

示例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
        }
开发者ID:Umaaz,项目名称:Komodo,代码行数:7,代码来源:ColumnConventions.cs

示例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);
        }
开发者ID:ToshB,项目名称:FagkveldOktober,代码行数:7,代码来源:CustomForeignKeyConvention.cs

示例8: GetAccessStrategyForReadOnlyProperty

        public virtual Access GetAccessStrategyForReadOnlyProperty(Member member)
        {
            if (member.IsAutoProperty)
                return Access.BackField;

            return Access.ReadOnlyPropertyThroughCamelCaseField();
        }
开发者ID:roelofb,项目名称:fluent-nhibernate,代码行数:7,代码来源:DefaultAutomappingConfiguration.cs

示例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;
    }    
开发者ID:hesam,项目名称:SketchSharp,代码行数:26,代码来源:TypeSystem.cs

示例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();
 }
开发者ID:AdolfDupler,项目名称:FBLAStuff,代码行数:29,代码来源:ModMember.cs

示例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;
            }
        }
开发者ID:ahmedeid100,项目名称:SF_Nokat,代码行数:34,代码来源:MemberRepository.cs

示例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
        }
开发者ID:GutAmanai,项目名称:TG,代码行数:7,代码来源:FluentNHibernateConventions.cs

示例13: IsSet

        public bool IsSet(Member property)
        {
            var mappedProperty = propertyMappings.Get(property);

            return mapping.Columns.Any(x => x.IsSpecified(mappedProperty)) ||
                mapping.IsSpecified(mappedProperty);
        }
开发者ID:adymitruk,项目名称:fluent-nhibernate,代码行数:7,代码来源:ManyToOneInspector.cs

示例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;
 }
开发者ID:sslnustudent,项目名称:OOAD,代码行数:30,代码来源:Console.cs

示例15: GetDefaultType

        private TypeReference GetDefaultType(Member property)
        {
            if (IsSqlTimestamp(property))
                return new TypeReference("BinaryBlob");

            return new TypeReference(property.PropertyType);
        }
开发者ID:erikojebo,项目名称:fluent-nhibernate,代码行数:7,代码来源:VersionStep.cs


注:本文中的Member类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。