/// <summary> /// Creates a new equipment /// </summary> public void CheckOut(NewCheckoutDTO newCheckoutDTO) { // create the equipmentDTO for persistence and populate its properties CheckoutDTO checkoutDTO = new CheckoutDTO() { EquipmentID = newCheckoutDTO.EquipmentID, StudentID = newCheckoutDTO.StudentID }; _equipmentDAO.CheckOut(checkoutDTO); }
/// <summary> /// Check In Equipment /// </summary> public void CheckIn(NewCheckoutDTO newcheckoutDTO) { using (var connection = new SqlConnection(ConfigurationManager.ConnectionStrings["Housingousing"].ConnectionString)) { connection.Open(); string sql = @"Set StudentID = 0, Status = 'In' Where LoanID = @LoanID"; connection.Execute(sql, newcheckoutDTO); } }
public ActionResult NewCheckout(CheckOutEquipmentModel formdata) { long studentid = formdata.StudentID; string building = formdata.Buildingname; int equipmentid = formdata.EquipmentID; NewCheckoutDTO dto = new NewCheckoutDTO(); dto.EquipmentID = equipmentid; dto.Status = "Out"; dto.StudentID = studentid; NewCheckoutCreator checkout_Creator = new NewCheckoutCreator(); checkout_Creator.CheckOut(dto); return(RedirectToAction("AfterCheckOut", "CheckOut")); }
public ActionResult CheckOutEquipment(CheckOutEquipmentModel formdata) { long studentid = formdata.StudentID; string building = formdata.Building.Buildingname; EquipmentViewer equipment_viewer = new EquipmentViewer(); IList <EquipmentViewModel> equipment = equipment_viewer.Getequipment(building); NewCheckoutDTO dto = new NewCheckoutDTO(); dto.EquipmentID = formdata.EquipmentID; dto.Status = "Out"; dto.StudentID = studentid; NewCheckoutCreator package_Creator = new NewCheckoutCreator(); //?? package_Creator.CreatePackage(dto); return(RedirectToAction("AfterCheckOut", "CheckOut")); }
public ActionResult CheckInEquipment(CheckInEquipmentModel formdata) { //?? display buildings long studentid = formdata.StudentID; string building = formdata.Building.Buildingname; EquipmentViewer equipment_viewer = new EquipmentViewer(); IList <EquipmentViewModel> equipment = equipment_viewer.GetequipmentByStudent(studentid); var model = new CheckInEquipmentModel(); model.StudentID = studentid; model.Equipment = equipment; NewCheckoutDTO dto = new NewCheckoutDTO(); dto.EquipmentID = formdata.Equipment; dto.Status = "In"; dto.StudentID = 0; //?? return View(model); return(RedirectToAction("AfterCheckIn", "CheckOut")); }