public Status AddStaff(string staffname, string tel, string productionbasename, string level, List <IFormFile> file) { this._logger.LogWarning("The server excute AddStaff --" + DateTime.Now.ToString()); TProductionBaseStaff productionBaseStaff = new TProductionBaseStaff() { StaffName = staffname, Telephone = tel, ProductionBaseName = productionbasename, Position = level }; List <string> filenames = new List <string>(); string resultfilename = string.Empty; if (productionBaseStaff.StaffName != "") { UpLoadFile.FileSave(file, productionBaseStaff.StaffName, out filenames); } else { UpLoadFile.FileSave(file, DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"), out filenames); } filenames.Sort(); resultfilename = string.Join("", filenames.ToArray()); productionBaseStaff.Image = resultfilename; EFHelper <TProductionBaseStaff> eFHelper = new EFHelper <TProductionBaseStaff>(); int result = eFHelper.Add(productionBaseStaff); return(result > 0 ? new Status(true) : new Status(false)); }
public Status DeleteStaff(TProductionBaseStaff productionBaseStaff) { this._logger.LogWarning("The server excute DeleteStaff --" + DateTime.Now.ToString()); EFHelper <TProductionBaseStaff> eFHelper = new EFHelper <TProductionBaseStaff>(); int result = eFHelper.Delete(productionBaseStaff); return(result > 0 ? new Status(true) : new Status(false)); }