예제 #1
0
        public IActionResult EditMerk(int id, MerkVM merkVM)
        {
            var edit = _iMerk.Update(merkVM, id);

            if (edit > 0)
            {
                return(Ok(edit));
            }
            return(BadRequest("Not Successfully"));
        }
예제 #2
0
 public int Create(MerkVM merkVM)
 {
     using (SqlConnection connection = new SqlConnection(_configuration.GetConnectionString("myConn")))
     {
         var procName = "SPInsertMerk";
         parameters.Add("merk", merkVM.Merk);
         var insert = connection.Execute(procName, parameters, commandType: CommandType.StoredProcedure);
         return(insert);
     }
 }
예제 #3
0
        public IActionResult CreateMerk(MerkVM merkVM)
        {
            var create = _iMerk.Create(merkVM);

            if (create > 0)
            {
                return(Ok(create));
            }
            return(BadRequest("Not Successfully"));
        }
예제 #4
0
 public int Update(MerkVM merkVM, int id)
 {
     using (SqlConnection connection = new SqlConnection(_configuration.GetConnectionString("myConn")))
     {
         var procName = "SPEditMerk";
         parameters.Add("id", id);
         parameters.Add("merk", merkVM.Merk);
         var Edit = connection.Execute(procName, parameters, commandType: CommandType.StoredProcedure);
         return(Edit);
     }
 }