public void UpdateEmployeeWithAttachment(EmployeeEntity entity, EmployeeAttachmentEntityNewLogic[] employeeAttachmentEntityNewLogics)
 {
     base.UseTran((tran) =>
     {
         var cmd = GetUpdateEmployeeCommand(this.Database, entity);
         base.Database.ExecuteNonQuery(cmd, tran);
         base.DeleteRelationData("employeeattachment", entity.EmpId, tran);
         employeeAttachmentEntityNewLogics.ToList().ForEach((attach) =>
         {
             var cmd1 = GetCreateAttachmentCommand(this.Database, attach);
             base.Database.ExecuteNonQuery(cmd1, tran);
             var attachId = base.Database.GetParameterValue(cmd1, "Id").ToString();
         });
     });
 }
 public static DbCommand GetCreateAttachmentCommand(Database database, EmployeeAttachmentEntityNewLogic attach)
 {
     DbCommand cmd = database.GetStoredProcCommand("P_CreateEmployeeAttachment");
     database.AddOutParameter(cmd, "Id", DbType.String, 36);
     database.AddInParameter(cmd, "EmpId", DbType.String, attach.EmpId);
     database.AddInParameter(cmd, "SaveName", DbType.String, attach.SaveName);
     database.AddInParameter(cmd, "ShowName", DbType.String, attach.ShowName);
     return cmd;
 }