public List<Picture> GetById(int id, EType type)
        {
            using (ISession session = SessionBase.OpenSession())
            {
                ICriteria crit = session.CreateCriteria(typeof(Picture));
                if(type.Equals(EType.Figur))
                {
                    crit.Add<Picture>(exp => exp.Fk_Figur_Id.Id == id);
                }
                if(type.Equals(EType.Serie))
                {
                    crit.Add<Picture>(exp => exp.Fk_Serie_Id.Id == id);
                }
                if(type.Equals(EType.Instructions))
                {
                    crit.Add<Picture>(exp => exp.Fk_Instructions_Id.Id== id);
                }

                return crit.List().Cast<Picture>().ToList();
            }
        }
Beispiel #2
0
        //Constructor
        public Skill(EType i_type, ESubtype i_subtype, string i_name, float i_power, string i_afinity)
        {
            type       = i_type;
            subtype    = i_subtype;
            name       = i_name;
            afinity    = i_afinity;
            skillCount = 0;

            if (i_type.Equals(EType.AttackSkill))
            {
                if (i_power >= 1 && i_power <= 10)
                {
                    power = i_power;
                }

                subtype = ESubtype.None;
            }
            else if (i_type.Equals(EType.SupportSkill))
            {
                power   = 0;
                subtype = i_subtype;
            }
        }