Beispiel #1
0
        private SimpleQuery With(IEnumerable <object> args, WithType withType = WithType.NotSpecified)
        {
            var clauses = new List <SimpleQueryClauseBase>(_clauses);

            clauses.AddRange(args.OfType <ObjectReference>().Select(reference => new WithClause(reference, withType)));
            return(new SimpleQuery(this, clauses.ToArray()));
        }
        protected static RelationType WithTypeToRelationType(WithType withType, RelationType defaultRelationType)
        {
            switch (withType)
            {
            case WithType.One:
                return(RelationType.ManyToOne);

            case WithType.Many:
                return(RelationType.OneToMany);

            default:
                return(defaultRelationType);
            }
        }
Beispiel #3
0
        protected void btnWSave_Click(object sender, EventArgs e)
        {
            int    dep  = Convert.ToInt32(ddlWDep.SelectedValue);
            string name = tbWName.Text;

            using (ClubDBEntities club = new ClubDBEntities())
            {
                WithType with = new WithType();
                with.Department = dep;
                with.Name       = name;
                club.WithTypes.AddObject(with);
                club.SaveChanges();
                chagesSaved();
            }
        }
Beispiel #4
0
 public WithClause(ObjectReference objectReference, WithMode mode, WithType type)
 {
     _objectReference = objectReference;
     _mode = mode;
     _type = type;
 }
Beispiel #5
0
 public WithClause(ObjectReference objectReference, WithType type) : this(objectReference, WithMode.NotSpecified, type)
 {
 }
Beispiel #6
0
 private static RelationType WithTypeToRelationType(WithType withType, RelationType defaultRelationType)
 {
     switch (withType)
     {
         case WithType.One:
             return RelationType.ManyToOne;
         case WithType.Many:
             return RelationType.OneToMany;
         default:
             return defaultRelationType;
     }
 }
Beispiel #7
0
 public WithClause(ObjectReference objectReference, WithMode mode, WithType type)
 {
     _objectReference = objectReference;
     _mode            = mode;
     _type            = type;
 }
Beispiel #8
0
 public WithClause(ObjectReference objectReference, WithType type) : this(objectReference, WithMode.NotSpecified, type)
 {
 }