Exemplo n.º 1
0
        public Gerecht GetGerechtById(int id)
        {
            string sql = "select * from Gerecht where GerechtID = @ID";
            Dictionary <object, object> parameters = new Dictionary <object, object>();

            parameters.Add("ID", id);

            int     x  = 0;
            DataSet ds = GetDataSetSql(sql, parameters);
            Gerecht g  = DataSetParser.DataSetToGerecht(ds, x);

            return(g);
        }
Exemplo n.º 2
0
        public Gerecht GetGerechtByRondeAndGerechtIdAndOrderId(int ronde, int GerechtId, int OrderId)
        {
            string sql = "Select * From Gerecht Where GerechtId = (Select GerechtId From GerechtOrder where Ronde = @ronde And GerechtID = @id and OrderId = @OrderId)";
            Dictionary <object, object> parameters = new Dictionary <object, object>();

            parameters.Add("ronde", ronde);
            parameters.Add("id", GerechtId);
            parameters.Add("OrderId", OrderId);

            DataSet set = GetDataSetSql(sql, parameters);
            Gerecht g   = null;

            if (set != null && set.Tables[0].Rows.Count >= 1)
            {
                g = DataSetParser.DataSetToGerecht(set, 0);
            }

            return(g);
        }