Пример #1
0
        public static bool ThemGoiMon(GoiMonDTO gm)
        {
            gm.MaGoiMon = MaTuTang();
            bool   kq;
            string sql = string.Format("insert into GoiMon values ({0}, {1})", gm.MaGoiMon, gm.MsBan);

            kq = SqlDataAccessHelper.ExecuteNonQuery(sql);
            return(kq);
        }
Пример #2
0
        //Rút trích dữ liêu: select
        public static List <GoiMonDTO> LayDSGoiMon()
        {
            List <GoiMonDTO> _ds = new List <GoiMonDTO>();
            string           sql = "select * from GoiMon";
            DataTable        dt  = SqlDataAccessHelper.ExecuteQuery(sql);

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                GoiMonDTO gm = new GoiMonDTO();
                gm.MaGoiMon = int.Parse(dt.Rows[i]["MaGoiMon"].ToString());
                gm.MsBan    = int.Parse(dt.Rows[i]["MaSoBan"].ToString());
                _ds.Add(gm);
            }
            return(_ds);
        }
Пример #3
0
        public static bool ThemGoiMon(GoiMonDTO gm)
        {
            bool kq = GoiMonDAO.ThemGoiMon(gm);

            return(kq);
        }