public void Post([FromBody] StockTransfer_Join store)
 {
     if (ModelState.IsValid)
     {
         StockTransfer_JoinRepository.Add(store);
     }
 }
 public void Put(int STJ_ID, [FromBody] StockTransfer_Join store)
 {
     store.STJ_ID = STJ_ID;
     if (ModelState.IsValid)
     {
         StockTransfer_JoinRepository.Update(store);
     }
 }
 public void Update(StockTransfer_Join stock)
 {
     using (IDbConnection dbConnection = Connection)
     {
         string sQuery = " UPDATE StockTransfer_Join SET StockTransferID=@StockTransferID,Warehouse=@Warehouse,ProductID=@ProductID,ExpiryDate=@ExpiryDate,Qty=@Qty"
                         + " WHERE STJ_ID = @STJ_ID";
         dbConnection.Open();
         dbConnection.Execute(sQuery, stock);
     }
 }
Exemplo n.º 4
0
 public void Add(StockTransfer_Join stock)
 {
     using (IDbConnection dbConnection = Connection)
     {
         string sQuery = "INSERT INTO StockTransfer  (Date , Kitchen )"
                         + " VALUES(@Date , @Kitchen)";
         dbConnection.Open();
         dbConnection.Execute(sQuery, stock);
     }
 }
        public void Add(StockTransfer_Join stock)
        {
            using (IDbConnection dbConnection = Connection)
            {
                string sQuery = "INSERT INTO StockTransfer_Join  (StockTransferID,Warehouse, ProductID,ExpiryDate,Qty )"
                                + " VALUES(@StockTransferID,@Warehouse,@ProductID,@ExpiryDate,@Qty)";

                dbConnection.Open();

                dbConnection.Query(sQuery, stock);
            }
        }
 public ActionResult DeleteContact(StockTransfer_Join cat)
 {
     using (var client = new HttpClient())
     {
         client.BaseAddress = new Uri(Baseurl);
         client.DefaultRequestHeaders.Clear();
         //Define request data format
         client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
         //Sending request to find web api REST service resource GetAllEmployees using HttpClient
         HttpResponseMessage Res = client.DeleteAsync("api/StockTransfer_Join/" + cat.STJ_ID).Result;
         //Checking the response is successful or not which is sent using HttpClient
         if (Res.IsSuccessStatusCode)
         {
             //Storing the response details recieved from web api
             var CatResponse = Res.Content.ReadAsStringAsync().Result;
             ViewBag.Name = JsonConvert.SerializeObject(CatResponse);
             //Deserializing the response recieved from web api and storing into the Employee list
             //CatInfo = JsonConvert.DeserializeObject<List<Category>>(CatResponse);
         }
     }
     return(RedirectToAction("Hotel"));
 }