///存到資料庫- ForensicSMS public void SMSCreate(ISheet sheet, Attachment attach) { IRow row = null; if (sheet != null) { int rowCount = sheet.LastRowNum; if (rowCount > 0) { IRow firstRow = sheet.GetRow(0); //NPOI row for (int i = 0; i <= rowCount; i++) { row = sheet.GetRow(i); if (row == null) { continue; } ForensicSMS sms = new ForensicSMS(); sms = SMSMapper(sms, row); if (sms != null) { sms.GetType().GetProperty("AttachmentId").SetValue(sms, attach.AttachmentId); smsService.Create(sms); } } } } }
///存到資料庫- ForensicContact public void ContaCreate(ISheet sheet, Attachment attach) { IRow row = null; if (sheet != null) { int rowCount = sheet.LastRowNum; if (rowCount > 0) { IRow firstRow = sheet.GetRow(0); //NPOI row for (int i = 0; i <= rowCount; i++) { row = sheet.GetRow(i); if (row == null) { continue; } ForensicContact conta = new ForensicContact(); conta = ContaMapper(conta, row); if (conta != null) { conta.GetType().GetProperty("AttachmentId").SetValue(conta, attach.AttachmentId); contService.Create(conta); } } } } }
///存到資料庫- CommunRecord public void CommunCreate(ISheet sheet, Attachment attach) { IRow row = null; if (sheet != null) { int rowCount = sheet.LastRowNum; if (rowCount > 0) { IRow firstRow = sheet.GetRow(0); //NPOI row int cellCount = firstRow.LastCellNum; for (int i = 0; i <= rowCount; i++) { row = sheet.GetRow(i); if (row == null) { continue; } CommunRecord rec = new CommunRecord(); rec = CommunMapper(rec, row); if (rec != null) { rec.GetType().GetProperty("AttachmentId").SetValue(rec, attach.AttachmentId); commCrud.Create(rec); } } } } }
public void RoleAddFeature(int roleId, int FeatureId) { RoleFeature rf = new RoleFeature() { FeatureId = FeatureId, RoleId = roleId }; rfSrv.Create(rf); }
public void MemberAddRole(int memberId, int roleId) { RoleMember roleMember = new RoleMember() { RoleId = roleId, MemberId = memberId }; srv.Create(roleMember); }