public static bool CreateSM(SingerMusic sm)
        {
            var en = new ProjectNCTEntities();

            en.SingerMusics.Add(sm);
            return(en.SaveChanges() > 0 ? true : false);
        }
Beispiel #2
0
        //create
        public SingerMusic Create(SingerMusic singerMusic)
        {
            db.SingerMusics.Add(singerMusic);
            if (db.SaveChanges() > 0)
            {
                return(singerMusic);
            }

            return(null);
        }
Beispiel #3
0
        //public IHttpActionResult DelSinger(int idMusic,int idSinger)
        //{
        //    var res = Repositories.DelSinger(idMusic, idSinger);
        //    if (res == true)
        //    {
        //        return Ok();
        //    }
        //    return InternalServerError();
        //}
        // POST api/<controller>
        public IHttpActionResult Post(SingerMusicView s)
        {
            var sm = new SingerMusic {
                ID = s.ID, MusicID = s.MusicID, SingerID = s.SingerID
            };
            var res = Repositories.CreateSM(sm);

            if (res == true)
            {
                return(Ok());
            }
            return(InternalServerError());
        }
Beispiel #4
0
 public static bool CreateSM(SingerMusic sm)
 {
     return(MusicBUS.CreateSM(sm));
 }
Beispiel #5
0
 public static bool CreateSM(SingerMusic sm)
 {
     return(SingerMusicDAO.CreateSM(sm));
 }
Beispiel #6
0
 //update
 public void Update(SingerMusic singerMusic)
 {
     db.Entry(singerMusic).State = EntityState.Modified;
     db.SaveChanges();
 }