public IActionResult BillDeliveryInfoItemCreate([FromBody] BillDeliveryInfoItem billDeliveryInfoItem) { try { BillDeliveryInfoItem test = new BillDeliveryInfoItem(); test = billDeliveryInfoItem; if (ModelState.IsValid) { _context.Add(test); _context.SaveChangesAsync(); return(Ok(test)); } else { Console.WriteLine("Không đúng định dạng"); return(BadRequest()); } } catch (ArgumentException err) { Console.WriteLine("Không đúng định dạng", err); return(NotFound()); } }
public IActionResult PromotionCreate([FromBody] Promotion promotion) { try { Promotion test = new Promotion(); test = promotion; if (ModelState.IsValid) { _context.Add(test); _context.SaveChangesAsync(); return(Ok(test)); } else { Console.WriteLine("Không đúng định dạng"); return(BadRequest()); } } catch (ArgumentException err) { Console.WriteLine("Không đúng định dạng", err); return(NotFound()); } }
public IActionResult GuaranteeFormCustomerCreate([FromBody] GuaranteeFormCustomer guaranteeFormCustomer) { try { GuaranteeFormCustomer test = new GuaranteeFormCustomer(); test = guaranteeFormCustomer; if (ModelState.IsValid) { _context.Add(test); _context.SaveChangesAsync(); return(Ok(test)); } else { Console.WriteLine("Không đúng định dạng"); return(BadRequest()); } } catch (ArgumentException err) { Console.WriteLine("Không đúng định dạng", err); return(NotFound()); } }
public IActionResult ReceiveFormCreate([FromBody] ReceiveForm receiveForm) { try { ReceiveForm test = new ReceiveForm(); test = receiveForm; if (ModelState.IsValid) { _context.Add(test); _context.SaveChangesAsync(); return(Ok(test)); } else { Console.WriteLine("Không đúng định dạng"); return(BadRequest()); } } catch (ArgumentException err) { Console.WriteLine("Không đúng định dạng", err); return(NotFound()); } }
public IActionResult OrderFormPaymentCreate([FromBody] OrderFormPayment orderFormPayment) { try { OrderFormPayment test = new OrderFormPayment(); test = orderFormPayment; if (ModelState.IsValid) { _context.Add(test); _context.SaveChangesAsync(); return(Ok(test)); } else { Console.WriteLine("Không đúng định dạng"); return(BadRequest()); } } catch (ArgumentException err) { Console.WriteLine("Không đúng định dạng", err); return(NotFound()); } }
public IActionResult EmployeeCreate([FromBody] Employee employee) { try { Employee test = new Employee(); test = employee; if (ModelState.IsValid) { _context.Add(test); _context.SaveChangesAsync(); return(Ok(test)); } else { Console.WriteLine("Không đúng định dạng"); return(BadRequest()); } } catch (ArgumentException err) { Console.WriteLine("Không đúng định dạng", err); return(NotFound()); } }