public bool AddRecord(EquipmentMaintenance objEquipMaintenance)
        {
            FileOperations objEquipMaintenanceDB = new FileOperations();

            string data = (GetMaxID() + 1).ToString() + "," + objEquipMaintenance.Date.Date.ToString("dd/MM/yyyy") +","+
                           objEquipMaintenance.Time+","+objEquipMaintenance.WorksDescription+","+objEquipMaintenance.ObjEquip.ID.ToString()+"," +objEquipMaintenance.TimeTaken.ToString();
            return objEquipMaintenanceDB.Add(EquipmentMaintenaceFilePath, data);
        }
Esempio n. 2
0
        public IActionResult Add([FromForm(Name = "Image")] IFormFile formFile, [FromForm] CarImage carImage)
        {
            carImage.ImagePath = FileOperations.Add(formFile);

            carImage.Date = DateTime.Now;
            var result = _carImageService.Add(carImage);

            if (result.Success)
            {
                return(Ok(result));
            }
            return(BadRequest(result));
        }
        public ResponseModel <ProjectViewModel> Post([FromBody] ProjectViewModel project)
        {
            var validationResult = _inputValidator.ValidateProject(project);

            if (validationResult.IsSuccessful)
            {
                return(FileOps.Add(project));
            }
            else
            {
                return(validationResult);
            }
        }