public string SaveBussinessLogFile(FormCollection form, string FKValue, int?FKType, string LogConent) { int FKvalueInt = 0; if (!string.IsNullOrEmpty(FKValue)) { FKvalueInt = UtilsHelper.Decrypt2Int(FKValue); } //记录日志 Sys_BusinessLogModel businessLog = new Sys_BusinessLogModel() { FKValue = FKvalueInt, //外键标识 FKType = FKType.Value, //外键类别 CreateUser = LoginHelper.LoginUser.UserName, //创建人 Creator = LoginHelper.LoginUser.UserId, //创建人标识 LogConent = LogConent == null ? "" : UtilsHelper.SpecialCharValidate(LogConent), //日志描述 FileId = -1, //文件标识 FileName = "", //文件名称 CreateDate = DateTime.Now //创建时间 }; SaveLogandAttach(businessLog); return("OK"); }
/// <summary> /// 保存实体数据. /// </summary> public void Save(Sys_BusinessLogModel model) { if (model.LogId == 0) { DBProvider.Sys_BusinessLogDao.Add(model); } else { DBProvider.Sys_BusinessLogDao.Update(model); } }
public void SaveLogandAttach(Sys_BusinessLogModel businessLog) { if (Request.Files.Count > 0 && Request.Files[0].ContentLength > 0) { string url = WebUtils.GetSettingsValue("BusinessLogFilePath") + @"/" + StrUtils.GetUniqueFileName(null) + System.IO.Path.GetExtension(Request.Files[0].FileName); //上传文件 var AttachmentModel = UtilsHelper.FileUpload(Request.Files[0], url, (UtilConstants.ServerType)Convert.ToInt32(WebUtils.GetSettingsValue("WebFileType") == null ? "1" : WebUtils.GetSettingsValue("WebFileType")));; Global.Business.ServiceProvider.AttachmentService.Save(AttachmentModel); businessLog.FileId = AttachmentModel.FileId; businessLog.FileName = Request.Files[0].FileName; } Global.Business.ServiceProvider.Sys_BusinessLogService.Save(businessLog); }
/// <summary> /// 更新一条数据. /// </summary> public void Update(Sys_BusinessLogModel model) { DBProvider.dbMapper.Update("Sys_BusinessLog.Update", model); }
/// <summary> /// 增加一条数据. /// </summary> public void Add(Sys_BusinessLogModel model) { DBProvider.dbMapper.Insert("Sys_BusinessLog.Insert", model); }