public bool Insert(TheaterParam theaterParam)
 {
     if (theaterParam == null)
     {
         Console.WriteLine("Insert Name");
         Console.Read();
     }
     else
     {
         status = _theaterRepository.Insert(theaterParam);
         Console.WriteLine("Success");
     }
     return(status);
 }
        public bool Update(int?Id, TheaterParam theaterParam)
        {
            var result = 0;
            var get    = Get(Id);

            get.Name       = theaterParam.Name;
            get.UpdateDate = DateTimeOffset.Now.LocalDateTime;
            result         = myContext.SaveChanges();
            if (result > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
        public bool Insert(TheaterParam theaterParam)
        {
            var result  = 0;
            var theater = new Theater();

            theater.Name       = theaterParam.Name;
            theater.CreateDate = DateTimeOffset.Now.LocalDateTime;
            myContext.Theaters.Add(theater);
            result = myContext.SaveChanges();
            if (result > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
 public bool Update(int?Id, TheaterParam theaterParam)
 {
     if (Id == null)
     {
         Console.WriteLine("Insert Id");
         Console.Read();
     }
     else if (Id == ' ')
     {
         Console.WriteLine("Dont Insert Blank Caracter");
         Console.Read();
     }
     else
     {
         status = _theaterRepository.Update(Id, theaterParam);
         Console.WriteLine("update Success");
     }
     return(status);
 }
示例#5
0
 // PUT: api/Theaters/5
 public void Put(int id, TheaterParam theaterParam)
 {
     _theaterService.Update(id, theaterParam);
 }
示例#6
0
 // POST: api/Theaters
 public void Post(TheaterParam theaterParam)
 {
     _theaterService.Insert(theaterParam);
 }