Exemplo n.º 1
0
        public async Task <object> insert(object obj)
        {
            ManageMaintainanceStaff staff = (ManageMaintainanceStaff)obj;
            await collection.InsertOneAsync(staff);

            return(true);
        }
Exemplo n.º 2
0
        public async Task <bool> registerStaffMember([FromBody] ManageMaintainanceStaff staff)//ActionResult<Admin>

        {
            var staffData = await context.retrieve(staff.employeeEmail);


            staffData = JsonConvert.SerializeObject(staffData);
            if (staffData.ToString() == "[]")
            {
                await context.insert(staff);

                return(true);
            }

            return(false);
        }
Exemplo n.º 3
0
        public async Task <ActionResult> updateStaffMemberProfile([FromBody] ManageMaintainanceStaff staff)
        {
            await context.update(staff.employeeEmail, staff);

            return(Ok(staff));
        }