internal void UpdateRequisition(Requisition requisition) { requisition.AddRequisitionEx(requisition.RequisitionExt); _unitOfWork.BeginTransaction(); try { _requisitionRepo.Update(requisition); _unitOfWork.Commit(); } catch { _unitOfWork.Rollback(); } }
public IActionResult PutItem(long itemId, [FromBody] Item item) { if (item == null) { return(BadRequest("item is null !!!")); } Item itemToUpdate = _dataRepository.Get(itemId); if (itemToUpdate == null) { return(NotFound("itemId record not found !!!")); } _dataRepository.Update(itemToUpdate, item); return(CreatedAtRoute("GetItem", new { Id = item.ItemID }, item)); }
public IActionResult PutBrand(long cancelOrderId, [FromBody] CancelOrder cancelOrder) { if (cancelOrder == null) { return(BadRequest("Cancel Order is null !!!")); } CancelOrder cancelOrderToUpdate = _dataRepository.Get(cancelOrderId); if (cancelOrderToUpdate == null) { return(NotFound("Cancel Order record not found !!!")); } _dataRepository.Update(cancelOrderToUpdate, cancelOrder); return(CreatedAtRoute("GetCancelOrder", new { Id = cancelOrder.CancelOrderID }, cancelOrder)); }
public IActionResult PutStock(long StockId, [FromBody] Stock stock) { if (stock == null) { return(BadRequest("stock is null !!!")); } Stock StockToUpdate = _dataRepository.Get(StockId); if (StockToUpdate == null) { return(NotFound("Stock record not found !!!")); } _dataRepository.Update(StockToUpdate, stock); return(CreatedAtRoute("GetStock", new { Id = stock.StockID }, stock)); }
public IActionResult PutSubject(long subjectId, [FromBody] Subject subject) { if (subject == null) { return(BadRequest("Subject is null !!!")); } Subject subjectToUpdate = _dataRepository.Get(subjectId); if (subjectToUpdate == null) { return(NotFound("Subject record not found !!!")); } _dataRepository.Update(subjectToUpdate, subject); return(CreatedAtRoute("GetSub", new { Id = subject.SubjectID }, subject)); }
public IActionResult PutAdmin(long adminId, [FromBody] AdminPanel adminPanel) { if (adminPanel == null) { return(BadRequest("Admin is null !!!")); } AdminPanel adminToUpdate = _dataRepository.Get(adminId); if (adminToUpdate == null) { return(NotFound("Admin record not found !!!")); } _dataRepository.Update(adminToUpdate, adminPanel); return(CreatedAtRoute("GetAdmin", new { Id = adminPanel.AdminPanelId }, adminPanel)); }
public IActionResult Putpayment(long PaymentId, [FromBody] Payment payment) { if (payment == null) { return(BadRequest("purchase is null !!!")); } Payment paymentToUpdate = _dataRepository.Get(PaymentId); if (paymentToUpdate == null) { return(NotFound("payment record not found !!!")); } _dataRepository.Update(paymentToUpdate, payment); return(CreatedAtRoute("GetPayment", new { Id = payment.PaymentID }, payment)); }
public IActionResult PutTest(long testId, [FromBody] Test test) { if (test == null) { return(BadRequest("Test is null !!!")); } Test testToUpdate = _dataRepository.Get(testId); if (testToUpdate == null) { return(NotFound("Test record not found !!!")); } _dataRepository.Update(testToUpdate, test); return(CreatedAtRoute("GetT", new { Id = test.TestId }, test)); }
public IActionResult PutOrganization(long organizationId, [FromBody] Organization organization) { if (organization == null) { return(BadRequest("Organization is null !!!")); } Organization organizationToUpdate = _dataRepository.Get(organizationId); if (organizationToUpdate == null) { return(NotFound("Organization record not found !!!")); } _dataRepository.Update(organizationToUpdate, organization); return(CreatedAtRoute("GetOrg", new { Id = organization.OrganizationID }, organization)); }
public IActionResult PutCustomer(long customerId, [FromBody] Customer customer) { if (customer == null) { return(BadRequest("customer is null !!!")); } Customer customerToUpdate = _dataRepository.Get(customerId); if (customerToUpdate == null) { return(NotFound("customer record not found !!!")); } _dataRepository.Update(customerToUpdate, customer); return(CreatedAtRoute("GetCustomer", new { Id = customer.CustomerID }, customer)); }
public IActionResult PutRegistration(long registrationId, [FromBody] Registration registration) { if (registration == null) { return(BadRequest("Registration is null !!!")); } Registration registrationToUpdate = _dataRepository.Get(registrationId); if (registrationToUpdate == null) { return(NotFound("Registration record not found !!!")); } _dataRepository.Update(registrationToUpdate, registration); return(CreatedAtRoute("GetR", new { Id = registration.RegistrationId }, registration)); }
public IActionResult PutCategory(long categoryId, [FromBody] Category category) { if (category == null) { return(BadRequest("Category is null !!!")); } Category categoryToUpdate = _dataRepository.Get(categoryId); if (categoryToUpdate == null) { return(NotFound("Category record not found !!!")); } _dataRepository.Update(categoryToUpdate, category); return(CreatedAtRoute("Get", new { Id = category.CategoryID }, category)); }
public IActionResult PutChoice(long choiceId, [FromBody] Choice choice) { if (choice == null) { return(BadRequest("Choice is null !!!")); } Choice choiceToUpdate = _dataRepository.Get(choiceId); if (choiceToUpdate == null) { return(NotFound("Choice record not found !!!")); } _dataRepository.Update(choiceToUpdate, choice); return(CreatedAtRoute("GetC", new { Id = choice.ChoiceId }, choice)); }
public IActionResult PutStudent(long studentId, [FromBody] Student student) { if (student == null) { return(BadRequest("Trainee is null !!!")); } Student studentToUpdate = _dataRepository.Get(studentId); if (studentToUpdate == null) { return(NotFound("Student record not found !!!")); } _dataRepository.Update(studentToUpdate, student); return(CreatedAtRoute("GetS", new { Id = student.StudentId }, student)); }
public IActionResult PutExhibit(long exhibitId, [FromBody] Exhibit exhibit) { if (exhibit == null) { return(BadRequest("Test is null !!!")); } Exhibit exhibitToUpdate = _dataRepository.Get(exhibitId); if (exhibitToUpdate == null) { return(NotFound("Exhibit record not found !!!")); } _dataRepository.Update(exhibitToUpdate, exhibit); return(CreatedAtRoute("GetExh", new { Id = exhibit.ExhibitId }, exhibit)); }
public IActionResult PutSupplier(long supplierId, [FromBody] Supplier supplier) { if (supplier == null) { return(BadRequest("supplier is null !!!")); } Supplier supplierToUpdate = _dataRepository.Get(supplierId); if (supplierToUpdate == null) { return(NotFound("supplier record not found !!!")); } _dataRepository.Update(supplierToUpdate, supplier); return(CreatedAtRoute("GetCustomer", new { Id = supplier.SupplierID }, supplier)); }
public IActionResult PutQuestionCategory(long questionXDurationId, [FromBody] QuestionXDuration questionX) { if (questionX == null) { return(BadRequest("QuestionXDuration is null !!!")); } QuestionXDuration questionXDurationToUpdate = _dataRepository.Get(questionXDurationId); if (questionXDurationToUpdate == null) { return(NotFound("QuestionCategory record not found !!!")); } _dataRepository.Update(questionXDurationToUpdate, questionX); return(CreatedAtRoute("GetQxD", new { Id = questionX.QuestionXDurationId }, questionX)); }
public IActionResult PutTestXPaper(long testXPaperId, [FromBody] TestXPaper testXPaper) { if (testXPaper == null) { return(BadRequest("TestXPaper is null !!!")); } TestXPaper testXPaperToUpdate = _dataRepository.Get(testXPaperId); if (testXPaperToUpdate == null) { return(NotFound("QuestionCategory record not found !!!")); } _dataRepository.Update(testXPaperToUpdate, testXPaper); return(CreatedAtRoute("GetTestX", new { Id = testXPaper.TestXPaperId }, testXPaper)); }
public IActionResult PutTestXQuestion(long testXQuestionId, [FromBody] TestXQuestion testXQuestion) { if (testXQuestion == null) { return(BadRequest("TestXQuestion is null !!!")); } TestXQuestion testXQuestionToUpdate = _dataRepository.Get(testXQuestionId); if (testXQuestionToUpdate == null) { return(NotFound("TestXQuestion record not found !!!")); } _dataRepository.Update(testXQuestionToUpdate, testXQuestion); return(CreatedAtRoute("GetTxQ", new { Id = testXQuestion.TestXQuestionId }, testXQuestion)); }
public IActionResult PutBrand(long brandId, [FromBody] Brand brand) { if (brand == null) { return(BadRequest("Brand is null !!!")); } Brand brandToUpdate = _dataRepository.Get(brandId); if (brandToUpdate == null) { return(NotFound("Brand record not found !!!")); } _dataRepository.Update(brandToUpdate, brand); return(CreatedAtRoute("GetBrand", new { Id = brand.BrandID }, brand)); }
public IActionResult PutStock(long PurchaseID, [FromBody] Purchase purchase) { if (purchase == null) { return(BadRequest("purchase is null !!!")); } Purchase PurchaseToUpdate = _dataRepository.Get(PurchaseID); if (PurchaseToUpdate == null) { return(NotFound("purchase record not found !!!")); } _dataRepository.Update(PurchaseToUpdate, purchase); return(CreatedAtRoute("Getpurchase", new { Id = purchase.PurchaseID }, purchase)); }
public IActionResult PutOrderDetail(long orderDetailId, [FromBody] OrderDetail orderDetail) { if (orderDetail == null) { return(BadRequest("orderDetail is null !!!")); } OrderDetail orderDetailToUpdate = _dataRepository.Get(orderDetailId); if (orderDetailToUpdate == null) { return(NotFound("orderDetail record not found !!!")); } _dataRepository.Update(orderDetailToUpdate, orderDetail); return(CreatedAtRoute("GetGetOrderDetail", new { Id = orderDetail.OrderDetailID }, orderDetail)); }
public IActionResult PutCompanyAddress(long companyAddressesId, [FromBody] CompanyAddress companyAddresses) { if (companyAddresses == null) { return(BadRequest("CompanyAddress is null!!!!")); } CompanyAddress applyJobsToUpdate = _repository.Get(companyAddressesId); if (applyJobsToUpdate == null) { return(NotFound("Apply Jobs Record Not Found")); } _repository.Update(applyJobsToUpdate, companyAddresses); return(CreatedAtRoute("GetCompanyAddresses", new { Id = companyAddresses.CompanyAddressID }, companyAddresses)); }
public IActionResult PutAddress(long addressId, [FromBody] Address address) { if (address == null) { return(BadRequest("Address is null!!!!")); } Address addressToUpdate = _repository.Get(addressId); if (addressToUpdate == null) { return(NotFound("Job List Record Not Found")); } _repository.Update(addressToUpdate, address); return(CreatedAtRoute("GetAddre", new { Id = address.AddressID }, address)); }
public IActionResult PutEducation(long educationsId, [FromBody] Education educations) { if (educations == null) { return(BadRequest("Education is null!!!!")); } Education educationsToUpdate = _repository.Get(educationsId); if (educationsToUpdate == null) { return(NotFound("Education Record Not Found")); } _repository.Update(educationsToUpdate, educations); return(CreatedAtRoute("GetEducations", new { Id = educations.EducationID }, educations)); }
public IActionResult PutJobList(long jobId, [FromBody] JobList jobList) { if (jobList == null) { return(BadRequest("Job List is null!!!!")); } JobList jobListToUpdate = _repository.Get(jobId); if (jobListToUpdate == null) { return(NotFound("Job List Record Not Found")); } _repository.Update(jobListToUpdate, jobList); return(CreatedAtRoute("GetJobLists", new { Id = jobList.JobListID }, jobList)); }
public IActionResult PutPersonalDetail(long personalDetailsId, [FromBody] PersonalDetail personalDetails) { if (personalDetails == null) { return(BadRequest("Personal Detail is null!!!!")); } PersonalDetail personalDetailsToUpdate = _repository.Get(personalDetailsId); if (personalDetailsToUpdate == null) { return(NotFound("Personal Detail Record Not Found")); } _repository.Update(personalDetailsToUpdate, personalDetails); return(CreatedAtRoute("GetPersonalDetails", new { Id = personalDetails.PersonalDetailID }, personalDetails)); }
public IActionResult PutTraining(long trainingsId, [FromBody] Training trainings) { if (trainings == null) { return(BadRequest("Training is null!!!!")); } Training trainingsToUpdate = _repository.Get(trainingsId); if (trainingsToUpdate == null) { return(NotFound("Training Record Not Found")); } _repository.Update(trainingsToUpdate, trainings); return(CreatedAtRoute("GetTrainings", new { Id = trainings.TrainingID }, trainings)); }
public IActionResult PutEmployer(long employerId, [FromBody] Employer employer) { if (employer == null) { return(BadRequest("Employer is null!!!!")); } Employer employerToUpdate = _repository.Get(employerId); if (employerToUpdate == null) { return(NotFound("Job List Record Not Found")); } _repository.Update(employerToUpdate, employer); return(CreatedAtRoute("GetEmployers", new { Id = employer.EmployerID }, employer)); }
public IActionResult PutExperience(long experiencesId, [FromBody] Experience experiences) { if (experiences == null) { return(BadRequest("Experience is null!!!!")); } Experience applyJobsToUpdate = _repository.Get(experiencesId); if (applyJobsToUpdate == null) { return(NotFound("Experience Record Not Found")); } _repository.Update(applyJobsToUpdate, experiences); return(CreatedAtRoute("GetExperiences", new { Id = experiences.ExperienceID }, experiences)); }