Exemplo n.º 1
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            if (ValidateForm())
            {

                MemberType mt = new MemberType();
                mt.Class = (Class)cbMemberType.SelectedValue;
                context.MemberTypeSet.AddObject(mt);

                Member m = new Member();
                m.Name = tbClassMemberName.Text;
                m.AccessModifier = (AccessModifier)cbMemberAccessModifier.SelectedValue;
                m.MemberType = mt;
                m.Class = cls;
                context.MemberSet.AddObject(m);

                context.SaveChanges();

                this.DialogResult = DialogResult.OK;
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// Create a new Member object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="name">Initial value of the Name property.</param>
 /// <param name="classId">Initial value of the ClassId property.</param>
 /// <param name="accessModifierId">Initial value of the AccessModifierId property.</param>
 public static Member CreateMember(global::System.Int32 id, global::System.String name, global::System.Int32 classId, global::System.Int32 accessModifierId)
 {
     Member member = new Member();
     member.Id = id;
     member.Name = name;
     member.ClassId = classId;
     member.AccessModifierId = accessModifierId;
     return member;
 }
Exemplo n.º 3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the MemberSet EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToMemberSet(Member member)
 {
     base.AddObject("MemberSet", member);
 }