Beispiel #1
0
        void dList(DataTable dt)
        {
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                bal.Recipes c = new bal.Recipes();
                c.recipeid   = Int32.Parse(dt.Rows[i]["catid"].ToString());
                c.recipename = dt.Rows[i]["recipename"].ToString();
                c.recipedesc = dt.Rows[i]["recipedesc"].ToString();
                c.price      = Int32.Parse(dt.Rows[i]["price"].ToString());
                //c.catid = Int32.Parse(dt.Rows[i]["catid"].ToString());
                c.image = dt.Rows[i]["image"].ToString();

                c.category.catid        = Int32.Parse(dt.Rows[i]["catid"].ToString());
                c.category.categoryname = dt.Rows[i]["categoryname"].ToString();

                Commentdb combdb = new Commentdb();
                c.commentList = combdb.getbyrecipe(c.recipeid);

                cList.Add(c);
            }
        }
 public List <Comments> get()
 {
     dal.Commentdb obj = new dal.Commentdb();
     return(obj.get(this));
 }
 public int remove()
 {
     dal.Commentdb obj = new dal.Commentdb();
     return(obj.remove(this));
 }
 public List <Comments> list()
 {
     dal.Commentdb obj = new dal.Commentdb();
     return(obj.list());
 }
 public int save()
 {
     dal.Commentdb obj = new dal.Commentdb();
     return(obj.save(this));
 }