Ejemplo n.º 1
0
        public ActionResult WishList()
        {
            List <GoodGroup> lmd = new List <GoodGroup>();
            DataSet          ds  = new DataSet();

            Connection.Connection con = new Connection.Connection();
            ds = con.GoodGroupData();

            DataSet ds_good = new DataSet();

            Connection.Connection con_good = new Connection.Connection();

            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                List <GoodModel> lmd_good = new List <GoodModel>();
                var Gg_Id = Convert.ToInt32(dr["GG_Id"]);
                ds_good = con_good.GoodData(Gg_Id);
                //lmd_good.RemoveAll(true);
                foreach (DataRow dr_good in ds_good.Tables[0].Rows)
                {
                    lmd_good.Add(new GoodModel
                    {
                        Gd_Id         = Convert.ToInt32(dr_good["Gd_Id"]),
                        Gd_Name       = dr_good["Gd_Name"].ToString(),
                        Gd_RequiredNo = Convert.ToInt32(dr_good["Gd_RequiredNo"])
                    });
                }
                lmd.Add(new GoodGroup
                {
                    GG_Id   = Convert.ToInt16(dr["GG_Id"]),
                    GG_Name = dr["GG_Name"].ToString(),
                    Goods   = new List <GoodModel>(lmd_good),
                });
            }
            return(View("WishList", lmd));
        }