Beispiel #1
0
        static public List <Objects> LoadRented(int locationNumber)
        {
            RequestDB      req    = new RequestDB();
            List <Objects> lstObj = req.getRentedObjects(locationNumber);

            return(lstObj);
        }
        static public void AddObject(string name, string type, string description, int employeeNumber, string remark = "")
        {
            RequestDB req    = new RequestDB();
            int       typeID = req.ReqGetIDFromType(type);

            req.ReqAddObject(name, typeID, description, employeeNumber, remark);
        }
Beispiel #3
0
        static public List <Objects> Load()
        {
            RequestDB      req    = new RequestDB();
            List <Objects> lstObj = req.getObjects();

            return(lstObj);
        }
        private void btnReturn_Click(object sender, EventArgs e)
        {
            int       rentNumber;
            int       objectID;
            DateTime  returnDate = DateTime.Today;
            bool      res        = int.TryParse(txtRentNumber.Text, out rentNumber);
            RequestDB req        = new RequestDB();

            objectID = req.ReqGetObjectNumber(rentNumber);
            Employees.ReturnObject(objectID);
            MessageBox.Show("L'objet a correctement été retourné");
            ActiveForm.Close();
        }
        static public void printPDF(string data)
        {
            RequestDB req = new RequestDB();

            string state;

            if (data == "rented")
            {
                state = "unavailable";
            }
            else
            {
                state = "available";
            }
            req.ReqPDF(state);
        }
Beispiel #6
0
        private void btnRent_Click(object sender, EventArgs e)
        {
            int       locatorNumber;
            int       employeeNumber;
            string    name         = txtName.Text;
            bool      res          = int.TryParse(txtClientID.Text, out locatorNumber);
            bool      res2         = int.TryParse(txtClientID.Text, out employeeNumber);
            DateTime  returnDate   = Convert.ToDateTime(selectedDate);
            RequestDB req          = new RequestDB();
            int       objectNumber = req.ReqGetIDFromName(name);
            string    state        = req.ReqCheckState(objectNumber);

            if (state == "disponible")
            {
                Employees.RentObject(objectNumber, locatorNumber, employeeNumber, returnDate);
                ActiveForm.Close();
            }
            else
            {
                MessageBox.Show("L'objet est déjà loué !");
                ActiveForm.Close();
            }
        }
        static public void ReturnObject(int objectNumber)
        {
            RequestDB req = new RequestDB();

            req.ReqReturnObject(objectNumber);
        }
        static public void RentObject(int objID, int locator_id, int adder_id, DateTime expectedReturn)
        {
            RequestDB req = new RequestDB();

            req.ReqRentObject(objID, locator_id, adder_id, expectedReturn);
        }